aboutsummaryrefslogtreecommitdiffstats
path: root/net/unix/af_unix.c
diff options
context:
space:
mode:
authorDavide Libenzi <[email protected]>2008-12-01 21:13:55 +0000
committerLinus Torvalds <[email protected]>2008-12-02 03:55:24 +0000
commit7ef9964e6d1b911b78709f144000aacadd0ebc21 (patch)
tree30667d0a2f8e53973ff48d2c02df48bbc6fe74aa /net/unix/af_unix.c
parentspi: mpc52xx_psc_spi chipselect bugfix (diff)
downloadkernel-7ef9964e6d1b911b78709f144000aacadd0ebc21.tar.gz
kernel-7ef9964e6d1b911b78709f144000aacadd0ebc21.zip
epoll: introduce resource usage limits
It has been thought that the per-user file descriptors limit would also limit the resources that a normal user can request via the epoll interface. Vegard Nossum reported a very simple program (a modified version attached) that can make a normal user to request a pretty large amount of kernel memory, well within the its maximum number of fds. To solve such problem, default limits are now imposed, and /proc based configuration has been introduced. A new directory has been created, named /proc/sys/fs/epoll/ and inside there, there are two configuration points: max_user_instances = Maximum number of devices - per user max_user_watches = Maximum number of "watched" fds - per user The current default for "max_user_watches" limits the memory used by epoll to store "watches", to 1/32 of the amount of the low RAM. As example, a 256MB 32bit machine, will have "max_user_watches" set to roughly 90000. That should be enough to not break existing heavy epoll users. The default value for "max_user_instances" is set to 128, that should be enough too. This also changes the userspace, because a new error code can now come out from EPOLL_CTL_ADD (-ENOSPC). The EMFILE from epoll_create() was already listed, so that should be ok. [[email protected]: use get_current_user()] Signed-off-by: Davide Libenzi <[email protected]> Cc: Michael Kerrisk <[email protected]> Cc: <[email protected]> Cc: Cyrill Gorcunov <[email protected]> Reported-by: Vegard Nossum <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'net/unix/af_unix.c')
0 files changed, 0 insertions, 0 deletions