summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_kthread.c
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2011-11-13 10:28:01 +0000
committerkib <kib@FreeBSD.org>2011-11-13 10:28:01 +0000
commitca682488f300f9d4de73109f4b4ff0cff1fc3cc3 (patch)
tree9205e85c565352e45d99bcf206234debf4068147 /sys/kern/kern_kthread.c
parent6280e6aab30ab8155db6f5501b64a45218baf2e1 (diff)
downloadFreeBSD-src-ca682488f300f9d4de73109f4b4ff0cff1fc3cc3.zip
FreeBSD-src-ca682488f300f9d4de73109f4b4ff0cff1fc3cc3.tar.gz
To limit amount of the kernel memory allocated, and to optimize the
iteration over the fdsets, kern_select() limits the length of the fdsets copied in by the last valid file descriptor index. If any bit is set in a mask above the limit, current implementation ignores the filedescriptor, instead of returning EBADF. Fix the issue by scanning the tails of fdset before entering the select loop and returning EBADF if any bit above last valid filedescriptor index is set. The performance impact of the additional check is only imposed on the (somewhat) buggy applications that pass bad file descriptors to select(2) or pselect(2). PR: kern/155606, kern/162379 Discussed with: cognet, glebius Tested by: andreast (powerpc, all 64/32bit ABI combinations, big-endian), marius (sparc64, big-endian) MFC after: 2 weeks
Diffstat (limited to 'sys/kern/kern_kthread.c')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud