about summary refs log tree commit diff
path: root/src/time/difftime.c
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2018-04-05 11:04:21 -0400
committerRich Felker <dalias@aerifal.cx>2018-04-05 11:04:21 -0400
commit119bc55ba66542a1c2fb7fc1c4e6c85f46b97c57 (patch)
tree601d061d2cd883c94bf98aa104ca43fd05408beb /src/time/difftime.c
parent282b1cd26649d69de038111f5876853df6ddc345 (diff)
downloadmusl-119bc55ba66542a1c2fb7fc1c4e6c85f46b97c57.tar.gz
musl-119bc55ba66542a1c2fb7fc1c4e6c85f46b97c57.tar.xz
musl-119bc55ba66542a1c2fb7fc1c4e6c85f46b97c57.zip
prevent bypass of guarantee that suids start with fd 0/1/2 open
it was reported by Erik Bosman that poll fails without setting revents
when the nfds argument exceeds the current value for RLIMIT_NOFILE,
causing the subsequent open calls to be bypassed. if the rlimit is
either 1 or 2, this leaves fd 0 and 1 potentially closed but openable
when the application code is reached.

based on a brief reading of the poll syscall documentation and code,
it may be possible for poll to fail under other attacker-controlled
conditions as well. if it turns out these are reasonable conditions
that may happen in the real world, we may have to go back and
implement fallbacks to probe each fd individually if poll fails, but
for now, keep things simple and treat all poll failures as fatal.
Diffstat (limited to 'src/time/difftime.c')
0 files changed, 0 insertions, 0 deletions