================================================================== BUG: KASAN: slab-use-after-free in __list_del_entry_valid+0x174/0x1b0 lib/list_debug.c:62 Read of size 8 at addr ffff88802c252008 by task syz-executor.3/18085 CPU: 1 PID: 18085 Comm: syz-executor.3 Not tainted 6.4.0-syzkaller-01647-g6e2332e0ab53 #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.14.0-2 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x150 lib/dump_stack.c:106 print_address_description.constprop.0+0x2c/0x3c0 mm/kasan/report.c:351 print_report mm/kasan/report.c:462 [inline] kasan_report+0x11c/0x130 mm/kasan/report.c:572 __list_del_entry_valid+0x174/0x1b0 lib/list_debug.c:62 __list_del_entry include/linux/list.h:134 [inline] list_del include/linux/list.h:148 [inline] local_release net/nfc/llcp_core.c:172 [inline] kref_put include/linux/kref.h:65 [inline] nfc_llcp_local_put net/nfc/llcp_core.c:182 [inline] nfc_llcp_local_put net/nfc/llcp_core.c:177 [inline] nfc_llcp_unregister_device+0xb8/0x260 net/nfc/llcp_core.c:1620 nfc_unregister_device+0x196/0x330 net/nfc/core.c:1179 virtual_ncidev_close+0x52/0xb0 drivers/nfc/virtual_ncidev.c:163 __fput+0x40c/0xad0 fs/file_table.c:378 task_work_run+0x16f/0x270 kernel/task_work.c:179 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] exit_to_user_mode_loop kernel/entry/common.c:171 [inline] exit_to_user_mode_prepare+0x210/0x240 kernel/entry/common.c:204 __syscall_exit_to_user_mode_work kernel/entry/common.c:286 [inline] syscall_exit_to_user_mode+0x1d/0x50 kernel/entry/common.c:297 __do_fast_syscall_32+0x72/0xf0 arch/x86/entry/common.c:181 do_fast_syscall_32+0x33/0x70 arch/x86/entry/common.c:203 entry_SYSENTER_compat_after_hwframe+0x70/0x82 RIP: 0023:0xf7fce579 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:00000000ffc55ef0 EFLAGS: 00000282 ORIG_RAX: 0000000000000006 RAX: 0000000000000000 RBX: 000000000000000d RCX: 0000000000000002 RDX: 0000000000000000 RSI: 00000000f734e000 RDI: 0000000000000000 RBP: 00000000f6e06030 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000282 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 Allocated by task 18074: kasan_save_stack+0x22/0x40 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 mm/kasan/common.c:333 [inline] __kasan_kmalloc+0xa2/0xb0 mm/kasan/common.c:383 kmalloc include/linux/slab.h:559 [inline] kzalloc include/linux/slab.h:680 [inline] nfc_llcp_register_device+0x49/0x9e0 net/nfc/llcp_core.c:1567 nfc_register_device+0x70/0x3c0 net/nfc/core.c:1124 nci_register_device+0x7cb/0xb50 net/nfc/nci/core.c:1257 virtual_ncidev_open+0x14f/0x230 drivers/nfc/virtual_ncidev.c:148 misc_open+0x383/0x4a0 drivers/char/misc.c:165 chrdev_open+0x273/0x780 fs/char_dev.c:414 do_dentry_open+0x6ce/0x1430 fs/open.c:914 do_open fs/namei.c:3636 [inline] path_openat+0x1b65/0x2710 fs/namei.c:3793 do_filp_open+0x1ba/0x410 fs/namei.c:3820 do_sys_openat2+0x16d/0x510 fs/open.c:1402 do_sys_open fs/open.c:1418 [inline] __do_compat_sys_openat fs/open.c:1478 [inline] __se_compat_sys_openat fs/open.c:1476 [inline] __ia32_compat_sys_openat+0x143/0x1f0 fs/open.c:1476 do_syscall_32_irqs_on arch/x86/entry/common.c:112 [inline] __do_fast_syscall_32+0x65/0xf0 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 18068: kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 kasan_save_free_info+0x2e/0x40 mm/kasan/generic.c:521 ____kasan_slab_free mm/kasan/common.c:236 [inline] ____kasan_slab_free+0x160/0x1c0 mm/kasan/common.c:200 kasan_slab_free include/linux/kasan.h:162 [inline] slab_free_hook mm/slub.c:1802 [inline] slab_free_freelist_hook+0x8b/0x1c0 mm/slub.c:1828 slab_free mm/slub.c:3811 [inline] __kmem_cache_free+0xb8/0x2d0 mm/slub.c:3824 local_release net/nfc/llcp_core.c:174 [inline] kref_put include/linux/kref.h:65 [inline] nfc_llcp_local_put net/nfc/llcp_core.c:182 [inline] nfc_llcp_local_put net/nfc/llcp_core.c:177 [inline] nfc_llcp_unregister_device+0x1ba/0x260 net/nfc/llcp_core.c:1620 nfc_unregister_device+0x196/0x330 net/nfc/core.c:1179 virtual_ncidev_close+0x52/0xb0 drivers/nfc/virtual_ncidev.c:163 __fput+0x40c/0xad0 fs/file_table.c:378 task_work_run+0x16f/0x270 kernel/task_work.c:179 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] exit_to_user_mode_loop kernel/entry/common.c:171 [inline] exit_to_user_mode_prepare+0x210/0x240 kernel/entry/common.c:204 __syscall_exit_to_user_mode_work kernel/entry/common.c:286 [inline] syscall_exit_to_user_mode+0x1d/0x50 kernel/entry/common.c:297 __do_fast_syscall_32+0x72/0xf0 arch/x86/entry/common.c:181 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+0x22/0x40 mm/kasan/common.c:45 __kasan_record_aux_stack+0xbc/0xd0 mm/kasan/generic.c:491 __call_rcu_common.constprop.0+0x99/0x7e0 kernel/rcu/tree.c:2649 netlink_release+0xcde/0x1e40 net/netlink/af_netlink.c:828 __sock_release+0xcd/0x290 net/socket.c:654 sock_close+0x1c/0x20 net/socket.c:1398 __fput+0x40c/0xad0 fs/file_table.c:378 task_work_run+0x16f/0x270 kernel/task_work.c:179 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] exit_to_user_mode_loop kernel/entry/common.c:171 [inline] exit_to_user_mode_prepare+0x210/0x240 kernel/entry/common.c:204 __syscall_exit_to_user_mode_work kernel/entry/common.c:286 [inline] syscall_exit_to_user_mode+0x1d/0x50 kernel/entry/common.c:297 __do_fast_syscall_32+0x72/0xf0 arch/x86/entry/common.c:181 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+0x22/0x40 mm/kasan/common.c:45 __kasan_record_aux_stack+0xbc/0xd0 mm/kasan/generic.c:491 __call_rcu_common.constprop.0+0x99/0x7e0 kernel/rcu/tree.c:2649 netlink_release+0xcde/0x1e40 net/netlink/af_netlink.c:828 __sock_release+0xcd/0x290 net/socket.c:654 sock_close+0x1c/0x20 net/socket.c:1398 __fput+0x40c/0xad0 fs/file_table.c:378 task_work_run+0x16f/0x270 kernel/task_work.c:179 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] exit_to_user_mode_loop kernel/entry/common.c:171 [inline] exit_to_user_mode_prepare+0x210/0x240 kernel/entry/common.c:204 __syscall_exit_to_user_mode_work kernel/entry/common.c:286 [inline] syscall_exit_to_user_mode+0x1d/0x50 kernel/entry/common.c:297 __do_fast_syscall_32+0x72/0xf0 arch/x86/entry/common.c:181 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 ffff88802c252000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 8 bytes inside of freed 2048-byte region [ffff88802c252000, ffff88802c252800) The buggy address belongs to the physical page: page:ffffea0000b09400 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x2c250 head:ffffea0000b09400 order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000010200 ffff888012442f00 ffffea0000a5ee00 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 0x1d2820(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 25801, tgid 25801 (syz-executor.3), ts 239680801602, free_ts 209988372481 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x2db/0x350 mm/page_alloc.c:1744 prep_new_page mm/page_alloc.c:1751 [inline] get_page_from_freelist+0xf41/0x2c00 mm/page_alloc.c:3523 __alloc_pages+0x1cb/0x4a0 mm/page_alloc.c:4794 alloc_pages+0x1aa/0x270 mm/mempolicy.c:2279 alloc_slab_page mm/slub.c:1872 [inline] allocate_slab+0x25f/0x390 mm/slub.c:2019 new_slab mm/slub.c:2072 [inline] ___slab_alloc+0xbb9/0x1560 mm/slub.c:3225 __slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3324 __slab_alloc_node mm/slub.c:3377 [inline] slab_alloc_node mm/slub.c:3470 [inline] __kmem_cache_alloc_node+0x143/0x350 mm/slub.c:3519 __do_kmalloc_node mm/slab_common.c:965 [inline] __kmalloc_node_track_caller+0x4f/0x1a0 mm/slab_common.c:986 kmalloc_reserve+0xf0/0x270 net/core/skbuff.c:585 __alloc_skb+0x129/0x330 net/core/skbuff.c:654 alloc_skb include/linux/skbuff.h:1288 [inline] nlmsg_new include/net/netlink.h:1003 [inline] inet6_ifinfo_notify+0x76/0x150 net/ipv6/addrconf.c:6053 addrconf_notify+0x4a6/0x19f0 net/ipv6/addrconf.c:3662 notifier_call_chain+0xb6/0x3c0 kernel/notifier.c:93 call_netdevice_notifiers_info+0xb9/0x130 net/core/dev.c:1935 call_netdevice_notifiers_extack net/core/dev.c:1973 [inline] call_netdevice_notifiers net/core/dev.c:1987 [inline] __dev_notify_flags+0x120/0x2d0 net/core/dev.c:8607 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1308 [inline] free_unref_page_prepare+0x62e/0xcb0 mm/page_alloc.c:2577 free_unref_page_list+0xe3/0xa70 mm/page_alloc.c:2718 shrink_folio_list+0x283d/0x3dc0 mm/vmscan.c:2181 evict_folios+0x794/0x1940 mm/vmscan.c:5143 try_to_shrink_lruvec+0x82c/0xb90 mm/vmscan.c:5319 shrink_one+0x462/0x710 mm/vmscan.c:5363 shrink_many mm/vmscan.c:5415 [inline] lru_gen_shrink_node mm/vmscan.c:5532 [inline] shrink_node+0x1fd5/0x3500 mm/vmscan.c:6473 kswapd_shrink_node mm/vmscan.c:7273 [inline] balance_pgdat+0xa02/0x1ac0 mm/vmscan.c:7463 kswapd+0x677/0xd60 mm/vmscan.c:7723 kthread+0x344/0x440 kernel/kthread.c:389 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 Memory state around the buggy address: ffff88802c251f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88802c251f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88802c252000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88802c252080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88802c252100: 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 retq 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