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-next>] [day] [month] [year] [list]
Message-ID: <ee535ac.6def.193d8967e04.Coremail.sh.jiang@zju.edu.cn>
Date: Wed, 18 Dec 2024 15:06:01 +0800 (GMT+08:00)
From: 江世昊 <sh.jiang@....edu.cn>
To: security@...nel.org
Cc: linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org,
	syzkaller@...glegroups.com, gregkh@...uxfoundation.org
Subject: [bug report] usb: WARNING in usb_free_urb

Hello developers,

We hit this issue when fuzzing the usb module with Syzkaller.

HEAD commit: 819837584309 6.12.0-rc5
git tree: upstream
kernel config: https://drive.google.com/file/d/1-9pltE-1CMgGgNFu9o5l0BlCHk3Rnzb_/view?usp=drive_link
console output: https://drive.google.com/file/d/1X-kcCiTBxVr62OXExiOnJIuMVHeyUm4o/view?usp=sharing
syz repro: https://drive.google.com/file/d/1baQYznawknskJBUNWhAl0cgckV5m0_ih/view?usp=sharing
C reproducer: https://drive.google.com/file/d/1nK_keaTF9vMxqD_SVMWXlZOno4CUyl17/view?usp=sharing

A similar but not identical problem has been found: https://lore.kernel.org/all/000000000000922b0b0619de5b8f@google.com/T/.
And an ad-hoc patch is proposed: https://syzkaller.appspot.com/text?tag=Patch&x=1209fabc980000.

Environment:
Ubuntu 22.04 on Linux 5.15
QEMU emulator version 6.2.0
qemu-system-x86_64 \
-m 2G \
-smp 2 \
-kernel /home/wd/bzImage \
-append "console=ttyS0 root=/dev/sda earlyprintk=serial net.ifnames=0" \
-drive file=/home/wd/bullseye.img,format=raw \
-net user,host=10.0.2.10,hostfwd=tcp:127.0.0.1:10021-:22 \
-net nic,model=e1000 \
-enable-kvm \
-nographic \
-pidfile vm.pid \
2>&1 | tee vm.log

If you fix this issue, please add the following tag to the commit:
Reported-by: Shihao Jiang<sh.jiang@....edu.cn>

====================================================
WARNING: CPU: 0 PID: 9 at mm/slub.c:4689 free_large_kmalloc+0xc5/0x120 mm/slub.c:4689
Modules linked in:
CPU: 0 UID: 0 PID: 9 Comm: kworker/0:1 Tainted: G        W          6.12.0-rc5 #1
Tainted: [W]=WARN
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.15.0-1 04/01/2014
Workqueue: usb_hub_wq hub_event
RIP: 0010:free_large_kmalloc+0xc5/0x120 mm/slub.c:4689
Code: 11 78 b2 ff 44 89 e2 be 06 00 00 00 48 89 ef e8 51 cd 12 00 e8 2c 76 b2 ff eb bf 5b 48 89 ef 5d 41 5c 41 5d e9 4c 5c e3 ff 90 <0f> 0b 90 80 3d 73 eb 24 0e 00 74 31 48 8b 74 24 20 4c 89 e7 41 bc
RSP: 0018:ffffc900003aee58 EFLAGS: 00010246
RAX: 04fff00000000000 RBX: 0000000000000100 RCX: ffffc90008251000
RDX: 0000000000000000 RSI: ffff8880514e2000 RDI: ffffea0001453880
RBP: ffffea0001453880 R08: 0000000000000001 R09: ffffed1003d85480
R10: 0000000000000000 R11: ffffffff81004eba R12: ffff8880514e2000
R13: ffff888029e27000 R14: dffffc0000000000 R15: ffff88802b1380f0
FS:  0000000000000000(0000) GS:ffff88802b800000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f06340190f0 CR3: 000000007cff2000 CR4: 0000000000352ef0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 urb_destroy drivers/usb/core/urb.c:25 [inline]
 kref_put include/linux/kref.h:65 [inline]
 usb_free_urb+0xef/0x100 drivers/usb/core/urb.c:97
 smsusb_term_device+0x108/0x1e0 drivers/media/usb/siano/smsusb.c:352
 smsusb_init_device+0x935/0xe00 drivers/media/usb/siano/smsusb.c:497
 smsusb_probe+0x5b1/0x1070 drivers/media/usb/siano/smsusb.c:575
 usb_probe_interface+0x314/0x9f0 drivers/usb/core/driver.c:399
 call_driver_probe drivers/base/dd.c:579 [inline]
 really_probe+0x252/0xa90 drivers/base/dd.c:658
 __driver_probe_device+0x1df/0x450 drivers/base/dd.c:800
 driver_probe_device+0x4c/0x1a0 drivers/base/dd.c:830
 __device_attach_driver+0x1db/0x2f0 drivers/base/dd.c:958
 bus_for_each_drv+0x14c/0x1d0 drivers/base/bus.c:459
 __device_attach+0x1f2/0x4c0 drivers/base/dd.c:1030
 bus_probe_device+0x17f/0x1c0 drivers/base/bus.c:534
 device_add+0x110b/0x1a20 drivers/base/core.c:3675
 usb_set_configuration+0x11c0/0x1c90 drivers/usb/core/message.c:2210
 usb_generic_driver_probe+0xb7/0x110 drivers/usb/core/generic.c:254
 usb_probe_device+0xed/0x3e0 drivers/usb/core/driver.c:294
 call_driver_probe drivers/base/dd.c:579 [inline]
 really_probe+0x252/0xa90 drivers/base/dd.c:658
 __driver_probe_device+0x1df/0x450 drivers/base/dd.c:800
 driver_probe_device+0x4c/0x1a0 drivers/base/dd.c:830
 __device_attach_driver+0x1db/0x2f0 drivers/base/dd.c:958
 bus_for_each_drv+0x14c/0x1d0 drivers/base/bus.c:459
 __device_attach+0x1f2/0x4c0 drivers/base/dd.c:1030
 bus_probe_device+0x17f/0x1c0 drivers/base/bus.c:534
 device_add+0x110b/0x1a20 drivers/base/core.c:3675
 usb_new_device+0xd46/0x1990 drivers/usb/core/hub.c:2651
 hub_port_connect drivers/usb/core/hub.c:5521 [inline]
 hub_port_connect_change drivers/usb/core/hub.c:5661 [inline]
 port_event drivers/usb/core/hub.c:5821 [inline]
 hub_event+0x2c3b/0x4cd0 drivers/usb/core/hub.c:5903
 process_one_work+0x95a/0x1b20 kernel/workqueue.c:3229
 process_scheduled_works kernel/workqueue.c:3310 [inline]
 worker_thread+0x677/0xe90 kernel/workqueue.c:3391
 kthread+0x2ca/0x3b0 kernel/kthread.c:389
 ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:147
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
 </TASK>
====================================================

Best Regards, 
Shihao.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ