- Remove the Giant acquisition from linux_socket_ioctl() as it was really
there to protect fdrop() (which in turn can call vrele()), however, fdrop_locked() grabs Giant for us, so we do not have to. Reviewed by: jhb Inspired by: alc
This commit is contained in:
parent
145ec10619
commit
57d14ec550
@ -2027,15 +2027,10 @@ linux_ioctl_socket(struct thread *td, struct linux_ioctl_args *args)
|
|||||||
ifp = NULL;
|
ifp = NULL;
|
||||||
error = 0;
|
error = 0;
|
||||||
|
|
||||||
mtx_lock(&Giant);
|
if ((error = fget(td, args->fd, &fp)) != 0)
|
||||||
if ((error = fget(td, args->fd, &fp)) != 0) {
|
|
||||||
mtx_unlock(&Giant);
|
|
||||||
return (error);
|
return (error);
|
||||||
}
|
|
||||||
type = fp->f_type;
|
type = fp->f_type;
|
||||||
fdrop(fp, td);
|
fdrop(fp, td);
|
||||||
mtx_unlock(&Giant);
|
|
||||||
|
|
||||||
if (type != DTYPE_SOCKET) {
|
if (type != DTYPE_SOCKET) {
|
||||||
/* not a socket - probably a tap / vmnet device */
|
/* not a socket - probably a tap / vmnet device */
|
||||||
switch (args->cmd) {
|
switch (args->cmd) {
|
||||||
@ -2243,14 +2238,10 @@ linux_ioctl_private(struct thread *td, struct linux_ioctl_args *args)
|
|||||||
struct file *fp;
|
struct file *fp;
|
||||||
int error, type;
|
int error, type;
|
||||||
|
|
||||||
mtx_lock(&Giant);
|
if ((error = fget(td, args->fd, &fp)) != 0)
|
||||||
if ((error = fget(td, args->fd, &fp)) != 0) {
|
|
||||||
mtx_unlock(&Giant);
|
|
||||||
return (error);
|
return (error);
|
||||||
}
|
|
||||||
type = fp->f_type;
|
type = fp->f_type;
|
||||||
fdrop(fp, td);
|
fdrop(fp, td);
|
||||||
mtx_unlock(&Giant);
|
|
||||||
if (type == DTYPE_SOCKET)
|
if (type == DTYPE_SOCKET)
|
||||||
return (linux_ioctl_socket(td, args));
|
return (linux_ioctl_socket(td, args));
|
||||||
return (ENOIOCTL);
|
return (ENOIOCTL);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user