HomeFreeBSD

sigtimedwait: Prevent timeout math overflows.

Description

sigtimedwait: Prevent timeout math overflows.

Our kern_sigtimedwait() calculates absolute sleep timo value as 'uptime+timeout'.
So, when the user specifies a big timeout value (LONG_MAX), the calculated
timo can be less the the current uptime value.
In that case kern_sigtimedwait() returns EAGAIN instead of EINTR, if
unblocked signal was caught.

While here switch to a high-precision sleep method.

Reviewed by: mav, kib
In collaboration with: mav
Differential revision: https://reviews.freebsd.org/D34981
MFC after: 2 weeks

Details

Provenance
dchaginAuthored on Apr 25 2022, 7:23 AM
Reviewer
mav
Differential Revision
D34981: sigtimedwait: Prevent timeout math overflows.
Parents
rG6201a50d0d6d: linux(4): Refactor signal send methods.
Branches
Unknown
Tags
Unknown