netlink: 208 bytes leftover after parsing attributes in process `syz-executor.1'. ================================================================== BUG: KASAN: slab-use-after-free in __list_add_valid+0xf0/0x100 lib/list_debug.c:27 Read of size 8 at addr ffff888078d3a008 by task syz-executor.1/4745 CPU: 0 PID: 4745 Comm: syz-executor.1 Not tainted 6.4.0-rc6-syzkaller-00269-g1b29d271614a #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/27/2023 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_add_valid+0xf0/0x100 lib/list_debug.c:27 __list_add include/linux/list.h:69 [inline] list_add include/linux/list.h:88 [inline] nfc_llcp_register_device+0x7a8/0x9e0 net/nfc/llcp_core.c:1604 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+0x37a/0x4a0 drivers/char/misc.c:165 chrdev_open+0x26a/0x770 fs/char_dev.c:414 do_dentry_open+0x6cc/0x13f0 fs/open.c:920 do_open fs/namei.c:3636 [inline] path_openat+0x1baa/0x2750 fs/namei.c:3791 do_filp_open+0x1ba/0x410 fs/namei.c:3818 do_sys_openat2+0x16d/0x4c0 fs/open.c:1356 do_sys_open fs/open.c:1372 [inline] __do_compat_sys_openat fs/open.c:1432 [inline] __se_compat_sys_openat fs/open.c:1430 [inline] __ia32_compat_sys_openat+0x143/0x1f0 fs/open.c:1430 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 RIP: 0023:0xf7f1f579 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:00000000f7f1a5cc EFLAGS: 00000296 ORIG_RAX: 0000000000000127 RAX: ffffffffffffffda RBX: 00000000ffffff9c RCX: 0000000020001b80 RDX: 0000000000000002 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 Allocated by task 4512: 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 kasan_kmalloc include/linux/kasan.h:196 [inline] __do_kmalloc_node mm/slab_common.c:966 [inline] __kmalloc_node_track_caller+0x5f/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] _sctp_make_chunk+0x50/0x270 net/sctp/sm_make_chunk.c:1443 sctp_make_data net/sctp/sm_make_chunk.c:1475 [inline] sctp_make_datafrag_empty+0x168/0x230 net/sctp/sm_make_chunk.c:740 sctp_datamsg_from_user+0x61e/0x1230 net/sctp/chunk.c:262 sctp_sendmsg_to_asoc+0xcd8/0x1ad0 net/sctp/socket.c:1858 sctp_sendmsg+0x8d4/0x1d90 net/sctp/socket.c:2030 inet_sendmsg+0x9d/0xe0 net/ipv4/af_inet.c:827 sock_sendmsg_nosec net/socket.c:724 [inline] sock_sendmsg+0xde/0x190 net/socket.c:747 __sys_sendto+0x23a/0x340 net/socket.c:2144 __do_sys_sendto net/socket.c:2156 [inline] __se_sys_sendto net/socket.c:2152 [inline] __ia32_sys_sendto+0xdf/0x1b0 net/socket.c:2152 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 4512: 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:1781 [inline] slab_free_freelist_hook+0x8b/0x1c0 mm/slub.c:1807 slab_free mm/slub.c:3786 [inline] __kmem_cache_free+0xaf/0x2d0 mm/slub.c:3799 skb_kfree_head net/core/skbuff.c:906 [inline] skb_free_head+0x110/0x1b0 net/core/skbuff.c:918 skb_release_data+0x598/0x820 net/core/skbuff.c:948 skb_release_all net/core/skbuff.c:1014 [inline] __kfree_skb net/core/skbuff.c:1028 [inline] consume_skb net/core/skbuff.c:1244 [inline] consume_skb+0xd2/0x170 net/core/skbuff.c:1238 sctp_chunk_destroy net/sctp/sm_make_chunk.c:1503 [inline] sctp_chunk_put+0x1c4/0x2d0 net/sctp/sm_make_chunk.c:1530 sctp_datamsg_destroy net/sctp/chunk.c:111 [inline] sctp_datamsg_put+0x131/0x5d0 net/sctp/chunk.c:128 sctp_chunk_free+0x46/0x60 net/sctp/sm_make_chunk.c:1515 __sctp_outq_teardown+0x6fe/0xc30 net/sctp/outqueue.c:257 sctp_association_free+0x20e/0x7d0 net/sctp/associola.c:339 sctp_cmd_delete_tcb net/sctp/sm_sideeffect.c:944 [inline] sctp_cmd_interpreter net/sctp/sm_sideeffect.c:1330 [inline] sctp_side_effects net/sctp/sm_sideeffect.c:1198 [inline] sctp_do_sm+0x2f6d/0x5370 net/sctp/sm_sideeffect.c:1169 sctp_primitive_SHUTDOWN+0x9f/0xc0 net/sctp/primitive.c:89 sctp_close+0x3e7/0x940 net/sctp/socket.c:1527 inet_release+0x132/0x270 net/ipv4/af_inet.c:426 inet6_release+0x50/0x70 net/ipv6/af_inet6.c:480 __sock_release+0xcd/0x290 net/socket.c:653 sock_close+0x1c/0x20 net/socket.c:1397 __fput+0x27c/0xa90 fs/file_table.c:321 task_work_run+0x16f/0x270 kernel/task_work.c:179 get_signal+0x1c7/0x25b0 kernel/signal.c:2652 arch_do_signal_or_restart+0x79/0x5c0 arch/x86/kernel/signal.c:306 exit_to_user_mode_loop kernel/entry/common.c:168 [inline] exit_to_user_mode_prepare+0x11f/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 insert_work+0x48/0x360 kernel/workqueue.c:1365 __queue_work+0x625/0x1120 kernel/workqueue.c:1526 queue_work_on+0xf2/0x110 kernel/workqueue.c:1554 queue_work include/linux/workqueue.h:505 [inline] rpm_suspend+0xf76/0x1670 drivers/base/power/runtime.c:660 rpm_idle+0x381/0x720 drivers/base/power/runtime.c:534 __pm_runtime_idle+0xc1/0x160 drivers/base/power/runtime.c:1102 pm_runtime_put include/linux/pm_runtime.h:462 [inline] unlink_peers drivers/usb/core/port.c:549 [inline] usb_hub_remove_port_device+0x262/0x370 drivers/usb/core/port.c:766 hub_disconnect+0x17b/0x520 drivers/usb/core/hub.c:1741 usb_unbind_interface+0x1dc/0x8e0 drivers/usb/core/driver.c:458 device_remove drivers/base/dd.c:569 [inline] device_remove+0x11f/0x170 drivers/base/dd.c:561 __device_release_driver drivers/base/dd.c:1272 [inline] device_release_driver_internal+0x443/0x610 drivers/base/dd.c:1295 usb_driver_release_interface+0x10c/0x190 drivers/usb/core/driver.c:627 proc_disconnect_claim+0x212/0x370 drivers/usb/core/devio.c:2487 usbdev_do_ioctl drivers/usb/core/devio.c:2770 [inline] usbdev_ioctl+0x1522/0x3bc0 drivers/usb/core/devio.c:2814 compat_ptr_ioctl+0x6b/0xa0 fs/ioctl.c:906 __do_compat_sys_ioctl+0x255/0x2b0 fs/ioctl.c:968 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 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 insert_work+0x48/0x360 kernel/workqueue.c:1365 __queue_work+0x625/0x1120 kernel/workqueue.c:1526 queue_work_on+0xf2/0x110 kernel/workqueue.c:1554 queue_work include/linux/workqueue.h:505 [inline] rpm_suspend+0xf76/0x1670 drivers/base/power/runtime.c:660 rpm_idle+0x381/0x720 drivers/base/power/runtime.c:534 __pm_runtime_idle+0xc1/0x160 drivers/base/power/runtime.c:1102 pm_runtime_put include/linux/pm_runtime.h:462 [inline] hub_configure drivers/usb/core/hub.c:1673 [inline] hub_probe+0x1d55/0x2f60 drivers/usb/core/hub.c:1899 usb_probe_interface+0x30f/0x960 drivers/usb/core/driver.c:396 call_driver_probe drivers/base/dd.c:579 [inline] really_probe+0x240/0xca0 drivers/base/dd.c:658 __driver_probe_device+0x1df/0x4b0 drivers/base/dd.c:800 driver_probe_device+0x4c/0x1a0 drivers/base/dd.c:830 __device_attach_driver+0x1d4/0x2e0 drivers/base/dd.c:958 bus_for_each_drv+0x149/0x1d0 drivers/base/bus.c:457 __device_attach+0x1e4/0x4b0 drivers/base/dd.c:1030 proc_ioctl.part.0+0x48e/0x550 drivers/usb/core/devio.c:2363 proc_ioctl drivers/usb/core/devio.c:182 [inline] proc_ioctl_default drivers/usb/core/devio.c:2398 [inline] usbdev_do_ioctl drivers/usb/core/devio.c:2754 [inline] usbdev_ioctl+0x1670/0x3bc0 drivers/usb/core/devio.c:2814 compat_ptr_ioctl+0x6b/0xa0 fs/ioctl.c:906 __do_compat_sys_ioctl+0x255/0x2b0 fs/ioctl.c:968 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 The buggy address belongs to the object at ffff888078d3a000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 8 bytes inside of freed 2048-byte region [ffff888078d3a000, ffff888078d3a800) The buggy address belongs to the physical page: page:ffffea0001e34e00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x78d38 head:ffffea0001e34e00 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 ffff888012442000 ffffea0001e77600 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 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 4447, tgid 4447 (klogd), ts 92926567122, free_ts 92926470379 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x2db/0x350 mm/page_alloc.c:1731 prep_new_page mm/page_alloc.c:1738 [inline] get_page_from_freelist+0xf41/0x2c00 mm/page_alloc.c:3502 __alloc_pages+0x1cb/0x4a0 mm/page_alloc.c:4768 alloc_pages+0x1aa/0x270 mm/mempolicy.c:2279 alloc_slab_page mm/slub.c:1851 [inline] allocate_slab+0x25f/0x390 mm/slub.c:1998 new_slab mm/slub.c:2051 [inline] ___slab_alloc+0xa91/0x1400 mm/slub.c:3192 __slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3291 __slab_alloc_node mm/slub.c:3344 [inline] slab_alloc_node mm/slub.c:3441 [inline] __kmem_cache_alloc_node+0x136/0x320 mm/slub.c:3490 kmalloc_trace+0x26/0xe0 mm/slab_common.c:1057 kmalloc include/linux/slab.h:559 [inline] syslog_print+0xc7/0x580 kernel/printk/printk.c:1553 do_syslog.part.0+0x1f2/0x570 kernel/printk/printk.c:1732 do_syslog kernel/printk/printk.c:1822 [inline] __do_sys_syslog kernel/printk/printk.c:1824 [inline] __se_sys_syslog kernel/printk/printk.c:1822 [inline] __x64_sys_syslog+0x9b/0xd0 kernel/printk/printk.c:1822 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1302 [inline] free_unref_page_prepare+0x62e/0xcb0 mm/page_alloc.c:2564 free_unref_page+0x33/0x370 mm/page_alloc.c:2659 __unfreeze_partials+0x17c/0x1a0 mm/slub.c:2636 qlink_free mm/kasan/quarantine.c:166 [inline] qlist_free_all+0x6a/0x170 mm/kasan/quarantine.c:185 kasan_quarantine_reduce+0x195/0x220 mm/kasan/quarantine.c:292 __kasan_slab_alloc+0x63/0x90 mm/kasan/common.c:305 kasan_slab_alloc include/linux/kasan.h:186 [inline] slab_post_alloc_hook mm/slab.h:711 [inline] slab_alloc_node mm/slub.c:3451 [inline] kmem_cache_alloc_node+0x185/0x3e0 mm/slub.c:3496 __alloc_skb+0x288/0x330 net/core/skbuff.c:644 alloc_skb include/linux/skbuff.h:1288 [inline] alloc_skb_with_frags+0x9a/0x6c0 net/core/skbuff.c:6380 sock_alloc_send_pskb+0x7a7/0x930 net/core/sock.c:2729 unix_dgram_sendmsg+0x41b/0x1950 net/unix/af_unix.c:1944 sock_sendmsg_nosec net/socket.c:724 [inline] sock_sendmsg+0xde/0x190 net/socket.c:747 __sys_sendto+0x23a/0x340 net/socket.c:2144 __do_sys_sendto net/socket.c:2156 [inline] __se_sys_sendto net/socket.c:2152 [inline] __x64_sys_sendto+0xe1/0x1b0 net/socket.c:2152 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Memory state around the buggy address: ffff888078d39f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888078d39f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888078d3a000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888078d3a080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888078d3a100: 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