mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-20 09:49:15 +03:00
Kernel: Limit the number of file descriptors sys$poll() can handle
Just slap an arbitrary limit on there so we don't panic if somebody asks us to poll 1 fajillion fds. Found by fuzz-syscalls. :^)
This commit is contained in:
parent
7551090056
commit
62f0f73bf0
Notes:
sideshowbarker
2024-07-18 22:22:36 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/62f0f73bf0e
@ -147,6 +147,10 @@ int Process::sys$poll(Userspace<const Syscall::SC_poll_params*> user_params)
|
||||
if (!copy_from_user(¶ms, user_params))
|
||||
return -EFAULT;
|
||||
|
||||
// This limit is just a number from the place where numbers come from.
|
||||
if (params.nfds >= 16384)
|
||||
return -ENOBUFS;
|
||||
|
||||
Thread::BlockTimeout timeout;
|
||||
if (params.timeout) {
|
||||
timespec timeout_copy;
|
||||
|
Loading…
Reference in New Issue
Block a user