================================================================== BUG: KASAN: slab-use-after-free in __list_del_entry_valid_or_report+0x174/0x1b0 lib/list_debug.c:65 Read of size 8 at addr ffff888022fdf008 by task syz-executor.3/18831 CPU: 3 PID: 18831 Comm: syz-executor.3 Not tainted 6.6.0-rc1-syzkaller-00072-gaed8aee11130 #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:364 [inline] print_report+0xc4/0x620 mm/kasan/report.c:475 kasan_report+0xda/0x110 mm/kasan/report.c:588 __list_del_entry_valid_or_report+0x174/0x1b0 lib/list_debug.c:65 __list_del_entry_valid include/linux/list.h:124 [inline] __list_del_entry include/linux/list.h:215 [inline] list_del include/linux/list.h:229 [inline] nfc_llcp_remove_local net/nfc/llcp_core.c:306 [inline] nfc_llcp_unregister_device+0xc3/0x2c0 net/nfc/llcp_core.c:1646 nfc_unregister_device+0x194/0x330 net/nfc/core.c:1179 virtual_ncidev_close+0x51/0xa0 drivers/nfc/virtual_ncidev.c:163 __fput+0x3f7/0xa70 fs/file_table.c:384 __fput_sync+0x47/0x50 fs/file_table.c:465 __do_sys_close fs/open.c:1572 [inline] __se_sys_close fs/open.c:1557 [inline] __ia32_sys_close+0x87/0xf0 fs/open.c:1557 do_syscall_32_irqs_on arch/x86/entry/common.c:112 [inline] __do_fast_syscall_32+0x61/0xe0 arch/x86/entry/common.c:178 do_fast_syscall_32+0x33/0x70 arch/x86/entry/common.c:203 entry_SYSENTER_compat_after_hwframe+0x70/0x82 RIP: 0023:0xf7f92579 Code: b8 01 10 06 03 74 b4 01 10 07 03 74 b0 01 10 08 03 74 d8 01 00 00 00 00 00 00 00 00 00 00 00 00 00 51 52 55 89 e5 0f 34 cd 80 <5d> 5a 59 c3 90 90 90 90 8d b4 26 00 00 00 00 8d b4 26 00 00 00 00 RSP: 002b:00000000ff9ac2e0 EFLAGS: 00000293 ORIG_RAX: 0000000000000006 RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00000000572c2400 RDX: 0000000000000000 RSI: 00000000f7353ff4 RDI: 0000000000000000 RBP: 00000000f7200000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000202 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 Allocated by task 18825: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:374 [inline] __kasan_kmalloc+0xa2/0xb0 mm/kasan/common.c:383 kmalloc include/linux/slab.h:599 [inline] kzalloc include/linux/slab.h:720 [inline] nfc_llcp_register_device+0x47/0x9d0 net/nfc/llcp_core.c:1602 nfc_register_device+0x6d/0x3c0 net/nfc/core.c:1124 nci_register_device+0x7f4/0xb80 net/nfc/nci/core.c:1257 virtual_ncidev_open+0x147/0x220 drivers/nfc/virtual_ncidev.c:148 misc_open+0x3da/0x4c0 drivers/char/misc.c:165 chrdev_open+0x277/0x700 fs/char_dev.c:414 do_dentry_open+0x88b/0x1730 fs/open.c:929 do_open fs/namei.c:3639 [inline] path_openat+0x19af/0x29c0 fs/namei.c:3796 do_filp_open+0x1de/0x430 fs/namei.c:3823 do_sys_openat2+0x176/0x1e0 fs/open.c:1422 do_sys_open fs/open.c:1437 [inline] __do_compat_sys_openat fs/open.c:1497 [inline] __se_compat_sys_openat fs/open.c:1495 [inline] __ia32_compat_sys_openat+0x16e/0x200 fs/open.c:1495 do_syscall_32_irqs_on arch/x86/entry/common.c:112 [inline] __do_fast_syscall_32+0x61/0xe0 arch/x86/entry/common.c:178 do_fast_syscall_32+0x33/0x70 arch/x86/entry/common.c:203 entry_SYSENTER_compat_after_hwframe+0x70/0x82 Freed by task 18824: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 kasan_save_free_info+0x2b/0x40 mm/kasan/generic.c:522 ____kasan_slab_free mm/kasan/common.c:236 [inline] ____kasan_slab_free+0x15b/0x1b0 mm/kasan/common.c:200 kasan_slab_free include/linux/kasan.h:164 [inline] slab_free_hook mm/slub.c:1800 [inline] slab_free_freelist_hook+0x114/0x1e0 mm/slub.c:1826 slab_free mm/slub.c:3809 [inline] __kmem_cache_free+0xb8/0x2f0 mm/slub.c:3822 local_release net/nfc/llcp_core.c:175 [inline] kref_put include/linux/kref.h:65 [inline] nfc_llcp_local_put.part.0+0x88/0xb0 net/nfc/llcp_core.c:183 nfc_llcp_local_put net/nfc/llcp_core.c:180 [inline] nfc_llcp_unregister_device+0x1db/0x2c0 net/nfc/llcp_core.c:1655 nfc_unregister_device+0x194/0x330 net/nfc/core.c:1179 virtual_ncidev_close+0x51/0xa0 drivers/nfc/virtual_ncidev.c:163 __fput+0x3f7/0xa70 fs/file_table.c:384 __fput_sync+0x47/0x50 fs/file_table.c:465 __do_sys_close fs/open.c:1572 [inline] __se_sys_close fs/open.c:1557 [inline] __ia32_sys_close+0x87/0xf0 fs/open.c:1557 do_syscall_32_irqs_on arch/x86/entry/common.c:112 [inline] __do_fast_syscall_32+0x61/0xe0 arch/x86/entry/common.c:178 do_fast_syscall_32+0x33/0x70 arch/x86/entry/common.c:203 entry_SYSENTER_compat_after_hwframe+0x70/0x82 Last potentially related work creation: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 __kasan_record_aux_stack+0xbc/0xd0 mm/kasan/generic.c:492 insert_work+0x38/0x230 kernel/workqueue.c:1647 __queue_work+0x5d2/0x1060 kernel/workqueue.c:1799 queue_work_on+0xed/0x110 kernel/workqueue.c:1834 queue_work include/linux/workqueue.h:554 [inline] schedule_work include/linux/workqueue.h:615 [inline] rfkill_register+0x67f/0xb00 net/rfkill/core.c:1090 nfc_register_device+0x11f/0x3c0 net/nfc/core.c:1132 nci_register_device+0x7f4/0xb80 net/nfc/nci/core.c:1257 virtual_ncidev_open+0x147/0x220 drivers/nfc/virtual_ncidev.c:148 misc_open+0x3da/0x4c0 drivers/char/misc.c:165 chrdev_open+0x277/0x700 fs/char_dev.c:414 do_dentry_open+0x88b/0x1730 fs/open.c:929 do_open fs/namei.c:3639 [inline] path_openat+0x19af/0x29c0 fs/namei.c:3796 do_filp_open+0x1de/0x430 fs/namei.c:3823 do_sys_openat2+0x176/0x1e0 fs/open.c:1422 do_sys_open fs/open.c:1437 [inline] __do_compat_sys_openat fs/open.c:1497 [inline] __se_compat_sys_openat fs/open.c:1495 [inline] __ia32_compat_sys_openat+0x16e/0x200 fs/open.c:1495 do_syscall_32_irqs_on arch/x86/entry/common.c:112 [inline] __do_fast_syscall_32+0x61/0xe0 arch/x86/entry/common.c:178 do_fast_syscall_32+0x33/0x70 arch/x86/entry/common.c:203 entry_SYSENTER_compat_after_hwframe+0x70/0x82 Second to last potentially related work creation: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 __kasan_record_aux_stack+0xbc/0xd0 mm/kasan/generic.c:492 __call_rcu_common.constprop.0+0x9a/0x790 kernel/rcu/tree.c:2653 netlink_release+0xec0/0x20b0 net/netlink/af_netlink.c:831 __sock_release+0xae/0x260 net/socket.c:659 sock_close+0x1c/0x20 net/socket.c:1402 __fput+0x3f7/0xa70 fs/file_table.c:384 __fput_sync+0x47/0x50 fs/file_table.c:465 __do_sys_close fs/open.c:1572 [inline] __se_sys_close fs/open.c:1557 [inline] __ia32_sys_close+0x87/0xf0 fs/open.c:1557 do_syscall_32_irqs_on arch/x86/entry/common.c:112 [inline] __do_fast_syscall_32+0x61/0xe0 arch/x86/entry/common.c:178 do_fast_syscall_32+0x33/0x70 arch/x86/entry/common.c:203 entry_SYSENTER_compat_after_hwframe+0x70/0x82 The buggy address belongs to the object at ffff888022fdf000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 8 bytes inside of freed 2048-byte region [ffff888022fdf000, ffff888022fdf800) The buggy address belongs to the physical page: page:ffffea00008bf600 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x22fd8 head:ffffea00008bf600 order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000000840(slab|head|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000000840 ffff888012c42f00 ffffea0000667400 dead000000000002 raw: 0000000000000000 0000000000080008 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd28c0(GFP_NOWAIT|__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5169, tgid 5169 (syz-executor.2), ts 56417815022, free_ts 56340339532 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x2cf/0x340 mm/page_alloc.c:1536 prep_new_page mm/page_alloc.c:1543 [inline] get_page_from_freelist+0xee0/0x2f20 mm/page_alloc.c:3170 __alloc_pages+0x1d0/0x4a0 mm/page_alloc.c:4426 alloc_pages+0x1a9/0x270 mm/mempolicy.c:2298 alloc_slab_page mm/slub.c:1870 [inline] allocate_slab+0x251/0x380 mm/slub.c:2017 new_slab mm/slub.c:2070 [inline] ___slab_alloc+0x8be/0x1570 mm/slub.c:3223 __slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3322 __slab_alloc_node mm/slub.c:3375 [inline] slab_alloc_node mm/slub.c:3468 [inline] __kmem_cache_alloc_node+0x137/0x350 mm/slub.c:3517 __do_kmalloc_node mm/slab_common.c:1022 [inline] __kmalloc_node_track_caller+0x50/0x100 mm/slab_common.c:1043 kmalloc_reserve+0xef/0x260 net/core/skbuff.c:581 pskb_expand_head+0x236/0x1170 net/core/skbuff.c:2093 netlink_trim+0x1eb/0x240 net/netlink/af_netlink.c:1324 netlink_broadcast_filtered+0xc5/0xf00 net/netlink/af_netlink.c:1531 netlink_broadcast net/netlink/af_netlink.c:1576 [inline] nlmsg_multicast include/net/netlink.h:1079 [inline] nlmsg_notify+0x9e/0x220 net/netlink/af_netlink.c:2588 rtnl_notify net/core/rtnetlink.c:771 [inline] rtmsg_ifinfo_send net/core/rtnetlink.c:4061 [inline] rtmsg_ifinfo_event net/core/rtnetlink.c:4077 [inline] rtmsg_ifinfo_event net/core/rtnetlink.c:4064 [inline] rtnetlink_event+0x16e/0x1f0 net/core/rtnetlink.c:6495 notifier_call_chain+0xb6/0x3b0 kernel/notifier.c:93 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1136 [inline] free_unref_page_prepare+0x476/0xa40 mm/page_alloc.c:2312 free_unref_page+0x33/0x3b0 mm/page_alloc.c:2405 qlink_free mm/kasan/quarantine.c:166 [inline] qlist_free_all+0x6a/0x170 mm/kasan/quarantine.c:185 kasan_quarantine_reduce+0x18b/0x1d0 mm/kasan/quarantine.c:292 __kasan_slab_alloc+0x65/0x90 mm/kasan/common.c:305 kasan_slab_alloc include/linux/kasan.h:188 [inline] slab_post_alloc_hook mm/slab.h:762 [inline] slab_alloc_node mm/slub.c:3478 [inline] __kmem_cache_alloc_node+0x19b/0x350 mm/slub.c:3517 kmalloc_trace+0x25/0xe0 mm/slab_common.c:1114 kmalloc include/linux/slab.h:599 [inline] kzalloc include/linux/slab.h:720 [inline] ref_tracker_alloc+0x17c/0x5a0 lib/ref_tracker.c:203 __netdev_tracker_alloc include/linux/netdevice.h:4056 [inline] netdev_hold include/linux/netdevice.h:4085 [inline] netdev_hold include/linux/netdevice.h:4080 [inline] netdev_queue_add_kobject net/core/net-sysfs.c:1692 [inline] netdev_queue_update_kobjects+0x1b9/0x520 net/core/net-sysfs.c:1747 register_queue_kobjects net/core/net-sysfs.c:1808 [inline] netdev_register_kobject+0x297/0x3f0 net/core/net-sysfs.c:2048 register_netdevice+0xbcb/0x1490 net/core/dev.c:10136 veth_newlink+0x4f6/0xa10 drivers/net/veth.c:1937 rtnl_newlink_create net/core/rtnetlink.c:3485 [inline] __rtnl_newlink+0x1177/0x1940 net/core/rtnetlink.c:3705 rtnl_newlink+0x67/0xa0 net/core/rtnetlink.c:3718 rtnetlink_rcv_msg+0x439/0xd30 net/core/rtnetlink.c:6444 netlink_rcv_skb+0x16b/0x440 net/netlink/af_netlink.c:2545 Memory state around the buggy address: ffff888022fdef00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888022fdef80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888022fdf000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888022fdf080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888022fdf100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ---------------- Code disassembly (best guess), 2 bytes skipped: 0: 10 06 adc %al,(%rsi) 2: 03 74 b4 01 add 0x1(%rsp,%rsi,4),%esi 6: 10 07 adc %al,(%rdi) 8: 03 74 b0 01 add 0x1(%rax,%rsi,4),%esi c: 10 08 adc %cl,(%rax) e: 03 74 d8 01 add 0x1(%rax,%rbx,8),%esi 1e: 00 51 52 add %dl,0x52(%rcx) 21: 55 push %rbp 22: 89 e5 mov %esp,%ebp 24: 0f 34 sysenter 26: cd 80 int $0x80 * 28: 5d pop %rbp <-- trapping instruction 29: 5a pop %rdx 2a: 59 pop %rcx 2b: c3 ret 2c: 90 nop 2d: 90 nop 2e: 90 nop 2f: 90 nop 30: 8d b4 26 00 00 00 00 lea 0x0(%rsi,%riz,1),%esi 37: 8d b4 26 00 00 00 00 lea 0x0(%rsi,%riz,1),%esi