]> www.infradead.org Git - users/dwmw2/linux.git/commit
USB: serial: option: add interface-number sanity check to flag handling
authorJohan Hovold <johan@kernel.org>
Wed, 9 Dec 2020 10:42:21 +0000 (11:42 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 29 Dec 2020 12:46:48 +0000 (13:46 +0100)
commitbf0c09de2ea17f49121a9a2f740b8b9742bcc96b
treef372717f68d6b3dfab4d527fa1f15d89ace72ef2
parent7ed6876b4b5c5e100c8d3df06c5abd837c2768d8
USB: serial: option: add interface-number sanity check to flag handling

commit a251963f76fa0226d0fdf0c4f989496f18d9ae7f upstream.

Add an interface-number sanity check before testing the device flags to
avoid relying on undefined behaviour when left shifting in case a device
uses an interface number greater than or equal to BITS_PER_LONG (i.e. 64
or 32).

Reported-by: syzbot+8881b478dad0a7971f79@syzkaller.appspotmail.com
Fixes: c3a65808f04a ("USB: serial: option: reimplement interface masking")
Cc: stable@vger.kernel.org
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/serial/option.c