patch-2.2.7 linux/net/socket.c
Next file: linux/scripts/ksymoops/oops.c
Previous file: linux/net/sched/sch_sfq.c
Back to the patch index
Back to the overall index
- Lines: 32
- Date:
Thu Apr 22 19:45:20 1999
- Orig file:
v2.2.6/linux/net/socket.c
- Orig date:
Tue Mar 23 14:35:48 1999
diff -u --recursive --new-file v2.2.6/linux/net/socket.c linux/net/socket.c
@@ -279,8 +279,8 @@
inode->i_mode = S_IFSOCK|S_IRWXUGO;
inode->i_sock = 1;
- inode->i_uid = current->uid;
- inode->i_gid = current->gid;
+ inode->i_uid = current->fsuid;
+ inode->i_gid = current->fsgid;
sock->inode = inode;
init_waitqueue(&sock->wait);
@@ -1135,7 +1135,7 @@
/* Check whether to allocate the iovec area*/
err = -ENOMEM;
iov_size = msg_sys.msg_iovlen * sizeof(struct iovec);
- if (msg_sys.msg_iovlen > 1 /* UIO_FASTIOV */) {
+ if (msg_sys.msg_iovlen > UIO_FASTIOV) {
iov = sock_kmalloc(sock->sk, iov_size, GFP_KERNEL);
if (!iov)
goto out_put;
@@ -1147,6 +1147,11 @@
goto out_freeiov;
total_len = err;
+ err = -ENOBUFS;
+
+ /* msg_controllen must fit to int */
+ if (msg_sys.msg_controllen > INT_MAX)
+ goto out_freeiov;
ctl_len = msg_sys.msg_controllen;
if (ctl_len)
{
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)