summaryrefslogtreecommitdiffstats
path: root/usr.bin/diff/diffdir.c
diff options
context:
space:
mode:
authorcheloha <cheloha@openbsd.org>2019-01-23 00:37:51 +0000
committercheloha <cheloha@openbsd.org>2019-01-23 00:37:51 +0000
commita063d7252a83ba09260fe5b1090a37a8537e4560 (patch)
tree90e52d30b50773d87c1b424a560e08f75a010347 /usr.bin/diff/diffdir.c
parentpass most arguments to the KEX hash functions as sshbuf rather (diff)
downloadwireguard-openbsd-a063d7252a83ba09260fe5b1090a37a8537e4560.tar.xz
wireguard-openbsd-a063d7252a83ba09260fe5b1090a37a8537e4560.zip
futimens(2), futimes(2), utimensat(2), utimes(2): Validate input at copyin
Currently we validate time input for all four of these syscalls in the workhorse function dovutimens(). This is bad because both futimes(2) and utimes(2) have input as timevals that need to be converted to timespecs. This multiplication can overflow to create a "valid" input, e.g. if tv_usec is equal to 2^61 (invalid value) on a platform with 64-bit longs, the resulting tv_nsec is equal to zero (valid value). This is also a bit wasteful. We aquire a vnode and do other work under KERNEL_LOCK only to release the vnode when the time input is invalid. So, duplicate a bit of code to validate the time inputs before we do any conversions or real VFS work. probably still ok tedu@ deraadt@
Diffstat (limited to 'usr.bin/diff/diffdir.c')
0 files changed, 0 insertions, 0 deletions