From: Pavel Skripkin <paskripkin@gmail.com>
To: syzbot <syzbot+003c0a286b9af5412510@syzkaller.appspotmail.com>,
glider@google.com, gregkh@linuxfoundation.org, johan@kernel.org,
linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org,
stern@rowland.harvard.edu, syzkaller-bugs@googlegroups.com
Subject: Re: [syzbot] KMSAN: kernel-usb-infoleak in usbnet_write_cmd (3)
Date: Fri, 7 Jan 2022 01:17:41 +0300 [thread overview]
Message-ID: <60e9caf1-7b9f-c5a4-a3e8-ff9135e16197@gmail.com> (raw)
In-Reply-To: <000000000000be665505d4d9ebd6@google.com>
[-- Attachment #1: Type: text/plain, Size: 1139 bytes --]
On 1/5/22 21:28, syzbot wrote:
> Hello,
>
> syzbot found the following issue on:
>
> HEAD commit: 81c325bbf94e kmsan: hooks: do not check memory in kmsan_in..
> git tree: https://github.com/google/kmsan.git master
> console output: https://syzkaller.appspot.com/x/log.txt?x=14a07163b00000
> kernel config: https://syzkaller.appspot.com/x/.config?x=2d8b9a11641dc9aa
> dashboard link: https://syzkaller.appspot.com/bug?extid=003c0a286b9af5412510
> compiler: clang version 14.0.0 (/usr/local/google/src/llvm-git-monorepo 2b554920f11c8b763cd9ed9003f4e19b919b8e1f), GNU ld (GNU Binutils for Debian) 2.35.2
> syz repro: https://syzkaller.appspot.com/x/repro.syz?x=100165dbb00000
> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=10c97e77b00000
>
> IMPORTANT: if you fix the issue, please add the following tag to the commit:
> Reported-by: syzbot+003c0a286b9af5412510@syzkaller.appspotmail.com
>
Heh, I think, more reports like this will appear soon. Syzbot learned
how to tweak usb read functions return values, I guess?
#syz test: https://github.com/google/kmsan.git master
With regards,
Pavel Skripkin
[-- Attachment #2: ph --]
[-- Type: text/plain, Size: 735 bytes --]
diff --git a/drivers/net/usb/mcs7830.c b/drivers/net/usb/mcs7830.c
index 326cc4e749d8..0daae7f16da9 100644
--- a/drivers/net/usb/mcs7830.c
+++ b/drivers/net/usb/mcs7830.c
@@ -108,8 +108,16 @@ static const char driver_name[] = "MOSCHIP usb-ethernet driver";
static int mcs7830_get_reg(struct usbnet *dev, u16 index, u16 size, void *data)
{
- return usbnet_read_cmd(dev, MCS7830_RD_BREQ, MCS7830_RD_BMREQ,
- 0x0000, index, data, size);
+ int ret;
+
+ ret = usbnet_read_cmd(dev, MCS7830_RD_BREQ, MCS7830_RD_BMREQ,
+ 0x0000, index, data, size);
+ if (ret < 0)
+ return ret;
+ else if (ret < size)
+ return -ENODATA;
+
+ return 0;
}
static int mcs7830_set_reg(struct usbnet *dev, u16 index, u16 size, const void *data)
next prev parent reply other threads:[~2022-01-06 22:17 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-05 18:28 syzbot
2022-01-06 22:17 ` Pavel Skripkin [this message]
2022-01-06 22:33 ` syzbot
2022-01-10 15:41 ` Alexander Potapenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=60e9caf1-7b9f-c5a4-a3e8-ff9135e16197@gmail.com \
--to=paskripkin@gmail.com \
--cc=glider@google.com \
--cc=gregkh@linuxfoundation.org \
--cc=johan@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=stern@rowland.harvard.edu \
--cc=syzbot+003c0a286b9af5412510@syzkaller.appspotmail.com \
--cc=syzkaller-bugs@googlegroups.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®