path: root/arch/generic/bits
diff options
authorRich Felker <>2019-07-29 21:08:43 -0400
committerRich Felker <>2019-07-30 14:23:56 -0400
commit722a1ae3351a03ab25010dbebd492eced664853b (patch)
tree746ede9edc9520201dfee63df68d9409a9295d5c /arch/generic/bits
parent6a4a1691a0653bd51a30c2b8ac19448b7ebac796 (diff)
select: overhaul for time64
major changes are made alongside adding time64 syscall support to account for issues found during research. select historically accepts non-normalized (tv_usec not restricted to less than 1000000) timeouts, and the kernel normalizes them, but the normalization code is buggy and subject to integer overflows. since normalization is needed anyway when using SYS_pselect6 or SYS_pselect6_time64 as the backend, simply do it up-front to eliminate both code path complexity and the possibility of kernel bugs. as a side effect, select no longer updates the caller's timeout timeval with the remaining time. previously, archs that used SYS_select updated it and archs that used SYS_pselect6 didn't. this change may turn out to be controversial and may need revisiting, but in any case the old behavior was not strictly conforming. POSIX allows modification of the timeout "upon successful completion", but the Linux syscall modifies it upon unsuccessful completion (EINTR) as well (and presumably each time the syscall stops and restarts before it's known whether completion will be successful). it's possible that this language does not reflect the actual intent of the standard, since other historical implementations probably behaved like Linux, but that should be clarified if there's a desire to bring the old behavior back. regardless, programs that are depending on this are not correct and are already broken on some archs we support.
Diffstat (limited to 'arch/generic/bits')
0 files changed, 0 insertions, 0 deletions