History log of /src/tests/lib/libc/sys/t_select.c |
Revision | | Date | Author | Comments |
1.5 |
| 18-Oct-2024 |
riastradh | tests/lib/libc/sys/t_select: Test select on bad file descriptors.
This should immediately fail, not hang, even if the bad fd is high-numbered.
PR kern/57504: select with large enough bogus fd number set hangs instead of failing with EBADF
|
1.4 |
| 13-Jan-2017 |
christos | branches: 1.4.16; 1.4.28; 1.4.30; PR/51861: Ngie Cooper: Sprinkle __unused, mark __dead, _exit().
|
1.3 |
| 18-Mar-2012 |
jruoho | branches: 1.3.14; Move the references to PRs from code comments to the test description. Once ATF has the ability to output the metadata in the HTML reports, it should be easy to traverse between releng and gnats -reports via links.
|
1.2 |
| 12-Dec-2011 |
skrll | Give the child more time to timeout, etc.
|
1.1 |
| 07-Jul-2011 |
jruoho | branches: 1.1.2; Add the syscall tests back. Couple of files and tests were also renamed for consistency. All of these now mimic the libc structure.
|
1.1.2.1 |
| 17-Apr-2012 |
yamt | sync with head
|
1.3.14.1 |
| 20-Mar-2017 |
pgoyette | Sync with HEAD
|
1.4.30.1 |
| 02-Aug-2025 |
perseant | Sync with HEAD
|
1.4.28.1 |
| 18-Nov-2024 |
martin | Pull up following revision(s) (requested by riastradh in ticket #1011):
sys/kern/sys_select.c: revision 1.67 tests/lib/libc/sys/t_select.c: revision 1.5
PR kern/57504 : Check all fds passed in to select
If an application passes in a huge fd_set (select(BIG, ...)) then check every bit in the fd_sets provided, to make sure they are valid.
If BIG is too big (cannot possibly represent an open fd for this process, under any circumstances: ie: not just because that many are not currently open) return EINVAL. Otherwise, check every set bit to make sure it is valid. Any fd bits set above the applications current highest open fd automatically generate EBADF and quick(ish) exit. fd's that are within the plausible range are then checked as they always were (it is possible for there to be a few there above the max open fd - as everything in select is done in multiples of __FDBITS (fd_mask) but the max open fd is not so constrained. Those always were checked, continue using the same mechanism.
This should have zero impact on any sane application which uses the highest fd for which it set a bit, +1, as the first arg to select. However, if there are any broken applications that were relying upon the previous behaviour of simply ignoring any fd_masks that started beyond the max number of open files, then they might (if they happen to have any bits set) now fail.
tests/lib/libc/sys/t_select: Test select on bad file descriptors. This should immediately fail, not hang, even if the bad fd is high-numbered.
PR kern/57504: select with large enough bogus fd number set hangs instead of failing with EBADF
|
1.4.16.1 |
| 20-Nov-2024 |
martin | Pull up following revision(s) (requested by riastradh in ticket #1926):
sys/kern/sys_select.c: revision 1.67 (patch) tests/lib/libc/sys/t_select.c: revision 1.5 (patch)
PR kern/57504 : Check all fds passed in to select
If an application passes in a huge fd_set (select(BIG, ...)) then check every bit in the fd_sets provided, to make sure they are valid.
If BIG is too big (cannot possibly represent an open fd for this process, under any circumstances: ie: not just because that many are not currently open) return EINVAL.
Otherwise, check every set bit to make sure it is valid. Any fd bits set above the applications current highest open fd automatically generate EBADF and quick(ish) exit. fd's that are within the plausible range are then checked as they always were (it is possible for there to be a few there above the max open fd - as everything in select is done in multiples of __FDBITS (fd_mask) but the max open fd is not so constrained. Those always were checked, continue using the same mechanism.
This should have zero impact on any sane application which uses the highest fd for which it set a bit, +1, as the first arg to select. However, if there are any broken applications that were relying upon the previous behaviour of simply ignoring any fd_masks that started beyond the max number of open files, then they might (if they happen to have any bits set) now fail.
tests/lib/libc/sys/t_select: Test select on bad file descriptors.
This should immediately fail, not hang, even if the bad fd is high-numbered.
PR kern/57504: select with large enough bogus fd number set hangs instead of failing with EBADF
|