================================================================== 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 ffff888028c96008 by task syz-executor.1/28114 CPU: 1 PID: 28114 Comm: syz-executor.1 Not tainted 6.5.0-syzkaller-08894-gb97d64c72259 #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:0xf7f7c579 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:00000000ffcf71e0 EFLAGS: 00000293 ORIG_RAX: 0000000000000006 RAX: ffffffffffffffda RBX: 0000000000000005 RCX: 000000005705b400 RDX: 0000000000000000 RSI: 00000000f7353ff4 RDI: 0000000000000000 RBP: 00000000f7200000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000293 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 Allocated by task 28108: 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 28107: 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:162 [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 __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:1401 __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 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:1401 __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 ffff888028c96000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 8 bytes inside of freed 2048-byte region [ffff888028c96000, ffff888028c96800) The buggy address belongs to the physical page: page:ffffea0000a32400 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888028c95000 pfn:0x28c90 head:ffffea0000a32400 order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0 anon flags: 0xfff00000000840(slab|head|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000000840 ffff888012842f00 0000000000000000 dead000000000001 raw: ffff888028c95000 0000000080080006 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 5180, tgid 5180 (syz-executor.3), ts 57237293885, free_ts 0 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+0x10a9/0x31e0 mm/page_alloc.c:3183 __alloc_pages+0x1d0/0x4a0 mm/page_alloc.c:4439 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/0x270 net/core/skbuff.c:575 pskb_expand_head+0x236/0x1170 net/core/skbuff.c:2087 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] rtmsg_ifinfo+0x16f/0x1a0 net/core/rtnetlink.c:4083 register_netdevice+0x10f8/0x1490 net/core/dev.c:10183 page_owner free stack trace missing Memory state around the buggy address: ffff888028c95f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888028c95f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888028c96000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888028c96080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888028c96100: 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