Skip to content
Snippets Groups Projects
Commit d668769e authored by Pavel Skripkin's avatar Pavel Skripkin Committed by Jakub Kicinski
Browse files

net: mcs7830: handle usb read errors properly


Syzbot reported uninit value in mcs7830_bind(). The problem was in
missing validation check for bytes read via usbnet_read_cmd().

usbnet_read_cmd() internally calls usb_control_msg(), that returns
number of bytes read. Code should validate that requested number of bytes
was actually read.

So, this patch adds missing size validation check inside
mcs7830_get_reg() to prevent uninit value bugs

Reported-and-tested-by: default avatar <syzbot+003c0a286b9af5412510@syzkaller.appspotmail.com>
Fixes: 2a36d708 ("USB: driver for mcs7830 (aka DeLOCK) USB ethernet adapter")
Signed-off-by: default avatarPavel Skripkin <paskripkin@gmail.com>
Reviewed-by: default avatarArnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20220106225716.7425-1-paskripkin@gmail.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 6f022c2d
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment