================================================================== BUG: KASAN: slab-use-after-free in hci_sock_get_cookie+0x42/0x50 net/bluetooth/hci_sock.c:96 Read of size 4 at addr ffff888057c0d5b8 by task syz.2.1022/8595 CPU: 0 UID: 0 PID: 8595 Comm: syz.2.1022 Not tainted 6.13.0-rc7-syzkaller-00209-g9528d418de4d #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 12/27/2024 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0xc3/0x620 mm/kasan/report.c:489 kasan_report+0xd9/0x110 mm/kasan/report.c:602 hci_sock_get_cookie+0x42/0x50 net/bluetooth/hci_sock.c:96 mgmt_cmd_status+0x229/0x520 net/bluetooth/mgmt_util.c:149 cmd_status_rsp net/bluetooth/mgmt.c:1458 [inline] cmd_complete_rsp+0x165/0x1e0 net/bluetooth/mgmt.c:1478 mgmt_pending_foreach+0xe2/0x140 net/bluetooth/mgmt_util.c:259 __mgmt_power_off+0x12a/0x2c0 net/bluetooth/mgmt.c:9584 hci_dev_close_sync+0xcbb/0x11a0 net/bluetooth/hci_sync.c:5209 hci_dev_do_close+0x2e/0x90 net/bluetooth/hci_core.c:482 hci_dev_close+0x183/0x1e0 net/bluetooth/hci_core.c:507 hci_sock_ioctl+0x2b5/0x7d0 net/bluetooth/hci_sock.c:1128 sock_do_ioctl+0x119/0x280 net/socket.c:1209 sock_ioctl+0x228/0x6c0 net/socket.c:1328 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:906 [inline] __se_sys_ioctl fs/ioctl.c:892 [inline] __x64_sys_ioctl+0x193/0x200 fs/ioctl.c:892 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f034dd85d29 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f034ebe5038 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007f034df75fa0 RCX: 00007f034dd85d29 RDX: 0000000000000000 RSI: 00000000400448ca RDI: 0000000000000004 RBP: 00007f034de01b08 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f034df75fa0 R15: 00007ffc75ec7218 Allocated by task 6867: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 poison_kmalloc_redzone mm/kasan/common.c:377 [inline] __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:394 kasan_kmalloc include/linux/kasan.h:260 [inline] __do_kmalloc_node mm/slub.c:4298 [inline] __kmalloc_noprof+0x21c/0x510 mm/slub.c:4310 kmalloc_noprof include/linux/slab.h:905 [inline] sk_prot_alloc+0x1a8/0x2a0 net/core/sock.c:2168 sk_alloc+0x36/0xb90 net/core/sock.c:2221 bt_sock_alloc+0x3b/0x3a0 net/bluetooth/af_bluetooth.c:148 hci_sock_create+0xbc/0x1a0 net/bluetooth/hci_sock.c:2202 bt_sock_create+0x185/0x350 net/bluetooth/af_bluetooth.c:132 __sock_create+0x338/0x8d0 net/socket.c:1558 sock_create net/socket.c:1616 [inline] __sys_socket_create net/socket.c:1653 [inline] __sys_socket+0x14f/0x260 net/socket.c:1700 __do_sys_socket net/socket.c:1714 [inline] __se_sys_socket net/socket.c:1712 [inline] __x64_sys_socket+0x72/0xb0 net/socket.c:1712 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 8604: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 kasan_save_free_info+0x3b/0x60 mm/kasan/generic.c:582 poison_slab_object mm/kasan/common.c:247 [inline] __kasan_slab_free+0x51/0x70 mm/kasan/common.c:264 kasan_slab_free include/linux/kasan.h:233 [inline] slab_free_hook mm/slub.c:2353 [inline] slab_free mm/slub.c:4613 [inline] kfree+0x14f/0x4b0 mm/slub.c:4761 sk_prot_free net/core/sock.c:2204 [inline] __sk_destruct+0x5eb/0x720 net/core/sock.c:2296 sk_destruct+0xc2/0xf0 net/core/sock.c:2311 __sk_free+0xf4/0x3e0 net/core/sock.c:2322 sk_free+0x6a/0x90 net/core/sock.c:2333 sock_put include/net/sock.h:1910 [inline] mgmt_pending_free+0xc0/0xf0 net/bluetooth/mgmt_util.c:307 cmd_status_rsp net/bluetooth/mgmt.c:1459 [inline] cmd_complete_rsp+0x16d/0x1e0 net/bluetooth/mgmt.c:1478 mgmt_pending_foreach+0xe2/0x140 net/bluetooth/mgmt_util.c:259 mgmt_index_removed+0x145/0x300 net/bluetooth/mgmt.c:9517 hci_sock_bind+0xb57/0x14d0 net/bluetooth/hci_sock.c:1307 __sys_bind_socket net/socket.c:1827 [inline] __sys_bind_socket net/socket.c:1819 [inline] __sys_bind+0x216/0x260 net/socket.c:1858 __do_sys_bind net/socket.c:1863 [inline] __se_sys_bind net/socket.c:1861 [inline] __x64_sys_bind+0x72/0xb0 net/socket.c:1861 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff888057c0d000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 1464 bytes inside of freed 2048-byte region [ffff888057c0d000, ffff888057c0d800) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888057c0f000 pfn:0x57c08 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000000240(workingset|head|node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000240 ffff88801b042000 ffffea0001631210 ffffea000172c010 raw: ffff888057c0f000 0000000000080003 00000001f5000000 0000000000000000 head: 00fff00000000240 ffff88801b042000 ffffea0001631210 ffffea000172c010 head: ffff888057c0f000 0000000000080003 00000001f5000000 0000000000000000 head: 00fff00000000003 ffffea00015f0201 ffffffffffffffff 0000000000000000 head: 0000000000000008 0000000000000000 00000000ffffffff 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 0xd2820(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5829, tgid 5829 (syz-executor), ts 99188561302, free_ts 32585661858 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1558 prep_new_page mm/page_alloc.c:1566 [inline] get_page_from_freelist+0xfce/0x2f80 mm/page_alloc.c:3476 __alloc_pages_noprof+0x223/0x25b0 mm/page_alloc.c:4753 alloc_pages_mpol_noprof+0x2c8/0x620 mm/mempolicy.c:2269 alloc_slab_page mm/slub.c:2423 [inline] allocate_slab mm/slub.c:2589 [inline] new_slab+0x2c9/0x410 mm/slub.c:2642 ___slab_alloc+0xd7d/0x17a0 mm/slub.c:3830 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3920 __slab_alloc_node mm/slub.c:3995 [inline] slab_alloc_node mm/slub.c:4156 [inline] __do_kmalloc_node mm/slub.c:4297 [inline] __kmalloc_node_track_caller_noprof+0x2f1/0x510 mm/slub.c:4317 kmalloc_reserve+0xef/0x2c0 net/core/skbuff.c:609 pskb_expand_head+0x243/0x1240 net/core/skbuff.c:2275 netlink_trim+0x1ef/0x250 net/netlink/af_netlink.c:1303 netlink_broadcast_filtered+0xc7/0xef0 net/netlink/af_netlink.c:1509 nlmsg_multicast_filtered include/net/netlink.h:1128 [inline] nlmsg_multicast include/net/netlink.h:1147 [inline] nlmsg_notify+0x9e/0x220 net/netlink/af_netlink.c:2585 rtnl_notify net/core/rtnetlink.c:943 [inline] rtmsg_ifinfo_send net/core/rtnetlink.c:4376 [inline] rtmsg_ifinfo_event net/core/rtnetlink.c:4392 [inline] rtmsg_ifinfo_event net/core/rtnetlink.c:4379 [inline] rtmsg_ifinfo+0x174/0x1a0 net/core/rtnetlink.c:4398 __dev_notify_flags+0x24e/0x2e0 net/core/dev.c:9003 dev_change_flags+0x10c/0x160 net/core/dev.c:9045 page last free pid 1 tgid 1 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1127 [inline] free_unref_page+0x661/0x1080 mm/page_alloc.c:2659 free_contig_range+0x133/0x3f0 mm/page_alloc.c:6635 destroy_args+0x802/0xa50 mm/debug_vm_pgtable.c:1017 debug_vm_pgtable+0x168e/0x31a0 mm/debug_vm_pgtable.c:1397 do_one_initcall+0x12b/0x700 init/main.c:1266 do_initcall_level init/main.c:1328 [inline] do_initcalls init/main.c:1344 [inline] do_basic_setup init/main.c:1363 [inline] kernel_init_freeable+0x5c7/0x900 init/main.c:1577 kernel_init+0x1c/0x2b0 init/main.c:1466 ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Memory state around the buggy address: ffff888057c0d480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888057c0d500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888057c0d580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888057c0d600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888057c0d680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ================================================================== BUG: KASAN: slab-use-after-free in sk_filter_trim_cap+0x9bd/0xac0 net/core/filter.c:156 Read of size 8 at addr ffff888057c0d178 by task syz.2.1022/8595 CPU: 1 UID: 0 PID: 8595 Comm: syz.2.1022 Tainted: G B 6.13.0-rc7-syzkaller-00209-g9528d418de4d #0 Tainted: [B]=BAD_PAGE Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 12/27/2024 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0xc3/0x620 mm/kasan/report.c:489 kasan_report+0xd9/0x110 mm/kasan/report.c:602 sk_filter_trim_cap+0x9bd/0xac0 net/core/filter.c:156 sk_filter include/linux/filter.h:1062 [inline] sock_queue_rcv_skb_reason+0x30/0xe0 net/core/sock.c:520 sock_queue_rcv_skb include/net/sock.h:2399 [inline] mgmt_cmd_status+0x304/0x520 net/bluetooth/mgmt_util.c:156 cmd_status_rsp net/bluetooth/mgmt.c:1458 [inline] cmd_complete_rsp+0x165/0x1e0 net/bluetooth/mgmt.c:1478 mgmt_pending_foreach+0xe2/0x140 net/bluetooth/mgmt_util.c:259 __mgmt_power_off+0x12a/0x2c0 net/bluetooth/mgmt.c:9584 hci_dev_close_sync+0xcbb/0x11a0 net/bluetooth/hci_sync.c:5209 hci_dev_do_close+0x2e/0x90 net/bluetooth/hci_core.c:482 hci_dev_close+0x183/0x1e0 net/bluetooth/hci_core.c:507 hci_sock_ioctl+0x2b5/0x7d0 net/bluetooth/hci_sock.c:1128 sock_do_ioctl+0x119/0x280 net/socket.c:1209 sock_ioctl+0x228/0x6c0 net/socket.c:1328 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:906 [inline] __se_sys_ioctl fs/ioctl.c:892 [inline] __x64_sys_ioctl+0x193/0x200 fs/ioctl.c:892 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f034dd85d29 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f034ebe5038 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007f034df75fa0 RCX: 00007f034dd85d29 RDX: 0000000000000000 RSI: 00000000400448ca RDI: 0000000000000004 RBP: 00007f034de01b08 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f034df75fa0 R15: 00007ffc75ec7218 Allocated by task 6867: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 poison_kmalloc_redzone mm/kasan/common.c:377 [inline] __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:394 kasan_kmalloc include/linux/kasan.h:260 [inline] __do_kmalloc_node mm/slub.c:4298 [inline] __kmalloc_noprof+0x21c/0x510 mm/slub.c:4310 kmalloc_noprof include/linux/slab.h:905 [inline] sk_prot_alloc+0x1a8/0x2a0 net/core/sock.c:2168 sk_alloc+0x36/0xb90 net/core/sock.c:2221 bt_sock_alloc+0x3b/0x3a0 net/bluetooth/af_bluetooth.c:148 hci_sock_create+0xbc/0x1a0 net/bluetooth/hci_sock.c:2202 bt_sock_create+0x185/0x350 net/bluetooth/af_bluetooth.c:132 __sock_create+0x338/0x8d0 net/socket.c:1558 sock_create net/socket.c:1616 [inline] __sys_socket_create net/socket.c:1653 [inline] __sys_socket+0x14f/0x260 net/socket.c:1700 __do_sys_socket net/socket.c:1714 [inline] __se_sys_socket net/socket.c:1712 [inline] __x64_sys_socket+0x72/0xb0 net/socket.c:1712 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 8604: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 kasan_save_free_info+0x3b/0x60 mm/kasan/generic.c:582 poison_slab_object mm/kasan/common.c:247 [inline] __kasan_slab_free+0x51/0x70 mm/kasan/common.c:264 kasan_slab_free include/linux/kasan.h:233 [inline] slab_free_hook mm/slub.c:2353 [inline] slab_free mm/slub.c:4613 [inline] kfree+0x14f/0x4b0 mm/slub.c:4761 sk_prot_free net/core/sock.c:2204 [inline] __sk_destruct+0x5eb/0x720 net/core/sock.c:2296 sk_destruct+0xc2/0xf0 net/core/sock.c:2311 __sk_free+0xf4/0x3e0 net/core/sock.c:2322 sk_free+0x6a/0x90 net/core/sock.c:2333 sock_put include/net/sock.h:1910 [inline] mgmt_pending_free+0xc0/0xf0 net/bluetooth/mgmt_util.c:307 cmd_status_rsp net/bluetooth/mgmt.c:1459 [inline] cmd_complete_rsp+0x16d/0x1e0 net/bluetooth/mgmt.c:1478 mgmt_pending_foreach+0xe2/0x140 net/bluetooth/mgmt_util.c:259 mgmt_index_removed+0x145/0x300 net/bluetooth/mgmt.c:9517 hci_sock_bind+0xb57/0x14d0 net/bluetooth/hci_sock.c:1307 __sys_bind_socket net/socket.c:1827 [inline] __sys_bind_socket net/socket.c:1819 [inline] __sys_bind+0x216/0x260 net/socket.c:1858 __do_sys_bind net/socket.c:1863 [inline] __se_sys_bind net/socket.c:1861 [inline] __x64_sys_bind+0x72/0xb0 net/socket.c:1861 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff888057c0d000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 376 bytes inside of freed 2048-byte region [ffff888057c0d000, ffff888057c0d800) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888057c0f000 pfn:0x57c08 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000000240(workingset|head|node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000240 ffff88801b042000 ffffea0001631210 ffffea000172c010 raw: ffff888057c0f000 0000000000080003 00000001f5000000 0000000000000000 head: 00fff00000000240 ffff88801b042000 ffffea0001631210 ffffea000172c010 head: ffff888057c0f000 0000000000080003 00000001f5000000 0000000000000000 head: 00fff00000000003 ffffea00015f0201 ffffffffffffffff 0000000000000000 head: 0000000000000008 0000000000000000 00000000ffffffff 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 0xd2820(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5829, tgid 5829 (syz-executor), ts 99188561302, free_ts 32585661858 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1558 prep_new_page mm/page_alloc.c:1566 [inline] get_page_from_freelist+0xfce/0x2f80 mm/page_alloc.c:3476 __alloc_pages_noprof+0x223/0x25b0 mm/page_alloc.c:4753 alloc_pages_mpol_noprof+0x2c8/0x620 mm/mempolicy.c:2269 alloc_slab_page mm/slub.c:2423 [inline] allocate_slab mm/slub.c:2589 [inline] new_slab+0x2c9/0x410 mm/slub.c:2642 ___slab_alloc+0xd7d/0x17a0 mm/slub.c:3830 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3920 __slab_alloc_node mm/slub.c:3995 [inline] slab_alloc_node mm/slub.c:4156 [inline] __do_kmalloc_node mm/slub.c:4297 [inline] __kmalloc_node_track_caller_noprof+0x2f1/0x510 mm/slub.c:4317 kmalloc_reserve+0xef/0x2c0 net/core/skbuff.c:609 pskb_expand_head+0x243/0x1240 net/core/skbuff.c:2275 netlink_trim+0x1ef/0x250 net/netlink/af_netlink.c:1303 netlink_broadcast_filtered+0xc7/0xef0 net/netlink/af_netlink.c:1509 nlmsg_multicast_filtered include/net/netlink.h:1128 [inline] nlmsg_multicast include/net/netlink.h:1147 [inline] nlmsg_notify+0x9e/0x220 net/netlink/af_netlink.c:2585 rtnl_notify net/core/rtnetlink.c:943 [inline] rtmsg_ifinfo_send net/core/rtnetlink.c:4376 [inline] rtmsg_ifinfo_event net/core/rtnetlink.c:4392 [inline] rtmsg_ifinfo_event net/core/rtnetlink.c:4379 [inline] rtmsg_ifinfo+0x174/0x1a0 net/core/rtnetlink.c:4398 __dev_notify_flags+0x24e/0x2e0 net/core/dev.c:9003 dev_change_flags+0x10c/0x160 net/core/dev.c:9045 page last free pid 1 tgid 1 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1127 [inline] free_unref_page+0x661/0x1080 mm/page_alloc.c:2659 free_contig_range+0x133/0x3f0 mm/page_alloc.c:6635 destroy_args+0x802/0xa50 mm/debug_vm_pgtable.c:1017 debug_vm_pgtable+0x168e/0x31a0 mm/debug_vm_pgtable.c:1397 do_one_initcall+0x12b/0x700 init/main.c:1266 do_initcall_level init/main.c:1328 [inline] do_initcalls init/main.c:1344 [inline] do_basic_setup init/main.c:1363 [inline] kernel_init_freeable+0x5c7/0x900 init/main.c:1577 kernel_init+0x1c/0x2b0 init/main.c:1466 ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Memory state around the buggy address: ffff888057c0d000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888057c0d080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888057c0d100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888057c0d180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888057c0d200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ================================================================== BUG: KASAN: slab-use-after-free in instrument_atomic_read include/linux/instrumented.h:68 [inline] BUG: KASAN: slab-use-after-free in atomic_read include/linux/atomic/atomic-instrumented.h:32 [inline] BUG: KASAN: slab-use-after-free in __sock_queue_rcv_skb+0x3c/0xa80 net/core/sock.c:484 Read of size 4 at addr ffff888057c0d140 by task syz.2.1022/8595 CPU: 0 UID: 0 PID: 8595 Comm: syz.2.1022 Tainted: G B 6.13.0-rc7-syzkaller-00209-g9528d418de4d #0 Tainted: [B]=BAD_PAGE Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 12/27/2024 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0xc3/0x620 mm/kasan/report.c:489 kasan_report+0xd9/0x110 mm/kasan/report.c:602 check_region_inline mm/kasan/generic.c:183 [inline] kasan_check_range+0xef/0x1a0 mm/kasan/generic.c:189 instrument_atomic_read include/linux/instrumented.h:68 [inline] atomic_read include/linux/atomic/atomic-instrumented.h:32 [inline] __sock_queue_rcv_skb+0x3c/0xa80 net/core/sock.c:484 sock_queue_rcv_skb_reason+0xa2/0xe0 net/core/sock.c:525 sock_queue_rcv_skb include/net/sock.h:2399 [inline] mgmt_cmd_status+0x304/0x520 net/bluetooth/mgmt_util.c:156 cmd_status_rsp net/bluetooth/mgmt.c:1458 [inline] cmd_complete_rsp+0x165/0x1e0 net/bluetooth/mgmt.c:1478 mgmt_pending_foreach+0xe2/0x140 net/bluetooth/mgmt_util.c:259 __mgmt_power_off+0x12a/0x2c0 net/bluetooth/mgmt.c:9584 hci_dev_close_sync+0xcbb/0x11a0 net/bluetooth/hci_sync.c:5209 hci_dev_do_close+0x2e/0x90 net/bluetooth/hci_core.c:482 hci_dev_close+0x183/0x1e0 net/bluetooth/hci_core.c:507 hci_sock_ioctl+0x2b5/0x7d0 net/bluetooth/hci_sock.c:1128 sock_do_ioctl+0x119/0x280 net/socket.c:1209 sock_ioctl+0x228/0x6c0 net/socket.c:1328 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:906 [inline] __se_sys_ioctl fs/ioctl.c:892 [inline] __x64_sys_ioctl+0x193/0x200 fs/ioctl.c:892 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f034dd85d29 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f034ebe5038 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007f034df75fa0 RCX: 00007f034dd85d29 RDX: 0000000000000000 RSI: 00000000400448ca RDI: 0000000000000004 RBP: 00007f034de01b08 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f034df75fa0 R15: 00007ffc75ec7218 Allocated by task 6867: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 poison_kmalloc_redzone mm/kasan/common.c:377 [inline] __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:394 kasan_kmalloc include/linux/kasan.h:260 [inline] __do_kmalloc_node mm/slub.c:4298 [inline] __kmalloc_noprof+0x21c/0x510 mm/slub.c:4310 kmalloc_noprof include/linux/slab.h:905 [inline] sk_prot_alloc+0x1a8/0x2a0 net/core/sock.c:2168 sk_alloc+0x36/0xb90 net/core/sock.c:2221 bt_sock_alloc+0x3b/0x3a0 net/bluetooth/af_bluetooth.c:148 hci_sock_create+0xbc/0x1a0 net/bluetooth/hci_sock.c:2202 bt_sock_create+0x185/0x350 net/bluetooth/af_bluetooth.c:132 __sock_create+0x338/0x8d0 net/socket.c:1558 sock_create net/socket.c:1616 [inline] __sys_socket_create net/socket.c:1653 [inline] __sys_socket+0x14f/0x260 net/socket.c:1700 __do_sys_socket net/socket.c:1714 [inline] __se_sys_socket net/socket.c:1712 [inline] __x64_sys_socket+0x72/0xb0 net/socket.c:1712 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 8604: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 kasan_save_free_info+0x3b/0x60 mm/kasan/generic.c:582 poison_slab_object mm/kasan/common.c:247 [inline] __kasan_slab_free+0x51/0x70 mm/kasan/common.c:264 kasan_slab_free include/linux/kasan.h:233 [inline] slab_free_hook mm/slub.c:2353 [inline] slab_free mm/slub.c:4613 [inline] kfree+0x14f/0x4b0 mm/slub.c:4761 sk_prot_free net/core/sock.c:2204 [inline] __sk_destruct+0x5eb/0x720 net/core/sock.c:2296 sk_destruct+0xc2/0xf0 net/core/sock.c:2311 __sk_free+0xf4/0x3e0 net/core/sock.c:2322 sk_free+0x6a/0x90 net/core/sock.c:2333 sock_put include/net/sock.h:1910 [inline] mgmt_pending_free+0xc0/0xf0 net/bluetooth/mgmt_util.c:307 cmd_status_rsp net/bluetooth/mgmt.c:1459 [inline] cmd_complete_rsp+0x16d/0x1e0 net/bluetooth/mgmt.c:1478 mgmt_pending_foreach+0xe2/0x140 net/bluetooth/mgmt_util.c:259 mgmt_index_removed+0x145/0x300 net/bluetooth/mgmt.c:9517 hci_sock_bind+0xb57/0x14d0 net/bluetooth/hci_sock.c:1307 __sys_bind_socket net/socket.c:1827 [inline] __sys_bind_socket net/socket.c:1819 [inline] __sys_bind+0x216/0x260 net/socket.c:1858 __do_sys_bind net/socket.c:1863 [inline] __se_sys_bind net/socket.c:1861 [inline] __x64_sys_bind+0x72/0xb0 net/socket.c:1861 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff888057c0d000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 320 bytes inside of freed 2048-byte region [ffff888057c0d000, ffff888057c0d800) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888057c0f000 pfn:0x57c08 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000000240(workingset|head|node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000240 ffff88801b042000 ffffea0001631210 ffffea000172c010 raw: ffff888057c0f000 0000000000080003 00000001f5000000 0000000000000000 head: 00fff00000000240 ffff88801b042000 ffffea0001631210 ffffea000172c010 head: ffff888057c0f000 0000000000080003 00000001f5000000 0000000000000000 head: 00fff00000000003 ffffea00015f0201 ffffffffffffffff 0000000000000000 head: 0000000000000008 0000000000000000 00000000ffffffff 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 0xd2820(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5829, tgid 5829 (syz-executor), ts 99188561302, free_ts 32585661858 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1558 prep_new_page mm/page_alloc.c:1566 [inline] get_page_from_freelist+0xfce/0x2f80 mm/page_alloc.c:3476 __alloc_pages_noprof+0x223/0x25b0 mm/page_alloc.c:4753 alloc_pages_mpol_noprof+0x2c8/0x620 mm/mempolicy.c:2269 alloc_slab_page mm/slub.c:2423 [inline] allocate_slab mm/slub.c:2589 [inline] new_slab+0x2c9/0x410 mm/slub.c:2642 ___slab_alloc+0xd7d/0x17a0 mm/slub.c:3830 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3920 __slab_alloc_node mm/slub.c:3995 [inline] slab_alloc_node mm/slub.c:4156 [inline] __do_kmalloc_node mm/slub.c:4297 [inline] __kmalloc_node_track_caller_noprof+0x2f1/0x510 mm/slub.c:4317 kmalloc_reserve+0xef/0x2c0 net/core/skbuff.c:609 pskb_expand_head+0x243/0x1240 net/core/skbuff.c:2275 netlink_trim+0x1ef/0x250 net/netlink/af_netlink.c:1303 netlink_broadcast_filtered+0xc7/0xef0 net/netlink/af_netlink.c:1509 nlmsg_multicast_filtered include/net/netlink.h:1128 [inline] nlmsg_multicast include/net/netlink.h:1147 [inline] nlmsg_notify+0x9e/0x220 net/netlink/af_netlink.c:2585 rtnl_notify net/core/rtnetlink.c:943 [inline] rtmsg_ifinfo_send net/core/rtnetlink.c:4376 [inline] rtmsg_ifinfo_event net/core/rtnetlink.c:4392 [inline] rtmsg_ifinfo_event net/core/rtnetlink.c:4379 [inline] rtmsg_ifinfo+0x174/0x1a0 net/core/rtnetlink.c:4398 __dev_notify_flags+0x24e/0x2e0 net/core/dev.c:9003 dev_change_flags+0x10c/0x160 net/core/dev.c:9045 page last free pid 1 tgid 1 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1127 [inline] free_unref_page+0x661/0x1080 mm/page_alloc.c:2659 free_contig_range+0x133/0x3f0 mm/page_alloc.c:6635 destroy_args+0x802/0xa50 mm/debug_vm_pgtable.c:1017 debug_vm_pgtable+0x168e/0x31a0 mm/debug_vm_pgtable.c:1397 do_one_initcall+0x12b/0x700 init/main.c:1266 do_initcall_level init/main.c:1328 [inline] do_initcalls init/main.c:1344 [inline] do_basic_setup init/main.c:1363 [inline] kernel_init_freeable+0x5c7/0x900 init/main.c:1577 kernel_init+0x1c/0x2b0 init/main.c:1466 ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Memory state around the buggy address: ffff888057c0d000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888057c0d080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888057c0d100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888057c0d180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888057c0d200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ================================================================== BUG: KASAN: slab-use-after-free in arch_atomic_read arch/x86/include/asm/atomic.h:23 [inline] BUG: KASAN: slab-use-after-free in raw_atomic_read include/linux/atomic/atomic-arch-fallback.h:457 [inline] BUG: KASAN: slab-use-after-free in atomic_read include/linux/atomic/atomic-instrumented.h:33 [inline] BUG: KASAN: slab-use-after-free in __sock_queue_rcv_skb+0x6fe/0xa80 net/core/sock.c:484 Read of size 4 at addr ffff888057c0d140 by task syz.2.1022/8595 CPU: 1 UID: 0 PID: 8595 Comm: syz.2.1022 Tainted: G B 6.13.0-rc7-syzkaller-00209-g9528d418de4d #0 Tainted: [B]=BAD_PAGE Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 12/27/2024 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0xc3/0x620 mm/kasan/report.c:489 kasan_report+0xd9/0x110 mm/kasan/report.c:602 arch_atomic_read arch/x86/include/asm/atomic.h:23 [inline] raw_atomic_read include/linux/atomic/atomic-arch-fallback.h:457 [inline] atomic_read include/linux/atomic/atomic-instrumented.h:33 [inline] __sock_queue_rcv_skb+0x6fe/0xa80 net/core/sock.c:484 sock_queue_rcv_skb_reason+0xa2/0xe0 net/core/sock.c:525 sock_queue_rcv_skb include/net/sock.h:2399 [inline] mgmt_cmd_status+0x304/0x520 net/bluetooth/mgmt_util.c:156 cmd_status_rsp net/bluetooth/mgmt.c:1458 [inline] cmd_complete_rsp+0x165/0x1e0 net/bluetooth/mgmt.c:1478 mgmt_pending_foreach+0xe2/0x140 net/bluetooth/mgmt_util.c:259 __mgmt_power_off+0x12a/0x2c0 net/bluetooth/mgmt.c:9584 hci_dev_close_sync+0xcbb/0x11a0 net/bluetooth/hci_sync.c:5209 hci_dev_do_close+0x2e/0x90 net/bluetooth/hci_core.c:482 hci_dev_close+0x183/0x1e0 net/bluetooth/hci_core.c:507 hci_sock_ioctl+0x2b5/0x7d0 net/bluetooth/hci_sock.c:1128 sock_do_ioctl+0x119/0x280 net/socket.c:1209 sock_ioctl+0x228/0x6c0 net/socket.c:1328 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:906 [inline] __se_sys_ioctl fs/ioctl.c:892 [inline] __x64_sys_ioctl+0x193/0x200 fs/ioctl.c:892 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f034dd85d29 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f034ebe5038 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007f034df75fa0 RCX: 00007f034dd85d29 RDX: 0000000000000000 RSI: 00000000400448ca RDI: 0000000000000004 RBP: 00007f034de01b08 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f034df75fa0 R15: 00007ffc75ec7218 Allocated by task 6867: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 poison_kmalloc_redzone mm/kasan/common.c:377 [inline] __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:394 kasan_kmalloc include/linux/kasan.h:260 [inline] __do_kmalloc_node mm/slub.c:4298 [inline] __kmalloc_noprof+0x21c/0x510 mm/slub.c:4310 kmalloc_noprof include/linux/slab.h:905 [inline] sk_prot_alloc+0x1a8/0x2a0 net/core/sock.c:2168 sk_alloc+0x36/0xb90 net/core/sock.c:2221 bt_sock_alloc+0x3b/0x3a0 net/bluetooth/af_bluetooth.c:148 hci_sock_create+0xbc/0x1a0 net/bluetooth/hci_sock.c:2202 bt_sock_create+0x185/0x350 net/bluetooth/af_bluetooth.c:132 __sock_create+0x338/0x8d0 net/socket.c:1558 sock_create net/socket.c:1616 [inline] __sys_socket_create net/socket.c:1653 [inline] __sys_socket+0x14f/0x260 net/socket.c:1700 __do_sys_socket net/socket.c:1714 [inline] __se_sys_socket net/socket.c:1712 [inline] __x64_sys_socket+0x72/0xb0 net/socket.c:1712 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 8604: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 kasan_save_free_info+0x3b/0x60 mm/kasan/generic.c:582 poison_slab_object mm/kasan/common.c:247 [inline] __kasan_slab_free+0x51/0x70 mm/kasan/common.c:264 kasan_slab_free include/linux/kasan.h:233 [inline] slab_free_hook mm/slub.c:2353 [inline] slab_free mm/slub.c:4613 [inline] kfree+0x14f/0x4b0 mm/slub.c:4761 sk_prot_free net/core/sock.c:2204 [inline] __sk_destruct+0x5eb/0x720 net/core/sock.c:2296 sk_destruct+0xc2/0xf0 net/core/sock.c:2311 __sk_free+0xf4/0x3e0 net/core/sock.c:2322 sk_free+0x6a/0x90 net/core/sock.c:2333 sock_put include/net/sock.h:1910 [inline] mgmt_pending_free+0xc0/0xf0 net/bluetooth/mgmt_util.c:307 cmd_status_rsp net/bluetooth/mgmt.c:1459 [inline] cmd_complete_rsp+0x16d/0x1e0 net/bluetooth/mgmt.c:1478 mgmt_pending_foreach+0xe2/0x140 net/bluetooth/mgmt_util.c:259 mgmt_index_removed+0x145/0x300 net/bluetooth/mgmt.c:9517 hci_sock_bind+0xb57/0x14d0 net/bluetooth/hci_sock.c:1307 __sys_bind_socket net/socket.c:1827 [inline] __sys_bind_socket net/socket.c:1819 [inline] __sys_bind+0x216/0x260 net/socket.c:1858 __do_sys_bind net/socket.c:1863 [inline] __se_sys_bind net/socket.c:1861 [inline] __x64_sys_bind+0x72/0xb0 net/socket.c:1861 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff888057c0d000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 320 bytes inside of freed 2048-byte region [ffff888057c0d000, ffff888057c0d800) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888057c0f000 pfn:0x57c08 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000000240(workingset|head|node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000240 ffff88801b042000 ffffea0001631210 ffffea000172c010 raw: ffff888057c0f000 0000000000080003 00000001f5000000 0000000000000000 head: 00fff00000000240 ffff88801b042000 ffffea0001631210 ffffea000172c010 head: ffff888057c0f000 0000000000080003 00000001f5000000 0000000000000000 head: 00fff00000000003 ffffea00015f0201 ffffffffffffffff 0000000000000000 head: 0000000000000008 0000000000000000 00000000ffffffff 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 0xd2820(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5829, tgid 5829 (syz-executor), ts 99188561302, free_ts 32585661858 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1558 prep_new_page mm/page_alloc.c:1566 [inline] get_page_from_freelist+0xfce/0x2f80 mm/page_alloc.c:3476 __alloc_pages_noprof+0x223/0x25b0 mm/page_alloc.c:4753 alloc_pages_mpol_noprof+0x2c8/0x620 mm/mempolicy.c:2269 alloc_slab_page mm/slub.c:2423 [inline] allocate_slab mm/slub.c:2589 [inline] new_slab+0x2c9/0x410 mm/slub.c:2642 ___slab_alloc+0xd7d/0x17a0 mm/slub.c:3830 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3920 __slab_alloc_node mm/slub.c:3995 [inline] slab_alloc_node mm/slub.c:4156 [inline] __do_kmalloc_node mm/slub.c:4297 [inline] __kmalloc_node_track_caller_noprof+0x2f1/0x510 mm/slub.c:4317 kmalloc_reserve+0xef/0x2c0 net/core/skbuff.c:609 pskb_expand_head+0x243/0x1240 net/core/skbuff.c:2275 netlink_trim+0x1ef/0x250 net/netlink/af_netlink.c:1303 netlink_broadcast_filtered+0xc7/0xef0 net/netlink/af_netlink.c:1509 nlmsg_multicast_filtered include/net/netlink.h:1128 [inline] nlmsg_multicast include/net/netlink.h:1147 [inline] nlmsg_notify+0x9e/0x220 net/netlink/af_netlink.c:2585 rtnl_notify net/core/rtnetlink.c:943 [inline] rtmsg_ifinfo_send net/core/rtnetlink.c:4376 [inline] rtmsg_ifinfo_event net/core/rtnetlink.c:4392 [inline] rtmsg_ifinfo_event net/core/rtnetlink.c:4379 [inline] rtmsg_ifinfo+0x174/0x1a0 net/core/rtnetlink.c:4398 __dev_notify_flags+0x24e/0x2e0 net/core/dev.c:9003 dev_change_flags+0x10c/0x160 net/core/dev.c:9045 page last free pid 1 tgid 1 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1127 [inline] free_unref_page+0x661/0x1080 mm/page_alloc.c:2659 free_contig_range+0x133/0x3f0 mm/page_alloc.c:6635 destroy_args+0x802/0xa50 mm/debug_vm_pgtable.c:1017 debug_vm_pgtable+0x168e/0x31a0 mm/debug_vm_pgtable.c:1397 do_one_initcall+0x12b/0x700 init/main.c:1266 do_initcall_level init/main.c:1328 [inline] do_initcalls init/main.c:1344 [inline] do_basic_setup init/main.c:1363 [inline] kernel_init_freeable+0x5c7/0x900 init/main.c:1577 kernel_init+0x1c/0x2b0 init/main.c:1466 ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Memory state around the buggy address: ffff888057c0d000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888057c0d080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888057c0d100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888057c0d180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888057c0d200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ================================================================== BUG: KASAN: slab-use-after-free in __sock_queue_rcv_skb+0x708/0xa80 net/core/sock.c:484 Read of size 4 at addr ffff888057c0d174 by task syz.2.1022/8595 CPU: 0 UID: 0 PID: 8595 Comm: syz.2.1022 Tainted: G B 6.13.0-rc7-syzkaller-00209-g9528d418de4d #0 Tainted: [B]=BAD_PAGE Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 12/27/2024 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0xc3/0x620 mm/kasan/report.c:489 kasan_report+0xd9/0x110 mm/kasan/report.c:602 __sock_queue_rcv_skb+0x708/0xa80 net/core/sock.c:484 sock_queue_rcv_skb_reason+0xa2/0xe0 net/core/sock.c:525 sock_queue_rcv_skb include/net/sock.h:2399 [inline] mgmt_cmd_status+0x304/0x520 net/bluetooth/mgmt_util.c:156 cmd_status_rsp net/bluetooth/mgmt.c:1458 [inline] cmd_complete_rsp+0x165/0x1e0 net/bluetooth/mgmt.c:1478 mgmt_pending_foreach+0xe2/0x140 net/bluetooth/mgmt_util.c:259 __mgmt_power_off+0x12a/0x2c0 net/bluetooth/mgmt.c:9584 hci_dev_close_sync+0xcbb/0x11a0 net/bluetooth/hci_sync.c:5209 hci_dev_do_close+0x2e/0x90 net/bluetooth/hci_core.c:482 hci_dev_close+0x183/0x1e0 net/bluetooth/hci_core.c:507 hci_sock_ioctl+0x2b5/0x7d0 net/bluetooth/hci_sock.c:1128 sock_do_ioctl+0x119/0x280 net/socket.c:1209 sock_ioctl+0x228/0x6c0 net/socket.c:1328 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:906 [inline] __se_sys_ioctl fs/ioctl.c:892 [inline] __x64_sys_ioctl+0x193/0x200 fs/ioctl.c:892 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f034dd85d29 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f034ebe5038 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007f034df75fa0 RCX: 00007f034dd85d29 RDX: 0000000000000000 RSI: 00000000400448ca RDI: 0000000000000004 RBP: 00007f034de01b08 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f034df75fa0 R15: 00007ffc75ec7218 Allocated by task 6867: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 poison_kmalloc_redzone mm/kasan/common.c:377 [inline] __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:394 kasan_kmalloc include/linux/kasan.h:260 [inline] __do_kmalloc_node mm/slub.c:4298 [inline] __kmalloc_noprof+0x21c/0x510 mm/slub.c:4310 kmalloc_noprof include/linux/slab.h:905 [inline] sk_prot_alloc+0x1a8/0x2a0 net/core/sock.c:2168 sk_alloc+0x36/0xb90 net/core/sock.c:2221 bt_sock_alloc+0x3b/0x3a0 net/bluetooth/af_bluetooth.c:148 hci_sock_create+0xbc/0x1a0 net/bluetooth/hci_sock.c:2202 bt_sock_create+0x185/0x350 net/bluetooth/af_bluetooth.c:132 __sock_create+0x338/0x8d0 net/socket.c:1558 sock_create net/socket.c:1616 [inline] __sys_socket_create net/socket.c:1653 [inline] __sys_socket+0x14f/0x260 net/socket.c:1700 __do_sys_socket net/socket.c:1714 [inline] __se_sys_socket net/socket.c:1712 [inline] __x64_sys_socket+0x72/0xb0 net/socket.c:1712 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 8604: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 kasan_save_free_info+0x3b/0x60 mm/kasan/generic.c:582 poison_slab_object mm/kasan/common.c:247 [inline] __kasan_slab_free+0x51/0x70 mm/kasan/common.c:264 kasan_slab_free include/linux/kasan.h:233 [inline] slab_free_hook mm/slub.c:2353 [inline] slab_free mm/slub.c:4613 [inline] kfree+0x14f/0x4b0 mm/slub.c:4761 sk_prot_free net/core/sock.c:2204 [inline] __sk_destruct+0x5eb/0x720 net/core/sock.c:2296 sk_destruct+0xc2/0xf0 net/core/sock.c:2311 __sk_free+0xf4/0x3e0 net/core/sock.c:2322 sk_free+0x6a/0x90 net/core/sock.c:2333 sock_put include/net/sock.h:1910 [inline] mgmt_pending_free+0xc0/0xf0 net/bluetooth/mgmt_util.c:307 cmd_status_rsp net/bluetooth/mgmt.c:1459 [inline] cmd_complete_rsp+0x16d/0x1e0 net/bluetooth/mgmt.c:1478 mgmt_pending_foreach+0xe2/0x140 net/bluetooth/mgmt_util.c:259 mgmt_index_removed+0x145/0x300 net/bluetooth/mgmt.c:9517 hci_sock_bind+0xb57/0x14d0 net/bluetooth/hci_sock.c:1307 __sys_bind_socket net/socket.c:1827 [inline] __sys_bind_socket net/socket.c:1819 [inline] __sys_bind+0x216/0x260 net/socket.c:1858 __do_sys_bind net/socket.c:1863 [inline] __se_sys_bind net/socket.c:1861 [inline] __x64_sys_bind+0x72/0xb0 net/socket.c:1861 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff888057c0d000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 372 bytes inside of freed 2048-byte region [ffff888057c0d000, ffff888057c0d800) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888057c0f000 pfn:0x57c08 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000000240(workingset|head|node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000240 ffff88801b042000 ffffea0001631210 ffffea000172c010 raw: ffff888057c0f000 0000000000080003 00000001f5000000 0000000000000000 head: 00fff00000000240 ffff88801b042000 ffffea0001631210 ffffea000172c010 head: ffff888057c0f000 0000000000080003 00000001f5000000 0000000000000000 head: 00fff00000000003 ffffea00015f0201 ffffffffffffffff 0000000000000000 head: 0000000000000008 0000000000000000 00000000ffffffff 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 0xd2820(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5829, tgid 5829 (syz-executor), ts 99188561302, free_ts 32585661858 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1558 prep_new_page mm/page_alloc.c:1566 [inline] get_page_from_freelist+0xfce/0x2f80 mm/page_alloc.c:3476 __alloc_pages_noprof+0x223/0x25b0 mm/page_alloc.c:4753 alloc_pages_mpol_noprof+0x2c8/0x620 mm/mempolicy.c:2269 alloc_slab_page mm/slub.c:2423 [inline] allocate_slab mm/slub.c:2589 [inline] new_slab+0x2c9/0x410 mm/slub.c:2642 ___slab_alloc+0xd7d/0x17a0 mm/slub.c:3830 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3920 __slab_alloc_node mm/slub.c:3995 [inline] slab_alloc_node mm/slub.c:4156 [inline] __do_kmalloc_node mm/slub.c:4297 [inline] __kmalloc_node_track_caller_noprof+0x2f1/0x510 mm/slub.c:4317 kmalloc_reserve+0xef/0x2c0 net/core/skbuff.c:609 pskb_expand_head+0x243/0x1240 net/core/skbuff.c:2275 netlink_trim+0x1ef/0x250 net/netlink/af_netlink.c:1303 netlink_broadcast_filtered+0xc7/0xef0 net/netlink/af_netlink.c:1509 nlmsg_multicast_filtered include/net/netlink.h:1128 [inline] nlmsg_multicast include/net/netlink.h:1147 [inline] nlmsg_notify+0x9e/0x220 net/netlink/af_netlink.c:2585 rtnl_notify net/core/rtnetlink.c:943 [inline] rtmsg_ifinfo_send net/core/rtnetlink.c:4376 [inline] rtmsg_ifinfo_event net/core/rtnetlink.c:4392 [inline] rtmsg_ifinfo_event net/core/rtnetlink.c:4379 [inline] rtmsg_ifinfo+0x174/0x1a0 net/core/rtnetlink.c:4398 __dev_notify_flags+0x24e/0x2e0 net/core/dev.c:9003 dev_change_flags+0x10c/0x160 net/core/dev.c:9045 page last free pid 1 tgid 1 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1127 [inline] free_unref_page+0x661/0x1080 mm/page_alloc.c:2659 free_contig_range+0x133/0x3f0 mm/page_alloc.c:6635 destroy_args+0x802/0xa50 mm/debug_vm_pgtable.c:1017 debug_vm_pgtable+0x168e/0x31a0 mm/debug_vm_pgtable.c:1397 do_one_initcall+0x12b/0x700 init/main.c:1266 do_initcall_level init/main.c:1328 [inline] do_initcalls init/main.c:1344 [inline] do_basic_setup init/main.c:1363 [inline] kernel_init_freeable+0x5c7/0x900 init/main.c:1577 kernel_init+0x1c/0x2b0 init/main.c:1466 ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Memory state around the buggy address: ffff888057c0d000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888057c0d080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888057c0d100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888057c0d180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888057c0d200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ================================================================== BUG: KASAN: slab-use-after-free in sk_has_account include/net/sock.h:1516 [inline] BUG: KASAN: slab-use-after-free in __sk_rmem_schedule include/net/sock.h:1534 [inline] BUG: KASAN: slab-use-after-free in sk_rmem_schedule include/net/sock.h:1544 [inline] BUG: KASAN: slab-use-after-free in __sock_queue_rcv_skb+0x9dd/0xa80 net/core/sock.c:490 Read of size 8 at addr ffff888057c0d028 by task syz.2.1022/8595 CPU: 1 UID: 0 PID: 8595 Comm: syz.2.1022 Tainted: G B 6.13.0-rc7-syzkaller-00209-g9528d418de4d #0 Tainted: [B]=BAD_PAGE Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 12/27/2024 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0xc3/0x620 mm/kasan/report.c:489 kasan_report+0xd9/0x110 mm/kasan/report.c:602 sk_has_account include/net/sock.h:1516 [inline] __sk_rmem_schedule include/net/sock.h:1534 [inline] sk_rmem_schedule include/net/sock.h:1544 [inline] __sock_queue_rcv_skb+0x9dd/0xa80 net/core/sock.c:490 sock_queue_rcv_skb_reason+0xa2/0xe0 net/core/sock.c:525 sock_queue_rcv_skb include/net/sock.h:2399 [inline] mgmt_cmd_status+0x304/0x520 net/bluetooth/mgmt_util.c:156 cmd_status_rsp net/bluetooth/mgmt.c:1458 [inline] cmd_complete_rsp+0x165/0x1e0 net/bluetooth/mgmt.c:1478 mgmt_pending_foreach+0xe2/0x140 net/bluetooth/mgmt_util.c:259 __mgmt_power_off+0x12a/0x2c0 net/bluetooth/mgmt.c:9584 hci_dev_close_sync+0xcbb/0x11a0 net/bluetooth/hci_sync.c:5209 hci_dev_do_close+0x2e/0x90 net/bluetooth/hci_core.c:482 hci_dev_close+0x183/0x1e0 net/bluetooth/hci_core.c:507 hci_sock_ioctl+0x2b5/0x7d0 net/bluetooth/hci_sock.c:1128 sock_do_ioctl+0x119/0x280 net/socket.c:1209 sock_ioctl+0x228/0x6c0 net/socket.c:1328 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:906 [inline] __se_sys_ioctl fs/ioctl.c:892 [inline] __x64_sys_ioctl+0x193/0x200 fs/ioctl.c:892 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f034dd85d29 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f034ebe5038 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007f034df75fa0 RCX: 00007f034dd85d29 RDX: 0000000000000000 RSI: 00000000400448ca RDI: 0000000000000004 RBP: 00007f034de01b08 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f034df75fa0 R15: 00007ffc75ec7218 Allocated by task 6867: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 poison_kmalloc_redzone mm/kasan/common.c:377 [inline] __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:394 kasan_kmalloc include/linux/kasan.h:260 [inline] __do_kmalloc_node mm/slub.c:4298 [inline] __kmalloc_noprof+0x21c/0x510 mm/slub.c:4310 kmalloc_noprof include/linux/slab.h:905 [inline] sk_prot_alloc+0x1a8/0x2a0 net/core/sock.c:2168 sk_alloc+0x36/0xb90 net/core/sock.c:2221 bt_sock_alloc+0x3b/0x3a0 net/bluetooth/af_bluetooth.c:148 hci_sock_create+0xbc/0x1a0 net/bluetooth/hci_sock.c:2202 bt_sock_create+0x185/0x350 net/bluetooth/af_bluetooth.c:132 __sock_create+0x338/0x8d0 net/socket.c:1558 sock_create net/socket.c:1616 [inline] __sys_socket_create net/socket.c:1653 [inline] __sys_socket+0x14f/0x260 net/socket.c:1700 __do_sys_socket net/socket.c:1714 [inline] __se_sys_socket net/socket.c:1712 [inline] __x64_sys_socket+0x72/0xb0 net/socket.c:1712 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 8604: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 kasan_save_free_info+0x3b/0x60 mm/kasan/generic.c:582 poison_slab_object mm/kasan/common.c:247 [inline] __kasan_slab_free+0x51/0x70 mm/kasan/common.c:264 kasan_slab_free include/linux/kasan.h:233 [inline] slab_free_hook mm/slub.c:2353 [inline] slab_free mm/slub.c:4613 [inline] kfree+0x14f/0x4b0 mm/slub.c:4761 sk_prot_free net/core/sock.c:2204 [inline] __sk_destruct+0x5eb/0x720 net/core/sock.c:2296 sk_destruct+0xc2/0xf0 net/core/sock.c:2311 __sk_free+0xf4/0x3e0 net/core/sock.c:2322 sk_free+0x6a/0x90 net/core/sock.c:2333 sock_put include/net/sock.h:1910 [inline] mgmt_pending_free+0xc0/0xf0 net/bluetooth/mgmt_util.c:307 cmd_status_rsp net/bluetooth/mgmt.c:1459 [inline] cmd_complete_rsp+0x16d/0x1e0 net/bluetooth/mgmt.c:1478 mgmt_pending_foreach+0xe2/0x140 net/bluetooth/mgmt_util.c:259 mgmt_index_removed+0x145/0x300 net/bluetooth/mgmt.c:9517 hci_sock_bind+0xb57/0x14d0 net/bluetooth/hci_sock.c:1307 __sys_bind_socket net/socket.c:1827 [inline] __sys_bind_socket net/socket.c:1819 [inline] __sys_bind+0x216/0x260 net/socket.c:1858 __do_sys_bind net/socket.c:1863 [inline] __se_sys_bind net/socket.c:1861 [inline] __x64_sys_bind+0x72/0xb0 net/socket.c:1861 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff888057c0d000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 40 bytes inside of freed 2048-byte region [ffff888057c0d000, ffff888057c0d800) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888057c0f000 pfn:0x57c08 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000000240(workingset|head|node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000240 ffff88801b042000 ffffea0001631210 ffffea000172c010 raw: ffff888057c0f000 0000000000080003 00000001f5000000 0000000000000000 head: 00fff00000000240 ffff88801b042000 ffffea0001631210 ffffea000172c010 head: ffff888057c0f000 0000000000080003 00000001f5000000 0000000000000000 head: 00fff00000000003 ffffea00015f0201 ffffffffffffffff 0000000000000000 head: 0000000000000008 0000000000000000 00000000ffffffff 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 0xd2820(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5829, tgid 5829 (syz-executor), ts 99188561302, free_ts 32585661858 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1558 prep_new_page mm/page_alloc.c:1566 [inline] get_page_from_freelist+0xfce/0x2f80 mm/page_alloc.c:3476 __alloc_pages_noprof+0x223/0x25b0 mm/page_alloc.c:4753 alloc_pages_mpol_noprof+0x2c8/0x620 mm/mempolicy.c:2269 alloc_slab_page mm/slub.c:2423 [inline] allocate_slab mm/slub.c:2589 [inline] new_slab+0x2c9/0x410 mm/slub.c:2642 ___slab_alloc+0xd7d/0x17a0 mm/slub.c:3830 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3920 __slab_alloc_node mm/slub.c:3995 [inline] slab_alloc_node mm/slub.c:4156 [inline] __do_kmalloc_node mm/slub.c:4297 [inline] __kmalloc_node_track_caller_noprof+0x2f1/0x510 mm/slub.c:4317 kmalloc_reserve+0xef/0x2c0 net/core/skbuff.c:609 pskb_expand_head+0x243/0x1240 net/core/skbuff.c:2275 netlink_trim+0x1ef/0x250 net/netlink/af_netlink.c:1303 netlink_broadcast_filtered+0xc7/0xef0 net/netlink/af_netlink.c:1509 nlmsg_multicast_filtered include/net/netlink.h:1128 [inline] nlmsg_multicast include/net/netlink.h:1147 [inline] nlmsg_notify+0x9e/0x220 net/netlink/af_netlink.c:2585 rtnl_notify net/core/rtnetlink.c:943 [inline] rtmsg_ifinfo_send net/core/rtnetlink.c:4376 [inline] rtmsg_ifinfo_event net/core/rtnetlink.c:4392 [inline] rtmsg_ifinfo_event net/core/rtnetlink.c:4379 [inline] rtmsg_ifinfo+0x174/0x1a0 net/core/rtnetlink.c:4398 __dev_notify_flags+0x24e/0x2e0 net/core/dev.c:9003 dev_change_flags+0x10c/0x160 net/core/dev.c:9045 page last free pid 1 tgid 1 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1127 [inline] free_unref_page+0x661/0x1080 mm/page_alloc.c:2659 free_contig_range+0x133/0x3f0 mm/page_alloc.c:6635 destroy_args+0x802/0xa50 mm/debug_vm_pgtable.c:1017 debug_vm_pgtable+0x168e/0x31a0 mm/debug_vm_pgtable.c:1397 do_one_initcall+0x12b/0x700 init/main.c:1266 do_initcall_level init/main.c:1328 [inline] do_initcalls init/main.c:1344 [inline] do_basic_setup init/main.c:1363 [inline] kernel_init_freeable+0x5c7/0x900 init/main.c:1577 kernel_init+0x1c/0x2b0 init/main.c:1466 ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Memory state around the buggy address: ffff888057c0cf00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888057c0cf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888057c0d000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888057c0d080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888057c0d100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ================================================================== BUG: KASAN: slab-use-after-free in instrument_atomic_read_write include/linux/instrumented.h:96 [inline] BUG: KASAN: slab-use-after-free in atomic_add include/linux/atomic/atomic-instrumented.h:104 [inline] BUG: KASAN: slab-use-after-free in skb_set_owner_r include/net/sock.h:2344 [inline] BUG: KASAN: slab-use-after-free in __sock_queue_rcv_skb+0x2c8/0xa80 net/core/sock.c:496 Write of size 4 at addr ffff888057c0d140 by task syz.2.1022/8595 CPU: 0 UID: 0 PID: 8595 Comm: syz.2.1022 Tainted: G B 6.13.0-rc7-syzkaller-00209-g9528d418de4d #0 Tainted: [B]=BAD_PAGE Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 12/27/2024 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0xc3/0x620 mm/kasan/report.c:489 kasan_report+0xd9/0x110 mm/kasan/report.c:602 check_region_inline mm/kasan/generic.c:183 [inline] kasan_check_range+0xef/0x1a0 mm/kasan/generic.c:189 instrument_atomic_read_write include/linux/instrumented.h:96 [inline] atomic_add include/linux/atomic/atomic-instrumented.h:104 [inline] skb_set_owner_r include/net/sock.h:2344 [inline] __sock_queue_rcv_skb+0x2c8/0xa80 net/core/sock.c:496 sock_queue_rcv_skb_reason+0xa2/0xe0 net/core/sock.c:525 sock_queue_rcv_skb include/net/sock.h:2399 [inline] mgmt_cmd_status+0x304/0x520 net/bluetooth/mgmt_util.c:156 cmd_status_rsp net/bluetooth/mgmt.c:1458 [inline] cmd_complete_rsp+0x165/0x1e0 net/bluetooth/mgmt.c:1478 mgmt_pending_foreach+0xe2/0x140 net/bluetooth/mgmt_util.c:259 __mgmt_power_off+0x12a/0x2c0 net/bluetooth/mgmt.c:9584 hci_dev_close_sync+0xcbb/0x11a0 net/bluetooth/hci_sync.c:5209 hci_dev_do_close+0x2e/0x90 net/bluetooth/hci_core.c:482 hci_dev_close+0x183/0x1e0 net/bluetooth/hci_core.c:507 hci_sock_ioctl+0x2b5/0x7d0 net/bluetooth/hci_sock.c:1128 sock_do_ioctl+0x119/0x280 net/socket.c:1209 sock_ioctl+0x228/0x6c0 net/socket.c:1328 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:906 [inline] __se_sys_ioctl fs/ioctl.c:892 [inline] __x64_sys_ioctl+0x193/0x200 fs/ioctl.c:892 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f034dd85d29 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f034ebe5038 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007f034df75fa0 RCX: 00007f034dd85d29 RDX: 0000000000000000 RSI: 00000000400448ca RDI: 0000000000000004 RBP: 00007f034de01b08 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f034df75fa0 R15: 00007ffc75ec7218 Allocated by task 6867: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 poison_kmalloc_redzone mm/kasan/common.c:377 [inline] __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:394 kasan_kmalloc include/linux/kasan.h:260 [inline] __do_kmalloc_node mm/slub.c:4298 [inline] __kmalloc_noprof+0x21c/0x510 mm/slub.c:4310 kmalloc_noprof include/linux/slab.h:905 [inline] sk_prot_alloc+0x1a8/0x2a0 net/core/sock.c:2168 sk_alloc+0x36/0xb90 net/core/sock.c:2221 bt_sock_alloc+0x3b/0x3a0 net/bluetooth/af_bluetooth.c:148 hci_sock_create+0xbc/0x1a0 net/bluetooth/hci_sock.c:2202 bt_sock_create+0x185/0x350 net/bluetooth/af_bluetooth.c:132 __sock_create+0x338/0x8d0 net/socket.c:1558 sock_create net/socket.c:1616 [inline] __sys_socket_create net/socket.c:1653 [inline] __sys_socket+0x14f/0x260 net/socket.c:1700 __do_sys_socket net/socket.c:1714 [inline] __se_sys_socket net/socket.c:1712 [inline] __x64_sys_socket+0x72/0xb0 net/socket.c:1712 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 8604: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 kasan_save_free_info+0x3b/0x60 mm/kasan/generic.c:582 poison_slab_object mm/kasan/common.c:247 [inline] __kasan_slab_free+0x51/0x70 mm/kasan/common.c:264 kasan_slab_free include/linux/kasan.h:233 [inline] slab_free_hook mm/slub.c:2353 [inline] slab_free mm/slub.c:4613 [inline] kfree+0x14f/0x4b0 mm/slub.c:4761 sk_prot_free net/core/sock.c:2204 [inline] __sk_destruct+0x5eb/0x720 net/core/sock.c:2296 sk_destruct+0xc2/0xf0 net/core/sock.c:2311 __sk_free+0xf4/0x3e0 net/core/sock.c:2322 sk_free+0x6a/0x90 net/core/sock.c:2333 sock_put include/net/sock.h:1910 [inline] mgmt_pending_free+0xc0/0xf0 net/bluetooth/mgmt_util.c:307 cmd_status_rsp net/bluetooth/mgmt.c:1459 [inline] cmd_complete_rsp+0x16d/0x1e0 net/bluetooth/mgmt.c:1478 mgmt_pending_foreach+0xe2/0x140 net/bluetooth/mgmt_util.c:259 mgmt_index_removed+0x145/0x300 net/bluetooth/mgmt.c:9517 hci_sock_bind+0xb57/0x14d0 net/bluetooth/hci_sock.c:1307 __sys_bind_socket net/socket.c:1827 [inline] __sys_bind_socket net/socket.c:1819 [inline] __sys_bind+0x216/0x260 net/socket.c:1858 __do_sys_bind net/socket.c:1863 [inline] __se_sys_bind net/socket.c:1861 [inline] __x64_sys_bind+0x72/0xb0 net/socket.c:1861 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff888057c0d000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 320 bytes inside of freed 2048-byte region [ffff888057c0d000, ffff888057c0d800) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888057c0f000 pfn:0x57c08 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000000240(workingset|head|node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000240 ffff88801b042000 ffffea0001631210 ffffea000172c010 raw: ffff888057c0f000 0000000000080003 00000001f5000000 0000000000000000 head: 00fff00000000240 ffff88801b042000 ffffea0001631210 ffffea000172c010 head: ffff888057c0f000 0000000000080003 00000001f5000000 0000000000000000 head: 00fff00000000003 ffffea00015f0201 ffffffffffffffff 0000000000000000 head: 0000000000000008 0000000000000000 00000000ffffffff 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 0xd2820(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5829, tgid 5829 (syz-executor), ts 99188561302, free_ts 32585661858 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1558 prep_new_page mm/page_alloc.c:1566 [inline] get_page_from_freelist+0xfce/0x2f80 mm/page_alloc.c:3476 __alloc_pages_noprof+0x223/0x25b0 mm/page_alloc.c:4753 alloc_pages_mpol_noprof+0x2c8/0x620 mm/mempolicy.c:2269 alloc_slab_page mm/slub.c:2423 [inline] allocate_slab mm/slub.c:2589 [inline] new_slab+0x2c9/0x410 mm/slub.c:2642 ___slab_alloc+0xd7d/0x17a0 mm/slub.c:3830 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3920 __slab_alloc_node mm/slub.c:3995 [inline] slab_alloc_node mm/slub.c:4156 [inline] __do_kmalloc_node mm/slub.c:4297 [inline] __kmalloc_node_track_caller_noprof+0x2f1/0x510 mm/slub.c:4317 kmalloc_reserve+0xef/0x2c0 net/core/skbuff.c:609 pskb_expand_head+0x243/0x1240 net/core/skbuff.c:2275 netlink_trim+0x1ef/0x250 net/netlink/af_netlink.c:1303 netlink_broadcast_filtered+0xc7/0xef0 net/netlink/af_netlink.c:1509 nlmsg_multicast_filtered include/net/netlink.h:1128 [inline] nlmsg_multicast include/net/netlink.h:1147 [inline] nlmsg_notify+0x9e/0x220 net/netlink/af_netlink.c:2585 rtnl_notify net/core/rtnetlink.c:943 [inline] rtmsg_ifinfo_send net/core/rtnetlink.c:4376 [inline] rtmsg_ifinfo_event net/core/rtnetlink.c:4392 [inline] rtmsg_ifinfo_event net/core/rtnetlink.c:4379 [inline] rtmsg_ifinfo+0x174/0x1a0 net/core/rtnetlink.c:4398 __dev_notify_flags+0x24e/0x2e0 net/core/dev.c:9003 dev_change_flags+0x10c/0x160 net/core/dev.c:9045 page last free pid 1 tgid 1 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1127 [inline] free_unref_page+0x661/0x1080 mm/page_alloc.c:2659 free_contig_range+0x133/0x3f0 mm/page_alloc.c:6635 destroy_args+0x802/0xa50 mm/debug_vm_pgtable.c:1017 debug_vm_pgtable+0x168e/0x31a0 mm/debug_vm_pgtable.c:1397 do_one_initcall+0x12b/0x700 init/main.c:1266 do_initcall_level init/main.c:1328 [inline] do_initcalls init/main.c:1344 [inline] do_basic_setup init/main.c:1363 [inline] kernel_init_freeable+0x5c7/0x900 init/main.c:1577 kernel_init+0x1c/0x2b0 init/main.c:1466 ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Memory state around the buggy address: ffff888057c0d000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888057c0d080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888057c0d100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888057c0d180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888057c0d200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================