diff options
author | 2020-08-11 18:29:58 +0000 | |
---|---|---|
committer | 2020-08-11 18:29:58 +0000 | |
commit | bd0b836019abef58cbbe6ee46c8e8fef5d7d48b0 (patch) | |
tree | e13d1a7556aa1f477e1558109bd1f4f48d553249 /lib/libssl/ssl_lib.c | |
parent | Update awk to August 7, 2020 version. (diff) | |
download | wireguard-openbsd-bd0b836019abef58cbbe6ee46c8e8fef5d7d48b0.tar.xz wireguard-openbsd-bd0b836019abef58cbbe6ee46c8e8fef5d7d48b0.zip |
setitimer(2): consolidate copyin(9), input validation, input conversion
For what are probably historical reasons, setitimer(2) does not
validate its input (itv) immediately after copyin(9). Instead, it
waits until after (possibly) performing a getitimer(2) to copy out the
state of the timer.
Consolidating copyin(9), input validation, and input conversion into a
single block before the getitimer(2) operation makes setitimer(2)
itself easier to read. It will also simplify merging the critical
sections of setitimer(2) and getitimer(2) in a subsequent patch.
This changes setitimer(2)'s behavior in the EINVAL case. Currently,
if your input (itv) is invalid, we return EINVAL *after* modifying the
output (olditv). With the patch we will now return EINVAL *before*
modifying the output. However, any code dependent upon this behavior
is broken: the contents of olditv are undefined in all setitimer(2)
error cases.
ok millert@
Diffstat (limited to 'lib/libssl/ssl_lib.c')
0 files changed, 0 insertions, 0 deletions