diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2012-08-18 00:25:51 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-09-26 21:08:50 -0400 |
commit | 56b31d1c9f1e6a3ad92e7bfe252721e05d92b285 (patch) | |
tree | 44521dbcdf51695b6092f2a4dabe83f460c2ed7c /include/linux/net.h | |
parent | 28407630513b1a86133db0ef8b39fabad6c494af (diff) |
unexport sock_map_fd(), switch to sock_alloc_file()
Both modular callers of sock_map_fd() had been buggy; sctp one leaks
descriptor and file if copy_to_user() fails, 9p one shouldn't be
exposing file in the descriptor table at all.
Switch both to sock_alloc_file(), export it, unexport sock_map_fd() and
make it static.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'include/linux/net.h')
-rw-r--r-- | include/linux/net.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/linux/net.h b/include/linux/net.h index 99276c3dc89a..c8a9708d4d66 100644 --- a/include/linux/net.h +++ b/include/linux/net.h | |||
@@ -65,6 +65,7 @@ typedef enum { | |||
65 | struct poll_table_struct; | 65 | struct poll_table_struct; |
66 | struct pipe_inode_info; | 66 | struct pipe_inode_info; |
67 | struct inode; | 67 | struct inode; |
68 | struct file; | ||
68 | struct net; | 69 | struct net; |
69 | 70 | ||
70 | #define SOCK_ASYNC_NOSPACE 0 | 71 | #define SOCK_ASYNC_NOSPACE 0 |
@@ -246,7 +247,7 @@ extern int sock_sendmsg(struct socket *sock, struct msghdr *msg, | |||
246 | size_t len); | 247 | size_t len); |
247 | extern int sock_recvmsg(struct socket *sock, struct msghdr *msg, | 248 | extern int sock_recvmsg(struct socket *sock, struct msghdr *msg, |
248 | size_t size, int flags); | 249 | size_t size, int flags); |
249 | extern int sock_map_fd(struct socket *sock, int flags); | 250 | extern struct file *sock_alloc_file(struct socket *sock, int flags); |
250 | extern struct socket *sockfd_lookup(int fd, int *err); | 251 | extern struct socket *sockfd_lookup(int fd, int *err); |
251 | extern struct socket *sock_from_file(struct file *file, int *err); | 252 | extern struct socket *sock_from_file(struct file *file, int *err); |
252 | #define sockfd_put(sock) fput(sock->file) | 253 | #define sockfd_put(sock) fput(sock->file) |