================================================================== BUG: KASAN: slab-use-after-free in __list_del_entry_valid+0x174/0x1b0 lib/list_debug.c:62 Read of size 8 at addr ffff88802612c008 by task syz-executor.0/28707 CPU: 2 PID: 28707 Comm: syz-executor.0 Not tainted 6.5.0-rc4-syzkaller-00205-gc8273a25864e #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+0x174/0x1b0 lib/list_debug.c:62 __list_del_entry include/linux/list.h:134 [inline] list_del include/linux/list.h:148 [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+0x3fd/0xac0 fs/file_table.c:384 task_work_run+0x14d/0x240 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+0x6d/0xe0 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:0xf7fec579 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:00000000fffd33f0 EFLAGS: 00000293 ORIG_RAX: 0000000000000006 RAX: 0000000000000000 RBX: 0000000000000003 RCX: 0000000056ba2400 RDX: 0000000000000000 RSI: 00000000f7353ff4 RDI: 0000000000025645 RBP: 00000000f737c0c0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000293 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 Allocated by task 28702: 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:582 [inline] kzalloc include/linux/slab.h:703 [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/0x1780 fs/open.c:914 do_open fs/namei.c:3636 [inline] path_openat+0x19af/0x29c0 fs/namei.c:3793 do_filp_open+0x1de/0x430 fs/namei.c:3820 do_sys_openat2+0x176/0x1e0 fs/open.c:1407 do_sys_open fs/open.c:1422 [inline] __do_compat_sys_openat fs/open.c:1482 [inline] __se_compat_sys_openat fs/open.c:1480 [inline] __ia32_compat_sys_openat+0x16e/0x200 fs/open.c:1480 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 28700: 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+0x15e/0x1b0 mm/kasan/common.c:200 kasan_slab_free include/linux/kasan.h:162 [inline] slab_free_hook mm/slub.c:1792 [inline] slab_free_freelist_hook+0x10b/0x1e0 mm/slub.c:1818 slab_free mm/slub.c:3801 [inline] __kmem_cache_free+0xb8/0x2f0 mm/slub.c:3814 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+0x3fd/0xac0 fs/file_table.c:384 task_work_run+0x14d/0x240 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+0x6d/0xe0 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+0x33/0x50 mm/kasan/common.c:45 __kasan_record_aux_stack+0xbc/0xd0 mm/kasan/generic.c:492 insert_work+0x4a/0x330 kernel/workqueue.c:1553 __queue_work+0x5f5/0x1040 kernel/workqueue.c:1714 queue_work_on+0xed/0x110 kernel/workqueue.c:1744 queue_work include/linux/workqueue.h:506 [inline] schedule_work include/linux/workqueue.h:567 [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/0x1780 fs/open.c:914 do_open fs/namei.c:3636 [inline] path_openat+0x19af/0x29c0 fs/namei.c:3793 do_filp_open+0x1de/0x430 fs/namei.c:3820 do_sys_openat2+0x176/0x1e0 fs/open.c:1407 do_sys_open fs/open.c:1422 [inline] __do_compat_sys_openat fs/open.c:1482 [inline] __se_compat_sys_openat fs/open.c:1480 [inline] __ia32_compat_sys_openat+0x16e/0x200 fs/open.c:1480 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 insert_work+0x4a/0x330 kernel/workqueue.c:1553 __queue_work+0x5f5/0x1040 kernel/workqueue.c:1714 queue_work_on+0xed/0x110 kernel/workqueue.c:1744 queue_work include/linux/workqueue.h:506 [inline] schedule_work include/linux/workqueue.h:567 [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/0x1780 fs/open.c:914 do_open fs/namei.c:3636 [inline] path_openat+0x19af/0x29c0 fs/namei.c:3793 do_filp_open+0x1de/0x430 fs/namei.c:3820 do_sys_openat2+0x176/0x1e0 fs/open.c:1407 do_sys_open fs/open.c:1422 [inline] __do_compat_sys_openat fs/open.c:1482 [inline] __se_compat_sys_openat fs/open.c:1480 [inline] __ia32_compat_sys_openat+0x16e/0x200 fs/open.c:1480 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 ffff88802612c000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 8 bytes inside of freed 2048-byte region [ffff88802612c000, ffff88802612c800) The buggy address belongs to the physical page: page:ffffea0000984a00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x26128 head:ffffea0000984a00 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 ffff888012842f00 dead000000000100 dead000000000122 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 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 973, tgid 973 (kworker/3:2), ts 26811507085, free_ts 25852292941 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x2d2/0x350 mm/page_alloc.c:1570 prep_new_page mm/page_alloc.c:1577 [inline] get_page_from_freelist+0x10a9/0x31e0 mm/page_alloc.c:3221 __alloc_pages+0x1d0/0x4a0 mm/page_alloc.c:4477 alloc_pages+0x1a9/0x270 mm/mempolicy.c:2292 alloc_slab_page mm/slub.c:1862 [inline] allocate_slab+0x24e/0x380 mm/slub.c:2009 new_slab mm/slub.c:2062 [inline] ___slab_alloc+0x8bc/0x1570 mm/slub.c:3215 __slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3314 __slab_alloc_node mm/slub.c:3367 [inline] slab_alloc_node mm/slub.c:3460 [inline] __kmem_cache_alloc_node+0x137/0x350 mm/slub.c:3509 __do_kmalloc_node mm/slab_common.c:984 [inline] __kmalloc_node_track_caller+0x4d/0x100 mm/slab_common.c:1005 kmalloc_reserve+0xef/0x270 net/core/skbuff.c:575 __alloc_skb+0x12b/0x330 net/core/skbuff.c:644 alloc_skb include/linux/skbuff.h:1289 [inline] alloc_skb_with_frags+0x9d/0x700 net/core/skbuff.c:6233 sock_alloc_send_pskb+0x7c8/0x950 net/core/sock.c:2793 sock_alloc_send_skb include/net/sock.h:1871 [inline] mld_newpack.isra.0+0x1ee/0x790 net/ipv6/mcast.c:1748 add_grhead+0x295/0x340 net/ipv6/mcast.c:1851 add_grec+0x10bb/0x1680 net/ipv6/mcast.c:1989 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1161 [inline] free_unref_page_prepare+0x508/0xb90 mm/page_alloc.c:2348 free_unref_page+0x33/0x3b0 mm/page_alloc.c:2443 __unfreeze_partials+0x21d/0x240 mm/slub.c:2647 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:186 [inline] slab_post_alloc_hook mm/slab.h:762 [inline] slab_alloc_node mm/slub.c:3470 [inline] __kmem_cache_alloc_node+0x19b/0x350 mm/slub.c:3509 __do_kmalloc_node mm/slab_common.c:984 [inline] __kmalloc+0x4c/0x100 mm/slab_common.c:998 kmalloc include/linux/slab.h:586 [inline] sock_kmalloc+0xb2/0x100 net/core/sock.c:2694 ____sys_sendmsg+0x6ea/0x940 net/socket.c:2466 ___sys_sendmsg+0x135/0x1d0 net/socket.c:2548 __sys_sendmsg+0x117/0x1e0 net/socket.c:2577 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Memory state around the buggy address: ffff88802612bf00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88802612bf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88802612c000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88802612c080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88802612c100: 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