summaryrefslogtreecommitdiffstats
path: root/include/linux/socket.h
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2020-03-19 20:16:56 -0600
committerJens Axboe <axboe@kernel.dk>2020-03-20 08:48:36 -0600
commit09952e3e7826119ddd4357c453d54bcc7ef25156 (patch)
tree19e373248dd2c3db726505ff186de50f2d99b6cd /include/linux/socket.h
parent4022e7af86be2dd62975dedb6b7ea551d108695e (diff)
downloadlinux-09952e3e7826119ddd4357c453d54bcc7ef25156.tar.gz
linux-09952e3e7826119ddd4357c453d54bcc7ef25156.tar.bz2
linux-09952e3e7826119ddd4357c453d54bcc7ef25156.zip
io_uring: make sure accept honor rlimit nofile
Just like commit 4022e7af86be, this fixes the fact that IORING_OP_ACCEPT ends up using get_unused_fd_flags(), which checks current->signal->rlim[] for limits. Add an extra argument to __sys_accept4_file() that allows us to pass in the proper nofile limit, and grab it at request prep time. Acked-by: David S. Miller <davem@davemloft.net> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'include/linux/socket.h')
-rw-r--r--include/linux/socket.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/linux/socket.h b/include/linux/socket.h
index 2d2313403101..15f3412d481e 100644
--- a/include/linux/socket.h
+++ b/include/linux/socket.h
@@ -401,7 +401,8 @@ extern int __sys_sendto(int fd, void __user *buff, size_t len,
int addr_len);
extern int __sys_accept4_file(struct file *file, unsigned file_flags,
struct sockaddr __user *upeer_sockaddr,
- int __user *upeer_addrlen, int flags);
+ int __user *upeer_addrlen, int flags,
+ unsigned long nofile);
extern int __sys_accept4(int fd, struct sockaddr __user *upeer_sockaddr,
int __user *upeer_addrlen, int flags);
extern int __sys_socket(int family, int type, int protocol);