Re: Some socket syscalls fail to return an error on bad file-descriptor# argument

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 01 Jun 2006 13:38:55 +1000
Tony Griffiths <[email protected]> wrote:

> diff -urpN ./net/socket.c.orig ./net/socket.c
> --- ./net/socket.c.orig	2006-06-01 10:28:30.000000000 +1000
> +++ ./net/socket.c	2006-06-01 10:34:09.000000000 +1000
> @@ -496,6 +496,8 @@ static struct socket *sockfd_lookup_ligh
>  		if (sock)
>  			return sock;
>  		fput_light(file, *fput_needed);
> +	} else {
> +		*err = -EBADF;
>  	}
>  	return NULL;
>  }

Confused.  That patch cannot make any difference to this function:

static struct socket *sockfd_lookup_light(int fd, int *err, int *fput_needed)
{
	struct file *file;
	struct socket *sock;

	*err = -EBADF;
	file = fget_light(fd, fput_needed);
	if (file) {
		sock = sock_from_file(file, err);
		if (sock)
			return sock;
		fput_light(file, *fput_needed);
	}
	return NULL;
}


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux