syzbot


KMSAN: use-after-free in __pm_runtime_resume

Status: fixed on 2019/11/27 06:10
Subsystems: usb
[Documentation on labels]
Fix commit: 5f9242775bb6 HID: logitech: Fix general protection fault caused by Logitech driver
First crash: 1660d, last: 1660d

Sample crash report:
=====================================================
BUG: KMSAN: use-after-free in pm_runtime_get_sync include/linux/pm_runtime.h:226 [inline]
BUG: KMSAN: use-after-free in usb_autopm_get_interface+0x5f/0x100 drivers/usb/core/driver.c:1707
CPU: 1 PID: 16327 Comm: syz-executor.3 Not tainted 5.3.0-rc7+ #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x191/0x1f0 lib/dump_stack.c:113
 kmsan_report+0x17d/0x2f0 mm/kmsan/kmsan_report.c:114
 __msan_warning+0x73/0xe0 mm/kmsan/kmsan_instr.c:250
 arch_atomic_inc arch/x86/include/asm/atomic.h:97 [inline]
 atomic_inc include/asm-generic/atomic-instrumented.h:240 [inline]
 __pm_runtime_resume+0x179/0x190 drivers/base/power/runtime.c:1073
 pm_runtime_get_sync include/linux/pm_runtime.h:226 [inline]
 usb_autopm_get_interface+0x5f/0x100 drivers/usb/core/driver.c:1707
 usbhid_power+0xb7/0x170 drivers/hid/usbhid/hid-core.c:1234
 hid_hw_power include/linux/hid.h:1038 [inline]
 hidraw_open+0x459/0xc10 drivers/hid/hidraw.c:282
 chrdev_open+0xc58/0xe00 fs/char_dev.c:414
 do_dentry_open+0xda7/0x1810 fs/open.c:797
 vfs_open+0xaf/0xe0 fs/open.c:906
 do_last fs/namei.c:3416 [inline]
 path_openat+0x17f4/0x6bb0 fs/namei.c:3533
 do_filp_open+0x2b8/0x710 fs/namei.c:3563
 do_sys_open+0x642/0xa30 fs/open.c:1089
 __do_sys_open fs/open.c:1107 [inline]
 __se_sys_open+0xad/0xc0 fs/open.c:1102
 __x64_sys_open+0x4a/0x70 fs/open.c:1102
 do_syscall_64+0xbc/0xf0 arch/x86/entry/common.c:297
 entry_SYSCALL_64_after_hwframe+0x63/0xe7
RIP: 0033:0x413941
Code: 75 14 b8 02 00 00 00 0f 05 48 3d 01 f0 ff ff 0f 83 04 19 00 00 c3 48 83 ec 08 e8 0a fa ff ff 48 89 04 24 b8 02 00 00 00 0f 05 <48> 8b 3c 24 48 89 c2 e8 53 fa ff ff 48 89 d0 48 83 c4 08 48 3d 01
RSP: 002b:00007fa6bb43c7a0 EFLAGS: 00000293 ORIG_RAX: 0000000000000002
RAX: ffffffffffffffda RBX: 6666666666666667 RCX: 0000000000413941
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 00007fa6bb43c850
RBP: 000000000075bf20 R08: 000000000000000f R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000293 R12: 00007fa6bb43d6d4
R13: 00000000004c90ab R14: 00000000004e0590 R15: 00000000ffffffff

Uninit was created at:
 kmsan_save_stack_with_flags mm/kmsan/kmsan.c:154 [inline]
 kmsan_internal_poison_shadow+0x60/0x120 mm/kmsan/kmsan.c:137
 kmsan_slab_free+0x8d/0x100 mm/kmsan/kmsan_hooks.c:123
 slab_free_freelist_hook mm/slub.c:1472 [inline]
 slab_free mm/slub.c:3038 [inline]
 kmem_cache_free+0x2d1/0x2b70 mm/slub.c:3054
 ccid_hc_tx_delete+0x14c/0x1c0 net/dccp/ccid.c:187
 dccp_sk_destruct+0x6b/0xd0 net/dccp/proto.c:178
 __sk_destruct+0x8c/0x890 net/core/sock.c:1695
 sk_destruct net/core/sock.c:1734 [inline]
 __sk_free+0x5af/0x640 net/core/sock.c:1745
 sk_free net/core/sock.c:1756 [inline]
 sock_put include/net/sock.h:1725 [inline]
 __sk_receive_skb+0x655/0xd30 net/core/sock.c:534
 dccp_v6_rcv+0x1dcb/0x2170 net/dccp/ipv6.c:774
 ip6_protocol_deliver_rcu+0x186e/0x22f0 net/ipv6/ip6_input.c:397
 ip6_input_finish net/ipv6/ip6_input.c:438 [inline]
 NF_HOOK include/linux/netfilter.h:305 [inline]
 ip6_input+0x2af/0x340 net/ipv6/ip6_input.c:447
 dst_input include/net/dst.h:442 [inline]
 ip6_rcv_finish net/ipv6/ip6_input.c:76 [inline]
 NF_HOOK include/linux/netfilter.h:305 [inline]
 ipv6_rcv+0x683/0x710 net/ipv6/ip6_input.c:272
 __netif_receive_skb_one_core net/core/dev.c:5004 [inline]
 __netif_receive_skb net/core/dev.c:5118 [inline]
 process_backlog+0x721/0x1410 net/core/dev.c:5929
 napi_poll net/core/dev.c:6352 [inline]
 net_rx_action+0x74b/0x1950 net/core/dev.c:6418
 __do_softirq+0x4a1/0x83a kernel/softirq.c:293
 do_softirq_own_stack+0x49/0x80 arch/x86/entry/entry_64.S:1093
 do_softirq kernel/softirq.c:338 [inline]
 __local_bh_enable_ip+0x184/0x1d0 kernel/softirq.c:190
 local_bh_enable+0x36/0x40 include/linux/bottom_half.h:32
 rcu_read_unlock_bh include/linux/rcupdate.h:681 [inline]
 ip6_finish_output2+0x213f/0x2670 net/ipv6/ip6_output.c:117
 __ip6_finish_output+0x83d/0x8f0 net/ipv6/ip6_output.c:142
 ip6_finish_output+0x2db/0x420 net/ipv6/ip6_output.c:152
 NF_HOOK_COND include/linux/netfilter.h:294 [inline]
 ip6_output+0x5d3/0x720 net/ipv6/ip6_output.c:175
 dst_output include/net/dst.h:436 [inline]
 NF_HOOK include/linux/netfilter.h:305 [inline]
 ip6_xmit+0x1f53/0x2650 net/ipv6/ip6_output.c:279
 inet6_csk_xmit+0x3df/0x4f0 net/ipv6/inet6_connection_sock.c:135
 dccp_transmit_skb+0x135f/0x1620 net/dccp/output.c:138
 dccp_send_reset+0x380/0x4d0 net/dccp/output.c:526
 dccp_close+0x696/0x14c0 net/dccp/proto.c:1035
 inet_release+0x1f7/0x270 net/ipv4/af_inet.c:427
 inet6_release+0xaf/0x100 net/ipv6/af_inet6.c:470
 __sock_release net/socket.c:590 [inline]
 sock_close+0x156/0x460 net/socket.c:1268
 __fput+0x4c9/0xba0 fs/file_table.c:280
 ____fput+0x37/0x40 fs/file_table.c:313
 task_work_run+0x22e/0x2a0 kernel/task_work.c:113
 tracehook_notify_resume include/linux/tracehook.h:188 [inline]
 exit_to_usermode_loop arch/x86/entry/common.c:163 [inline]
 prepare_exit_to_usermode+0x39d/0x4d0 arch/x86/entry/common.c:194
 syscall_return_slowpath+0x90/0x610 arch/x86/entry/common.c:274
 do_syscall_64+0xe2/0xf0 arch/x86/entry/common.c:300
 entry_SYSCALL_64_after_hwframe+0x63/0xe7
=====================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2019/10/08 10:25 https://github.com/google/kmsan.git master cebb918b7474 28ac6e64 .config console log report ci-upstream-kmsan-gce
* Struck through repros no longer work on HEAD.