syzbot


KASAN: use-after-free Read in hif_usb_regout_cb

Status: upstream: reported C repro on 2020/03/26 11:34
Reported-by: syzbot+b894396e6110e1df38c4@syzkaller.appspotmail.com
First crash: 986d, last: 907d
duplicates (1):
Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
KASAN: use-after-free Read in ath9k_htc_txcompletion_cb 8 907d 969d 0/24 closed as dup on 2020/06/12 13:08
Patch testing requests:
Created Duration User Patch Repo Result
2022/08/31 20:27 15m retest repro https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing error
2022/08/31 19:27 15m retest repro https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing error
2022/08/31 18:27 15m retest repro https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing error
2020/09/09 22:42 20m brookebasile@gmail.com upstream OK

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in atomic_read include/asm-generic/atomic-instrumented.h:26 [inline]
BUG: KASAN: use-after-free in refcount_read include/linux/refcount.h:134 [inline]
BUG: KASAN: use-after-free in skb_unref include/linux/skbuff.h:1042 [inline]
BUG: KASAN: use-after-free in kfree_skb+0x32/0x3d0 net/core/skbuff.c:692
Read of size 4 at addr ffff8881d15fd854 by task swapper/1/0

CPU: 1 PID: 0 Comm: swapper/1 Not tainted 5.6.0-rc7-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 <IRQ>
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0xef/0x16e lib/dump_stack.c:118
 print_address_description.constprop.0.cold+0xd3/0x314 mm/kasan/report.c:374
 __kasan_report.cold+0x37/0x77 mm/kasan/report.c:506
 kasan_report+0xe/0x20 mm/kasan/common.c:641
 check_memory_region_inline mm/kasan/generic.c:185 [inline]
 check_memory_region+0x152/0x1c0 mm/kasan/generic.c:192
 atomic_read include/asm-generic/atomic-instrumented.h:26 [inline]
 refcount_read include/linux/refcount.h:134 [inline]
 skb_unref include/linux/skbuff.h:1042 [inline]
 kfree_skb+0x32/0x3d0 net/core/skbuff.c:692
 hif_usb_regout_cb+0x14c/0x1b0 drivers/net/wireless/ath/ath9k/hif_usb.c:97
 __usb_hcd_giveback_urb+0x1f2/0x470 drivers/usb/core/hcd.c:1648
 usb_hcd_giveback_urb+0x368/0x420 drivers/usb/core/hcd.c:1713
 dummy_timer+0x1258/0x32ae drivers/usb/gadget/udc/dummy_hcd.c:1966
 call_timer_fn+0x195/0x6f0 kernel/time/timer.c:1404
 expire_timers kernel/time/timer.c:1449 [inline]
 __run_timers kernel/time/timer.c:1773 [inline]
 __run_timers kernel/time/timer.c:1740 [inline]
 run_timer_softirq+0x5f9/0x1500 kernel/time/timer.c:1786
 __do_softirq+0x21e/0x950 kernel/softirq.c:292
 invoke_softirq kernel/softirq.c:373 [inline]
 irq_exit+0x178/0x1a0 kernel/softirq.c:413
 exiting_irq arch/x86/include/asm/apic.h:546 [inline]
 smp_apic_timer_interrupt+0x141/0x540 arch/x86/kernel/apic/apic.c:1146
 apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:829
 </IRQ>
RIP: 0010:default_idle+0x28/0x300 arch/x86/kernel/process.c:696
Code: cc cc 41 56 41 55 65 44 8b 2d 44 eb 71 7a 41 54 55 53 0f 1f 44 00 00 e8 f6 d7 b4 fb e9 07 00 00 00 0f 00 2d aa 7c 52 00 fb f4 <65> 44 8b 2d 20 eb 71 7a 0f 1f 44 00 00 5b 5d 41 5c 41 5d 41 5e c3
RSP: 0018:ffff8881da22fda8 EFLAGS: 00000246 ORIG_RAX: ffffffffffffff13
RAX: 0000000000000007 RBX: ffff8881da213100 RCX: 0000000000000000
RDX: 0000000000000000 RSI: 0000000000000006 RDI: ffff8881da21394c
RBP: ffffed103b442620 R08: ffff8881da213100 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000001
R13: 0000000000000001 R14: ffffffff87e629c0 R15: 0000000000000000
 cpuidle_idle_call kernel/sched/idle.c:154 [inline]
 do_idle+0x3e0/0x500 kernel/sched/idle.c:269
 cpu_startup_entry+0x14/0x20 kernel/sched/idle.c:361
 start_secondary+0x2a4/0x390 arch/x86/kernel/smpboot.c:264
 secondary_startup_64+0xb6/0xc0 arch/x86/kernel/head_64.S:242

Allocated by task 21:
 save_stack+0x1b/0x80 mm/kasan/common.c:72
 set_track mm/kasan/common.c:80 [inline]
 __kasan_kmalloc mm/kasan/common.c:515 [inline]
 __kasan_kmalloc.constprop.0+0xbf/0xd0 mm/kasan/common.c:488
 slab_post_alloc_hook mm/slab.h:584 [inline]
 slab_alloc_node mm/slub.c:2786 [inline]
 kmem_cache_alloc_node+0xdc/0x330 mm/slub.c:2822
 __alloc_skb+0xba/0x5a0 net/core/skbuff.c:198
 alloc_skb include/linux/skbuff.h:1081 [inline]
 htc_connect_service+0x2cc/0x840 drivers/net/wireless/ath/ath9k/htc_hst.c:257
 ath9k_wmi_connect+0xd2/0x1a0 drivers/net/wireless/ath/ath9k/wmi.c:265
 ath9k_init_htc_services.constprop.0+0xb4/0x650 drivers/net/wireless/ath/ath9k/htc_drv_init.c:146
 ath9k_htc_probe_device+0x25a/0x1d80 drivers/net/wireless/ath/ath9k/htc_drv_init.c:959
 ath9k_htc_hw_init+0x31/0x60 drivers/net/wireless/ath/ath9k/htc_hst.c:501
 ath9k_hif_usb_firmware_cb+0x26b/0x500 drivers/net/wireless/ath/ath9k/hif_usb.c:1187
 request_firmware_work_func+0x126/0x242 drivers/base/firmware_loader/main.c:976
 process_one_work+0x94b/0x1620 kernel/workqueue.c:2266
 worker_thread+0x96/0xe20 kernel/workqueue.c:2412
 kthread+0x318/0x420 kernel/kthread.c:255
 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:352

Freed by task 21:
 save_stack+0x1b/0x80 mm/kasan/common.c:72
 set_track mm/kasan/common.c:80 [inline]
 kasan_set_free_info mm/kasan/common.c:337 [inline]
 __kasan_slab_free+0x117/0x160 mm/kasan/common.c:476
 slab_free_hook mm/slub.c:1444 [inline]
 slab_free_freelist_hook mm/slub.c:1477 [inline]
 slab_free mm/slub.c:3034 [inline]
 kmem_cache_free+0x9b/0x360 mm/slub.c:3050
 kfree_skbmem net/core/skbuff.c:622 [inline]
 kfree_skbmem+0xef/0x1b0 net/core/skbuff.c:616
 __kfree_skb net/core/skbuff.c:679 [inline]
 kfree_skb net/core/skbuff.c:696 [inline]
 kfree_skb+0x102/0x3d0 net/core/skbuff.c:690
 htc_connect_service.cold+0xa9/0x109 drivers/net/wireless/ath/ath9k/htc_hst.c:282
 ath9k_wmi_connect+0xd2/0x1a0 drivers/net/wireless/ath/ath9k/wmi.c:265
 ath9k_init_htc_services.constprop.0+0xb4/0x650 drivers/net/wireless/ath/ath9k/htc_drv_init.c:146
 ath9k_htc_probe_device+0x25a/0x1d80 drivers/net/wireless/ath/ath9k/htc_drv_init.c:959
 ath9k_htc_hw_init+0x31/0x60 drivers/net/wireless/ath/ath9k/htc_hst.c:501
 ath9k_hif_usb_firmware_cb+0x26b/0x500 drivers/net/wireless/ath/ath9k/hif_usb.c:1187
 request_firmware_work_func+0x126/0x242 drivers/base/firmware_loader/main.c:976
 process_one_work+0x94b/0x1620 kernel/workqueue.c:2266
 worker_thread+0x96/0xe20 kernel/workqueue.c:2412
 kthread+0x318/0x420 kernel/kthread.c:255
 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:352

The buggy address belongs to the object at ffff8881d15fd780
 which belongs to the cache skbuff_head_cache of size 224
The buggy address is located 212 bytes inside of
 224-byte region [ffff8881d15fd780, ffff8881d15fd860)
The buggy address belongs to the page:
page:ffffea0007457f40 refcount:1 mapcount:0 mapping:ffff8881da16b400 index:0x0
flags: 0x200000000000200(slab)
raw: 0200000000000200 0000000000000000 0000000300000001 ffff8881da16b400
raw: 0000000000000000 00000000800c000c 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8881d15fd700: fb fb fb fb fc fc fc fc fc fc fc fc fc fc fc fc
 ffff8881d15fd780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff8881d15fd800: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc
                                                 ^
 ffff8881d15fd880: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb
 ffff8881d15fd900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (1383):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci2-upstream-usb 2020/04/17 22:14 https://github.com/google/kasan.git usb-fuzzer 0fa84af850a4 435c6d53 .config log report syz C
ci2-upstream-usb 2020/06/08 21:30 https://github.com/google/kasan.git usb-fuzzer 2089c6ed5a17 7604bb03 .config log report syz
ci2-upstream-usb 2020/05/29 15:55 https://github.com/google/kasan.git usb-fuzzer d19c64b3d097 bed08304 .config log report syz
ci2-upstream-usb 2020/06/12 12:12 https://github.com/google/kasan.git usb-fuzzer 2089c6ed5a17 819b58b0 .config log report
ci2-upstream-usb 2020/06/12 11:19 https://github.com/google/kasan.git usb-fuzzer 2089c6ed5a17 819b58b0 .config log report
ci2-upstream-usb 2020/06/12 10:02 https://github.com/google/kasan.git usb-fuzzer 2089c6ed5a17 819b58b0 .config log report
ci2-upstream-usb 2020/06/12 08:13 https://github.com/google/kasan.git usb-fuzzer 2089c6ed5a17 819b58b0 .config log report
ci2-upstream-usb 2020/06/12 07:11 https://github.com/google/kasan.git usb-fuzzer 2089c6ed5a17 819b58b0 .config log report
ci2-upstream-usb 2020/06/12 06:03 https://github.com/google/kasan.git usb-fuzzer 2089c6ed5a17 819b58b0 .config log report
ci2-upstream-usb 2020/06/12 03:29 https://github.com/google/kasan.git usb-fuzzer 2089c6ed5a17 1beaee21 .config log report
ci2-upstream-usb 2020/06/12 02:08 https://github.com/google/kasan.git usb-fuzzer 2089c6ed5a17 1beaee21 .config log report
ci2-upstream-usb 2020/06/12 00:28 https://github.com/google/kasan.git usb-fuzzer 2089c6ed5a17 1beaee21 .config log report
ci2-upstream-usb 2020/06/11 23:19 https://github.com/google/kasan.git usb-fuzzer 2089c6ed5a17 1beaee21 .config log report
ci2-upstream-usb 2020/06/11 22:25 https://github.com/google/kasan.git usb-fuzzer 2089c6ed5a17 1beaee21 .config log report
ci2-upstream-usb 2020/06/11 21:03 https://github.com/google/kasan.git usb-fuzzer 2089c6ed5a17 1beaee21 .config log report
ci2-upstream-usb 2020/06/11 19:31 https://github.com/google/kasan.git usb-fuzzer 2089c6ed5a17 1beaee21 .config log report
ci2-upstream-usb 2020/06/11 16:56 https://github.com/google/kasan.git usb-fuzzer 2089c6ed5a17 1beaee21 .config log report
ci2-upstream-usb 2020/06/11 15:25 https://github.com/google/kasan.git usb-fuzzer 2089c6ed5a17 3ab7a05a .config log report
ci2-upstream-usb 2020/06/11 14:09 https://github.com/google/kasan.git usb-fuzzer 2089c6ed5a17 3ab7a05a .config log report
ci2-upstream-usb 2020/06/11 12:18 https://github.com/google/kasan.git usb-fuzzer 2089c6ed5a17 3ab7a05a .config log report
ci2-upstream-usb 2020/06/11 11:32 https://github.com/google/kasan.git usb-fuzzer 2089c6ed5a17 3ab7a05a .config log report
ci2-upstream-usb 2020/06/11 10:09 https://github.com/google/kasan.git usb-fuzzer 2089c6ed5a17 3ab7a05a .config log report
ci2-upstream-usb 2020/06/11 08:59 https://github.com/google/kasan.git usb-fuzzer 2089c6ed5a17 3ab7a05a .config log report
ci2-upstream-usb 2020/06/11 07:14 https://github.com/google/kasan.git usb-fuzzer 2089c6ed5a17 3ab7a05a .config log report
ci2-upstream-usb 2020/06/11 05:43 https://github.com/google/kasan.git usb-fuzzer 2089c6ed5a17 3ab7a05a .config log report
ci2-upstream-usb 2020/06/11 04:22 https://github.com/google/kasan.git usb-fuzzer 2089c6ed5a17 3ab7a05a .config log report
ci2-upstream-usb 2020/06/11 03:10 https://github.com/google/kasan.git usb-fuzzer 2089c6ed5a17 3ab7a05a .config log report
ci2-upstream-usb 2020/06/10 23:54 https://github.com/google/kasan.git usb-fuzzer 2089c6ed5a17 5caaad3a .config log report
ci2-upstream-usb 2020/06/10 21:58 https://github.com/google/kasan.git usb-fuzzer 2089c6ed5a17 5caaad3a .config log report
ci2-upstream-usb 2020/06/10 21:26 https://github.com/google/kasan.git usb-fuzzer 2089c6ed5a17 5caaad3a .config log report
ci2-upstream-usb 2020/06/10 19:39 https://github.com/google/kasan.git usb-fuzzer 2089c6ed5a17 5caaad3a .config log report
ci2-upstream-usb 2020/06/10 18:13 https://github.com/google/kasan.git usb-fuzzer 2089c6ed5a17 5caaad3a .config log report
ci2-upstream-usb 2020/06/10 17:05 https://github.com/google/kasan.git usb-fuzzer 2089c6ed5a17 5caaad3a .config log report
ci2-upstream-usb 2020/06/10 14:33 https://github.com/google/kasan.git usb-fuzzer 2089c6ed5a17 5caaad3a .config log report
ci2-upstream-usb 2020/06/10 10:31 https://github.com/google/kasan.git usb-fuzzer 2089c6ed5a17 860c4de9 .config log report
ci2-upstream-usb 2020/06/10 09:19 https://github.com/google/kasan.git usb-fuzzer 2089c6ed5a17 860c4de9 .config log report
ci2-upstream-usb 2020/06/10 07:46 https://github.com/google/kasan.git usb-fuzzer 2089c6ed5a17 860c4de9 .config log report
ci2-upstream-usb 2020/06/10 06:21 https://github.com/google/kasan.git usb-fuzzer 2089c6ed5a17 860c4de9 .config log report
ci2-upstream-usb 2020/06/10 05:11 https://github.com/google/kasan.git usb-fuzzer 2089c6ed5a17 860c4de9 .config log report
ci2-upstream-usb 2020/06/10 01:53 https://github.com/google/kasan.git usb-fuzzer 2089c6ed5a17 860c4de9 .config log report
ci2-upstream-usb 2020/06/09 23:56 https://github.com/google/kasan.git usb-fuzzer 2089c6ed5a17 092934c1 .config log report
ci2-upstream-usb 2020/06/09 20:25 https://github.com/google/kasan.git usb-fuzzer 2089c6ed5a17 092934c1 .config log report
ci2-upstream-usb 2020/06/09 18:17 https://github.com/google/kasan.git usb-fuzzer 2089c6ed5a17 092934c1 .config log report
ci2-upstream-usb 2020/06/09 17:04 https://github.com/google/kasan.git usb-fuzzer 2089c6ed5a17 092934c1 .config log report
ci2-upstream-usb 2020/03/26 10:10 https://github.com/google/kasan.git usb-fuzzer e17994d1e7b1 e8e6c7d2 .config log report
ci2-upstream-usb 2020/03/25 22:42 https://github.com/google/kasan.git usb-fuzzer e17994d1e7b1 e8e6c7d2 .config log report
* Struck through repros no longer work on HEAD.