Module Name:    src
Committed By:   nia
Date:           Fri Oct  9 10:41:53 UTC 2020

Modified Files:
        src/sys/compat/common: tty_43.c

Log Message:
tty_43: Check a bitset from userspace is valid before shifting it

Passing a negative value to these legacy compat ioctls results in
left shift on a negative value which is undefined behaviour and results
in the tty (at least, possibly other things) locking up.

The argument to the ioctl should always be > 0. Return EINVAL otherwise.

While here, adjustments to code style to match current guidelines.

Found by UBSan.

Reported-by: syzbot+39cd551a05298b222...@syzkaller.appspotmail.com


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sys/compat/common/tty_43.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Reply via email to