diff options
Diffstat (limited to 'net/socket.c')
| -rw-r--r-- | net/socket.c | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/net/socket.c b/net/socket.c index 92764d836891..06603d73c411 100644 --- a/net/socket.c +++ b/net/socket.c | |||
| @@ -69,7 +69,6 @@ | |||
| 69 | #include <linux/proc_fs.h> | 69 | #include <linux/proc_fs.h> |
| 70 | #include <linux/seq_file.h> | 70 | #include <linux/seq_file.h> |
| 71 | #include <linux/mutex.h> | 71 | #include <linux/mutex.h> |
| 72 | #include <linux/thread_info.h> | ||
| 73 | #include <linux/wanrouter.h> | 72 | #include <linux/wanrouter.h> |
| 74 | #include <linux/if_bridge.h> | 73 | #include <linux/if_bridge.h> |
| 75 | #include <linux/if_frad.h> | 74 | #include <linux/if_frad.h> |
| @@ -491,8 +490,8 @@ static struct socket *sock_alloc(void) | |||
| 491 | sock = SOCKET_I(inode); | 490 | sock = SOCKET_I(inode); |
| 492 | 491 | ||
| 493 | inode->i_mode = S_IFSOCK | S_IRWXUGO; | 492 | inode->i_mode = S_IFSOCK | S_IRWXUGO; |
| 494 | inode->i_uid = current->fsuid; | 493 | inode->i_uid = current_fsuid(); |
| 495 | inode->i_gid = current->fsgid; | 494 | inode->i_gid = current_fsgid(); |
| 496 | 495 | ||
| 497 | get_cpu_var(sockets_in_use)++; | 496 | get_cpu_var(sockets_in_use)++; |
| 498 | put_cpu_var(sockets_in_use); | 497 | put_cpu_var(sockets_in_use); |
| @@ -1314,13 +1313,7 @@ asmlinkage long sys_socketpair(int family, int type, int protocol, | |||
| 1314 | goto out_fd1; | 1313 | goto out_fd1; |
| 1315 | } | 1314 | } |
| 1316 | 1315 | ||
| 1317 | err = audit_fd_pair(fd1, fd2); | 1316 | audit_fd_pair(fd1, fd2); |
| 1318 | if (err < 0) { | ||
| 1319 | fput(newfile1); | ||
| 1320 | fput(newfile2); | ||
| 1321 | goto out_fd; | ||
| 1322 | } | ||
| 1323 | |||
| 1324 | fd_install(fd1, newfile1); | 1317 | fd_install(fd1, newfile1); |
| 1325 | fd_install(fd2, newfile2); | 1318 | fd_install(fd2, newfile2); |
| 1326 | /* fd1 and fd2 may be already another descriptors. | 1319 | /* fd1 and fd2 may be already another descriptors. |
| @@ -1350,7 +1343,6 @@ out_fd2: | |||
| 1350 | out_fd1: | 1343 | out_fd1: |
| 1351 | put_filp(newfile2); | 1344 | put_filp(newfile2); |
| 1352 | sock_release(sock2); | 1345 | sock_release(sock2); |
| 1353 | out_fd: | ||
| 1354 | put_unused_fd(fd1); | 1346 | put_unused_fd(fd1); |
| 1355 | put_unused_fd(fd2); | 1347 | put_unused_fd(fd2); |
| 1356 | goto out; | 1348 | goto out; |
| @@ -2066,9 +2058,7 @@ asmlinkage long sys_socketcall(int call, unsigned long __user *args) | |||
| 2066 | if (copy_from_user(a, args, nargs[call])) | 2058 | if (copy_from_user(a, args, nargs[call])) |
| 2067 | return -EFAULT; | 2059 | return -EFAULT; |
| 2068 | 2060 | ||
| 2069 | err = audit_socketcall(nargs[call] / sizeof(unsigned long), a); | 2061 | audit_socketcall(nargs[call] / sizeof(unsigned long), a); |
| 2070 | if (err) | ||
| 2071 | return err; | ||
| 2072 | 2062 | ||
| 2073 | a0 = a[0]; | 2063 | a0 = a[0]; |
| 2074 | a1 = a[1]; | 2064 | a1 = a[1]; |
| @@ -2307,6 +2297,7 @@ int kernel_accept(struct socket *sock, struct socket **newsock, int flags) | |||
| 2307 | } | 2297 | } |
| 2308 | 2298 | ||
| 2309 | (*newsock)->ops = sock->ops; | 2299 | (*newsock)->ops = sock->ops; |
| 2300 | __module_get((*newsock)->ops->owner); | ||
| 2310 | 2301 | ||
| 2311 | done: | 2302 | done: |
| 2312 | return err; | 2303 | return err; |
