lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.44L0.1912091337050.1462-100000@iolanthe.rowland.org>
Date:   Mon, 9 Dec 2019 13:38:32 -0500 (EST)
From:   Alan Stern <stern@...land.harvard.edu>
To:     syzbot <syzbot+09ef48aa58261464b621@...kaller.appspotmail.com>
cc:     andreyknvl@...gle.com, <benjamin.tissoires@...hat.com>,
        <jikos@...nel.org>, <linux-input@...r.kernel.org>,
        <linux-kernel@...r.kernel.org>, <linux-usb@...r.kernel.org>,
        <syzkaller-bugs@...glegroups.com>
Subject: Re: KASAN: slab-out-of-bounds Read in hid_field_extract

On Fri, 6 Dec 2019, syzbot wrote:

> Hello,
> 
> syzbot found the following crash on:
> 
> HEAD commit:    1f22d15c usb: gadget: add raw-gadget interface
> git tree:       https://github.com/google/kasan.git usb-fuzzer
> console output: https://syzkaller.appspot.com/x/log.txt?x=11d12861e00000
> kernel config:  https://syzkaller.appspot.com/x/.config?x=8ccee2968018adcb
> dashboard link: https://syzkaller.appspot.com/bug?extid=09ef48aa58261464b621
> compiler:       gcc (GCC) 9.0.0 20181231 (experimental)
> syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=101a781ee00000
> C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=15d71c2ae00000
> 
> IMPORTANT: if you fix the bug, please add the following tag to the commit:
> Reported-by: syzbot+09ef48aa58261464b621@...kaller.appspotmail.com
> 
> ==================================================================
> BUG: KASAN: slab-out-of-bounds in __extract drivers/hid/hid-core.c:1345  
> [inline]
> BUG: KASAN: slab-out-of-bounds in hid_field_extract+0x150/0x170  
> drivers/hid/hid-core.c:1365
> Read of size 1 at addr ffff8881cf50f000 by task swapper/0/0

Diagnostic patch.

#syz test: https://github.com/google/kasan.git 1f22d15c

Index: usb-devel/drivers/hid/hid-core.c
===================================================================
--- usb-devel.orig/drivers/hid/hid-core.c
+++ usb-devel/drivers/hid/hid-core.c
@@ -1488,6 +1488,7 @@ static void hid_input_field(struct hid_d
 	if (!value)
 		return;
 
+	hid_info(hid, "Field offset %u size %u count %u\n", offset, size, count);
 	for (n = 0; n < count; n++) {
 
 		value[n] = min < 0 ?
@@ -1712,6 +1713,7 @@ int hid_report_raw_event(struct hid_devi
 	}
 
 	if (hid->claimed != HID_CLAIMED_HIDRAW && report->maxfield) {
+		hid_info(hid, "Report rsize %u csize %u\n", rsize, csize);
 		for (a = 0; a < report->maxfield; a++)
 			hid_input_field(hid, report->field[a], cdata, interrupt);
 		hdrv = hid->driver;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ