==================================================================
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 ffff8880306bb568 by task syz.2.1267/8564
CPU: 0 UID: 0 PID: 8564 Comm: syz.2.1267 Not tainted 6.11.0-rc6-syzkaller-00183-gb831f83e40a2 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:93 [inline]
dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:119
print_address_description mm/kasan/report.c:377 [inline]
print_report+0xc3/0x620 mm/kasan/report.c:488
kasan_report+0xd9/0x110 mm/kasan/report.c:601
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:1450 [inline]
cmd_complete_rsp+0x111/0x160 net/bluetooth/mgmt.c:1465
mgmt_pending_foreach+0xe2/0x140 net/bluetooth/mgmt_util.c:259
__mgmt_power_off+0x12f/0x2c0 net/bluetooth/mgmt.c:9469
hci_dev_close_sync+0xc33/0x1110 net/bluetooth/hci_sync.c:5191
hci_dev_do_close+0x2e/0x90 net/bluetooth/hci_core.c:483
hci_dev_close+0x183/0x1e0 net/bluetooth/hci_core.c:508
hci_sock_ioctl+0x28c/0x880 net/bluetooth/hci_sock.c:1128
sock_do_ioctl+0x119/0x280 net/socket.c:1222
sock_ioctl+0x22e/0x6c0 net/socket.c:1341
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:907 [inline]
__se_sys_ioctl fs/ioctl.c:893 [inline]
__x64_sys_ioctl+0x196/0x220 fs/ioctl.c:893
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:0x7ff696d7cef9
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:00007ff697ba4038 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007ff696f35f80 RCX: 00007ff696d7cef9
RDX: 0000000000000000 RSI: 00000000400448ca RDI: 0000000000000004
RBP: 00007ff696def01e R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 00007ff696f35f80 R15: 00007ffffd971dc8
</TASK>
Allocated by task 7507:
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:370 [inline]
__kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:387
kasan_kmalloc include/linux/kasan.h:211 [inline]
__do_kmalloc_node mm/slub.c:4162 [inline]
__kmalloc_noprof+0x1e8/0x400 mm/slub.c:4174
kmalloc_noprof include/linux/slab.h:685 [inline]
sk_prot_alloc+0x1a8/0x2a0 net/core/sock.c:2096
sk_alloc+0x36/0xb90 net/core/sock.c:2149
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+0x331/0x800 net/socket.c:1571
sock_create net/socket.c:1622 [inline]
__sys_socket_create net/socket.c:1659 [inline]
__sys_socket+0x14f/0x260 net/socket.c:1706
__do_sys_socket net/socket.c:1720 [inline]
__se_sys_socket net/socket.c:1718 [inline]
__x64_sys_socket+0x72/0xb0 net/socket.c:1718
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 8567:
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:579
poison_slab_object+0xf7/0x160 mm/kasan/common.c:240
__kasan_slab_free+0x32/0x50 mm/kasan/common.c:256
kasan_slab_free include/linux/kasan.h:184 [inline]
slab_free_hook mm/slub.c:2256 [inline]
slab_free mm/slub.c:4477 [inline]
kfree+0x12a/0x3b0 mm/slub.c:4598
sk_prot_free net/core/sock.c:2132 [inline]
__sk_destruct+0x5eb/0x720 net/core/sock.c:2224
sk_destruct+0xc2/0xf0 net/core/sock.c:2239
__sk_free+0xf4/0x3e0 net/core/sock.c:2250
sk_free+0x6a/0x90 net/core/sock.c:2261
sock_put include/net/sock.h:1884 [inline]
mgmt_pending_free+0xc0/0xf0 net/bluetooth/mgmt_util.c:307
cmd_status_rsp net/bluetooth/mgmt.c:1451 [inline]
cmd_complete_rsp+0x119/0x160 net/bluetooth/mgmt.c:1465
mgmt_pending_foreach+0xe2/0x140 net/bluetooth/mgmt_util.c:259
mgmt_index_removed+0x11f/0x2e0 net/bluetooth/mgmt.c:9402
hci_sock_bind+0xc49/0x16f0 net/bluetooth/hci_sock.c:1307
__sys_bind_socket net/socket.c:1833 [inline]
__sys_bind_socket net/socket.c:1825 [inline]
__sys_bind+0x1ee/0x220 net/socket.c:1857
__do_sys_bind net/socket.c:1865 [inline]
__se_sys_bind net/socket.c:1863 [inline]
__x64_sys_bind+0x72/0xb0 net/socket.c:1863
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 ffff8880306bb000
which belongs to the cache kmalloc-2k of size 2048
The buggy address is located 1384 bytes inside of
freed 2048-byte region [ffff8880306bb000, ffff8880306bb800)
The buggy address belongs to the physical page:
page: refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff8880306bc000 pfn:0x306b8
head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
anon flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff)
page_type: 0xfdffffff(slab)
raw: 00fff00000000040 ffff88801ac42000 0000000000000000 dead000000000001
raw: ffff8880306bc000 0000000000080006 00000001fdffffff 0000000000000000
head: 00fff00000000040 ffff88801ac42000 0000000000000000 dead000000000001
head: ffff8880306bc000 0000000000080006 00000001fdffffff 0000000000000000
head: 00fff00000000003 ffffea0000c1ae01 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 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5235, tgid 5235 (syz-executor), ts 113425910405, free_ts 113412156564
set_page_owner include/linux/page_owner.h:32 [inline]
post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1500
prep_new_page mm/page_alloc.c:1508 [inline]
get_page_from_freelist+0x1351/0x2e50 mm/page_alloc.c:3446
__alloc_pages_noprof+0x22b/0x2460 mm/page_alloc.c:4702
__alloc_pages_node_noprof include/linux/gfp.h:269 [inline]
alloc_pages_node_noprof include/linux/gfp.h:296 [inline]
alloc_slab_page+0x4e/0xf0 mm/slub.c:2325
allocate_slab mm/slub.c:2488 [inline]
new_slab+0x84/0x260 mm/slub.c:2541
___slab_alloc+0xdac/0x1870 mm/slub.c:3727
__slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3817
__slab_alloc_node mm/slub.c:3870 [inline]
slab_alloc_node mm/slub.c:4029 [inline]
__kmalloc_cache_noprof+0x2b4/0x300 mm/slub.c:4188
kmalloc_noprof include/linux/slab.h:681 [inline]
kzalloc_noprof include/linux/slab.h:807 [inline]
rxrpc_alloc_connection+0x8b/0x6e0 net/rxrpc/conn_object.c:62
rxrpc_prealloc_service_connection+0x26/0x380 net/rxrpc/conn_service.c:123
rxrpc_service_prealloc_one+0x2bf/0xee0 net/rxrpc/call_accept.c:87
rxrpc_kernel_charge_accept+0xd7/0x120 net/rxrpc/call_accept.c:475
afs_charge_preallocation+0xce/0x330 fs/afs/rxrpc.c:712
afs_open_socket+0x2b3/0x380 fs/afs/rxrpc.c:94
afs_net_init+0x95d/0xc60 fs/afs/main.c:123
ops_init+0xbc/0x650 net/core/net_namespace.c:139
page last free pid 5235 tgid 5235 stack trace:
reset_page_owner include/linux/page_owner.h:25 [inline]
free_pages_prepare mm/page_alloc.c:1101 [inline]
free_unref_page+0x64a/0xe40 mm/page_alloc.c:2619
__put_partials+0x14c/0x170 mm/slub.c:3055
qlink_free mm/kasan/quarantine.c:163 [inline]
qlist_free_all+0x4e/0x140 mm/kasan/quarantine.c:179
kasan_quarantine_reduce+0x192/0x1e0 mm/kasan/quarantine.c:286
__kasan_slab_alloc+0x69/0x90 mm/kasan/common.c:322
kasan_slab_alloc include/linux/kasan.h:201 [inline]
slab_post_alloc_hook mm/slub.c:3992 [inline]
slab_alloc_node mm/slub.c:4041 [inline]
__kmalloc_cache_noprof+0x11e/0x300 mm/slub.c:4188
kmalloc_noprof include/linux/slab.h:681 [inline]
kzalloc_noprof include/linux/slab.h:807 [inline]
ref_tracker_alloc+0x17c/0x5b0 lib/ref_tracker.c:203
__netdev_tracker_alloc include/linux/netdevice.h:4047 [inline]
netdev_hold include/linux/netdevice.h:4076 [inline]
netdev_hold include/linux/netdevice.h:4071 [inline]
register_netdevice+0x164b/0x1e90 net/core/dev.c:10464
register_netdev+0x2f/0x50 net/core/dev.c:10581
ip6gre_init_net+0x2fe/0x450 net/ipv6/ip6_gre.c:1628
ops_init+0xbc/0x650 net/core/net_namespace.c:139
setup_net+0x435/0xb40 net/core/net_namespace.c:343
copy_net_ns+0x2fb/0x700 net/core/net_namespace.c:508
create_new_namespaces+0x3ea/0xad0 kernel/nsproxy.c:110
unshare_nsproxy_namespaces+0xc0/0x1f0 kernel/nsproxy.c:228
ksys_unshare+0x419/0x970 kernel/fork.c:3309
Memory state around the buggy address:
ffff8880306bb400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff8880306bb480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff8880306bb500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff8880306bb580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff8880306bb600: 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:155
Read of size 8 at addr ffff8880306bb178 by task syz.2.1267/8564
CPU: 1 UID: 0 PID: 8564 Comm: syz.2.1267 Tainted: G B 6.11.0-rc6-syzkaller-00183-gb831f83e40a2 #0
Tainted: [B]=BAD_PAGE
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:93 [inline]
dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:119
print_address_description mm/kasan/report.c:377 [inline]
print_report+0xc3/0x620 mm/kasan/report.c:488
kasan_report+0xd9/0x110 mm/kasan/report.c:601
sk_filter_trim_cap+0x9bd/0xac0 net/core/filter.c:155
sk_filter include/linux/filter.h:1052 [inline]
sock_queue_rcv_skb_reason+0x30/0xe0 net/core/sock.c:521
sock_queue_rcv_skb include/net/sock.h:2376 [inline]
mgmt_cmd_status+0x304/0x520 net/bluetooth/mgmt_util.c:156
cmd_status_rsp net/bluetooth/mgmt.c:1450 [inline]
cmd_complete_rsp+0x111/0x160 net/bluetooth/mgmt.c:1465
mgmt_pending_foreach+0xe2/0x140 net/bluetooth/mgmt_util.c:259
__mgmt_power_off+0x12f/0x2c0 net/bluetooth/mgmt.c:9469
hci_dev_close_sync+0xc33/0x1110 net/bluetooth/hci_sync.c:5191
hci_dev_do_close+0x2e/0x90 net/bluetooth/hci_core.c:483
hci_dev_close+0x183/0x1e0 net/bluetooth/hci_core.c:508
hci_sock_ioctl+0x28c/0x880 net/bluetooth/hci_sock.c:1128
sock_do_ioctl+0x119/0x280 net/socket.c:1222
sock_ioctl+0x22e/0x6c0 net/socket.c:1341
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:907 [inline]
__se_sys_ioctl fs/ioctl.c:893 [inline]
__x64_sys_ioctl+0x196/0x220 fs/ioctl.c:893
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:0x7ff696d7cef9
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:00007ff697ba4038 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007ff696f35f80 RCX: 00007ff696d7cef9
RDX: 0000000000000000 RSI: 00000000400448ca RDI: 0000000000000004
RBP: 00007ff696def01e R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 00007ff696f35f80 R15: 00007ffffd971dc8
</TASK>
Allocated by task 7507:
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:370 [inline]
__kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:387
kasan_kmalloc include/linux/kasan.h:211 [inline]
__do_kmalloc_node mm/slub.c:4162 [inline]
__kmalloc_noprof+0x1e8/0x400 mm/slub.c:4174
kmalloc_noprof include/linux/slab.h:685 [inline]
sk_prot_alloc+0x1a8/0x2a0 net/core/sock.c:2096
sk_alloc+0x36/0xb90 net/core/sock.c:2149
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+0x331/0x800 net/socket.c:1571
sock_create net/socket.c:1622 [inline]
__sys_socket_create net/socket.c:1659 [inline]
__sys_socket+0x14f/0x260 net/socket.c:1706
__do_sys_socket net/socket.c:1720 [inline]
__se_sys_socket net/socket.c:1718 [inline]
__x64_sys_socket+0x72/0xb0 net/socket.c:1718
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 8567:
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:579
poison_slab_object+0xf7/0x160 mm/kasan/common.c:240
__kasan_slab_free+0x32/0x50 mm/kasan/common.c:256
kasan_slab_free include/linux/kasan.h:184 [inline]
slab_free_hook mm/slub.c:2256 [inline]
slab_free mm/slub.c:4477 [inline]
kfree+0x12a/0x3b0 mm/slub.c:4598
sk_prot_free net/core/sock.c:2132 [inline]
__sk_destruct+0x5eb/0x720 net/core/sock.c:2224
sk_destruct+0xc2/0xf0 net/core/sock.c:2239
__sk_free+0xf4/0x3e0 net/core/sock.c:2250
sk_free+0x6a/0x90 net/core/sock.c:2261
sock_put include/net/sock.h:1884 [inline]
mgmt_pending_free+0xc0/0xf0 net/bluetooth/mgmt_util.c:307
cmd_status_rsp net/bluetooth/mgmt.c:1451 [inline]
cmd_complete_rsp+0x119/0x160 net/bluetooth/mgmt.c:1465
mgmt_pending_foreach+0xe2/0x140 net/bluetooth/mgmt_util.c:259
mgmt_index_removed+0x11f/0x2e0 net/bluetooth/mgmt.c:9402
hci_sock_bind+0xc49/0x16f0 net/bluetooth/hci_sock.c:1307
__sys_bind_socket net/socket.c:1833 [inline]
__sys_bind_socket net/socket.c:1825 [inline]
__sys_bind+0x1ee/0x220 net/socket.c:1857
__do_sys_bind net/socket.c:1865 [inline]
__se_sys_bind net/socket.c:1863 [inline]
__x64_sys_bind+0x72/0xb0 net/socket.c:1863
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 ffff8880306bb000
which belongs to the cache kmalloc-2k of size 2048
The buggy address is located 376 bytes inside of
freed 2048-byte region [ffff8880306bb000, ffff8880306bb800)
The buggy address belongs to the physical page:
page: refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff8880306bc000 pfn:0x306b8
head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
anon flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff)
page_type: 0xfdffffff(slab)
raw: 00fff00000000040 ffff88801ac42000 0000000000000000 dead000000000001
raw: ffff8880306bc000 0000000000080006 00000001fdffffff 0000000000000000
head: 00fff00000000040 ffff88801ac42000 0000000000000000 dead000000000001
head: ffff8880306bc000 0000000000080006 00000001fdffffff 0000000000000000
head: 00fff00000000003 ffffea0000c1ae01 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 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5235, tgid 5235 (syz-executor), ts 113425910405, free_ts 113412156564
set_page_owner include/linux/page_owner.h:32 [inline]
post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1500
prep_new_page mm/page_alloc.c:1508 [inline]
get_page_from_freelist+0x1351/0x2e50 mm/page_alloc.c:3446
__alloc_pages_noprof+0x22b/0x2460 mm/page_alloc.c:4702
__alloc_pages_node_noprof include/linux/gfp.h:269 [inline]
alloc_pages_node_noprof include/linux/gfp.h:296 [inline]
alloc_slab_page+0x4e/0xf0 mm/slub.c:2325
allocate_slab mm/slub.c:2488 [inline]
new_slab+0x84/0x260 mm/slub.c:2541
___slab_alloc+0xdac/0x1870 mm/slub.c:3727
__slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3817
__slab_alloc_node mm/slub.c:3870 [inline]
slab_alloc_node mm/slub.c:4029 [inline]
__kmalloc_cache_noprof+0x2b4/0x300 mm/slub.c:4188
kmalloc_noprof include/linux/slab.h:681 [inline]
kzalloc_noprof include/linux/slab.h:807 [inline]
rxrpc_alloc_connection+0x8b/0x6e0 net/rxrpc/conn_object.c:62
rxrpc_prealloc_service_connection+0x26/0x380 net/rxrpc/conn_service.c:123
rxrpc_service_prealloc_one+0x2bf/0xee0 net/rxrpc/call_accept.c:87
rxrpc_kernel_charge_accept+0xd7/0x120 net/rxrpc/call_accept.c:475
afs_charge_preallocation+0xce/0x330 fs/afs/rxrpc.c:712
afs_open_socket+0x2b3/0x380 fs/afs/rxrpc.c:94
afs_net_init+0x95d/0xc60 fs/afs/main.c:123
ops_init+0xbc/0x650 net/core/net_namespace.c:139
page last free pid 5235 tgid 5235 stack trace:
reset_page_owner include/linux/page_owner.h:25 [inline]
free_pages_prepare mm/page_alloc.c:1101 [inline]
free_unref_page+0x64a/0xe40 mm/page_alloc.c:2619
__put_partials+0x14c/0x170 mm/slub.c:3055
qlink_free mm/kasan/quarantine.c:163 [inline]
qlist_free_all+0x4e/0x140 mm/kasan/quarantine.c:179
kasan_quarantine_reduce+0x192/0x1e0 mm/kasan/quarantine.c:286
__kasan_slab_alloc+0x69/0x90 mm/kasan/common.c:322
kasan_slab_alloc include/linux/kasan.h:201 [inline]
slab_post_alloc_hook mm/slub.c:3992 [inline]
slab_alloc_node mm/slub.c:4041 [inline]
__kmalloc_cache_noprof+0x11e/0x300 mm/slub.c:4188
kmalloc_noprof include/linux/slab.h:681 [inline]
kzalloc_noprof include/linux/slab.h:807 [inline]
ref_tracker_alloc+0x17c/0x5b0 lib/ref_tracker.c:203
__netdev_tracker_alloc include/linux/netdevice.h:4047 [inline]
netdev_hold include/linux/netdevice.h:4076 [inline]
netdev_hold include/linux/netdevice.h:4071 [inline]
register_netdevice+0x164b/0x1e90 net/core/dev.c:10464
register_netdev+0x2f/0x50 net/core/dev.c:10581
ip6gre_init_net+0x2fe/0x450 net/ipv6/ip6_gre.c:1628
ops_init+0xbc/0x650 net/core/net_namespace.c:139
setup_net+0x435/0xb40 net/core/net_namespace.c:343
copy_net_ns+0x2fb/0x700 net/core/net_namespace.c:508
create_new_namespaces+0x3ea/0xad0 kernel/nsproxy.c:110
unshare_nsproxy_namespaces+0xc0/0x1f0 kernel/nsproxy.c:228
ksys_unshare+0x419/0x970 kernel/fork.c:3309
Memory state around the buggy address:
ffff8880306bb000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff8880306bb080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff8880306bb100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff8880306bb180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff8880306bb200: 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:485
Read of size 4 at addr ffff8880306bb140 by task syz.2.1267/8564
CPU: 1 UID: 0 PID: 8564 Comm: syz.2.1267 Tainted: G B 6.11.0-rc6-syzkaller-00183-gb831f83e40a2 #0
Tainted: [B]=BAD_PAGE
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:93 [inline]
dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:119
print_address_description mm/kasan/report.c:377 [inline]
print_report+0xc3/0x620 mm/kasan/report.c:488
kasan_report+0xd9/0x110 mm/kasan/report.c:601
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:485
sock_queue_rcv_skb_reason+0xa2/0xe0 net/core/sock.c:526
sock_queue_rcv_skb include/net/sock.h:2376 [inline]
mgmt_cmd_status+0x304/0x520 net/bluetooth/mgmt_util.c:156
cmd_status_rsp net/bluetooth/mgmt.c:1450 [inline]
cmd_complete_rsp+0x111/0x160 net/bluetooth/mgmt.c:1465
mgmt_pending_foreach+0xe2/0x140 net/bluetooth/mgmt_util.c:259
__mgmt_power_off+0x12f/0x2c0 net/bluetooth/mgmt.c:9469
hci_dev_close_sync+0xc33/0x1110 net/bluetooth/hci_sync.c:5191
hci_dev_do_close+0x2e/0x90 net/bluetooth/hci_core.c:483
hci_dev_close+0x183/0x1e0 net/bluetooth/hci_core.c:508
hci_sock_ioctl+0x28c/0x880 net/bluetooth/hci_sock.c:1128
sock_do_ioctl+0x119/0x280 net/socket.c:1222
sock_ioctl+0x22e/0x6c0 net/socket.c:1341
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:907 [inline]
__se_sys_ioctl fs/ioctl.c:893 [inline]
__x64_sys_ioctl+0x196/0x220 fs/ioctl.c:893
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:0x7ff696d7cef9
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:00007ff697ba4038 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007ff696f35f80 RCX: 00007ff696d7cef9
RDX: 0000000000000000 RSI: 00000000400448ca RDI: 0000000000000004
RBP: 00007ff696def01e R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 00007ff696f35f80 R15: 00007ffffd971dc8
</TASK>
Allocated by task 7507:
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:370 [inline]
__kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:387
kasan_kmalloc include/linux/kasan.h:211 [inline]
__do_kmalloc_node mm/slub.c:4162 [inline]
__kmalloc_noprof+0x1e8/0x400 mm/slub.c:4174
kmalloc_noprof include/linux/slab.h:685 [inline]
sk_prot_alloc+0x1a8/0x2a0 net/core/sock.c:2096
sk_alloc+0x36/0xb90 net/core/sock.c:2149
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+0x331/0x800 net/socket.c:1571
sock_create net/socket.c:1622 [inline]
__sys_socket_create net/socket.c:1659 [inline]
__sys_socket+0x14f/0x260 net/socket.c:1706
__do_sys_socket net/socket.c:1720 [inline]
__se_sys_socket net/socket.c:1718 [inline]
__x64_sys_socket+0x72/0xb0 net/socket.c:1718
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 8567:
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:579
poison_slab_object+0xf7/0x160 mm/kasan/common.c:240
__kasan_slab_free+0x32/0x50 mm/kasan/common.c:256
kasan_slab_free include/linux/kasan.h:184 [inline]
slab_free_hook mm/slub.c:2256 [inline]
slab_free mm/slub.c:4477 [inline]
kfree+0x12a/0x3b0 mm/slub.c:4598
sk_prot_free net/core/sock.c:2132 [inline]
__sk_destruct+0x5eb/0x720 net/core/sock.c:2224
sk_destruct+0xc2/0xf0 net/core/sock.c:2239
__sk_free+0xf4/0x3e0 net/core/sock.c:2250
sk_free+0x6a/0x90 net/core/sock.c:2261
sock_put include/net/sock.h:1884 [inline]
mgmt_pending_free+0xc0/0xf0 net/bluetooth/mgmt_util.c:307
cmd_status_rsp net/bluetooth/mgmt.c:1451 [inline]
cmd_complete_rsp+0x119/0x160 net/bluetooth/mgmt.c:1465
mgmt_pending_foreach+0xe2/0x140 net/bluetooth/mgmt_util.c:259
mgmt_index_removed+0x11f/0x2e0 net/bluetooth/mgmt.c:9402
hci_sock_bind+0xc49/0x16f0 net/bluetooth/hci_sock.c:1307
__sys_bind_socket net/socket.c:1833 [inline]
__sys_bind_socket net/socket.c:1825 [inline]
__sys_bind+0x1ee/0x220 net/socket.c:1857
__do_sys_bind net/socket.c:1865 [inline]
__se_sys_bind net/socket.c:1863 [inline]
__x64_sys_bind+0x72/0xb0 net/socket.c:1863
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 ffff8880306bb000
which belongs to the cache kmalloc-2k of size 2048
The buggy address is located 320 bytes inside of
freed 2048-byte region [ffff8880306bb000, ffff8880306bb800)
The buggy address belongs to the physical page:
page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x306b8
head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
anon flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff)
page_type: 0xfdffffff(slab)
raw: 00fff00000000040 ffff88801ac42000 0000000000000000 dead000000000001
raw: 0000000000000000 0000000000080008 00000001fdffffff 0000000000000000
head: 00fff00000000040 ffff88801ac42000 0000000000000000 dead000000000001
head: 0000000000000000 0000000000080008 00000001fdffffff 0000000000000000
head: 00fff00000000003 ffffea0000c1ae01 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 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5235, tgid 5235 (syz-executor), ts 113425910405, free_ts 113412156564
set_page_owner include/linux/page_owner.h:32 [inline]
post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1500
prep_new_page mm/page_alloc.c:1508 [inline]
get_page_from_freelist+0x1351/0x2e50 mm/page_alloc.c:3446
__alloc_pages_noprof+0x22b/0x2460 mm/page_alloc.c:4702
__alloc_pages_node_noprof include/linux/gfp.h:269 [inline]
alloc_pages_node_noprof include/linux/gfp.h:296 [inline]
alloc_slab_page+0x4e/0xf0 mm/slub.c:2325
allocate_slab mm/slub.c:2488 [inline]
new_slab+0x84/0x260 mm/slub.c:2541
___slab_alloc+0xdac/0x1870 mm/slub.c:3727
__slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3817
__slab_alloc_node mm/slub.c:3870 [inline]
slab_alloc_node mm/slub.c:4029 [inline]
__kmalloc_cache_noprof+0x2b4/0x300 mm/slub.c:4188
kmalloc_noprof include/linux/slab.h:681 [inline]
kzalloc_noprof include/linux/slab.h:807 [inline]
rxrpc_alloc_connection+0x8b/0x6e0 net/rxrpc/conn_object.c:62
rxrpc_prealloc_service_connection+0x26/0x380 net/rxrpc/conn_service.c:123
rxrpc_service_prealloc_one+0x2bf/0xee0 net/rxrpc/call_accept.c:87
rxrpc_kernel_charge_accept+0xd7/0x120 net/rxrpc/call_accept.c:475
afs_charge_preallocation+0xce/0x330 fs/afs/rxrpc.c:712
afs_open_socket+0x2b3/0x380 fs/afs/rxrpc.c:94
afs_net_init+0x95d/0xc60 fs/afs/main.c:123
ops_init+0xbc/0x650 net/core/net_namespace.c:139
page last free pid 5235 tgid 5235 stack trace:
reset_page_owner include/linux/page_owner.h:25 [inline]
free_pages_prepare mm/page_alloc.c:1101 [inline]
free_unref_page+0x64a/0xe40 mm/page_alloc.c:2619
__put_partials+0x14c/0x170 mm/slub.c:3055
qlink_free mm/kasan/quarantine.c:163 [inline]
qlist_free_all+0x4e/0x140 mm/kasan/quarantine.c:179
kasan_quarantine_reduce+0x192/0x1e0 mm/kasan/quarantine.c:286
__kasan_slab_alloc+0x69/0x90 mm/kasan/common.c:322
kasan_slab_alloc include/linux/kasan.h:201 [inline]
slab_post_alloc_hook mm/slub.c:3992 [inline]
slab_alloc_node mm/slub.c:4041 [inline]
__kmalloc_cache_noprof+0x11e/0x300 mm/slub.c:4188
kmalloc_noprof include/linux/slab.h:681 [inline]
kzalloc_noprof include/linux/slab.h:807 [inline]
ref_tracker_alloc+0x17c/0x5b0 lib/ref_tracker.c:203
__netdev_tracker_alloc include/linux/netdevice.h:4047 [inline]
netdev_hold include/linux/netdevice.h:4076 [inline]
netdev_hold include/linux/netdevice.h:4071 [inline]
register_netdevice+0x164b/0x1e90 net/core/dev.c:10464
register_netdev+0x2f/0x50 net/core/dev.c:10581
ip6gre_init_net+0x2fe/0x450 net/ipv6/ip6_gre.c:1628
ops_init+0xbc/0x650 net/core/net_namespace.c:139
setup_net+0x435/0xb40 net/core/net_namespace.c:343
copy_net_ns+0x2fb/0x700 net/core/net_namespace.c:508
create_new_namespaces+0x3ea/0xad0 kernel/nsproxy.c:110
unshare_nsproxy_namespaces+0xc0/0x1f0 kernel/nsproxy.c:228
ksys_unshare+0x419/0x970 kernel/fork.c:3309
Memory state around the buggy address:
ffff8880306bb000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff8880306bb080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff8880306bb100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff8880306bb180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff8880306bb200: 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+0x730/0xa80 net/core/sock.c:485
Read of size 4 at addr ffff8880306bb140 by task syz.2.1267/8564
CPU: 0 UID: 0 PID: 8564 Comm: syz.2.1267 Tainted: G B 6.11.0-rc6-syzkaller-00183-gb831f83e40a2 #0
Tainted: [B]=BAD_PAGE
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:93 [inline]
dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:119
print_address_description mm/kasan/report.c:377 [inline]
print_report+0xc3/0x620 mm/kasan/report.c:488
kasan_report+0xd9/0x110 mm/kasan/report.c:601
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+0x730/0xa80 net/core/sock.c:485
sock_queue_rcv_skb_reason+0xa2/0xe0 net/core/sock.c:526
sock_queue_rcv_skb include/net/sock.h:2376 [inline]
mgmt_cmd_status+0x304/0x520 net/bluetooth/mgmt_util.c:156
cmd_status_rsp net/bluetooth/mgmt.c:1450 [inline]
cmd_complete_rsp+0x111/0x160 net/bluetooth/mgmt.c:1465
mgmt_pending_foreach+0xe2/0x140 net/bluetooth/mgmt_util.c:259
__mgmt_power_off+0x12f/0x2c0 net/bluetooth/mgmt.c:9469
hci_dev_close_sync+0xc33/0x1110 net/bluetooth/hci_sync.c:5191
hci_dev_do_close+0x2e/0x90 net/bluetooth/hci_core.c:483
hci_dev_close+0x183/0x1e0 net/bluetooth/hci_core.c:508
hci_sock_ioctl+0x28c/0x880 net/bluetooth/hci_sock.c:1128
sock_do_ioctl+0x119/0x280 net/socket.c:1222
sock_ioctl+0x22e/0x6c0 net/socket.c:1341
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:907 [inline]
__se_sys_ioctl fs/ioctl.c:893 [inline]
__x64_sys_ioctl+0x196/0x220 fs/ioctl.c:893
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:0x7ff696d7cef9
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:00007ff697ba4038 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007ff696f35f80 RCX: 00007ff696d7cef9
RDX: 0000000000000000 RSI: 00000000400448ca RDI: 0000000000000004
RBP: 00007ff696def01e R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 00007ff696f35f80 R15: 00007ffffd971dc8
</TASK>
Allocated by task 7507:
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:370 [inline]
__kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:387
kasan_kmalloc include/linux/kasan.h:211 [inline]
__do_kmalloc_node mm/slub.c:4162 [inline]
__kmalloc_noprof+0x1e8/0x400 mm/slub.c:4174
kmalloc_noprof include/linux/slab.h:685 [inline]
sk_prot_alloc+0x1a8/0x2a0 net/core/sock.c:2096
sk_alloc+0x36/0xb90 net/core/sock.c:2149
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+0x331/0x800 net/socket.c:1571
sock_create net/socket.c:1622 [inline]
__sys_socket_create net/socket.c:1659 [inline]
__sys_socket+0x14f/0x260 net/socket.c:1706
__do_sys_socket net/socket.c:1720 [inline]
__se_sys_socket net/socket.c:1718 [inline]
__x64_sys_socket+0x72/0xb0 net/socket.c:1718
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 8567:
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:579
poison_slab_object+0xf7/0x160 mm/kasan/common.c:240
__kasan_slab_free+0x32/0x50 mm/kasan/common.c:256
kasan_slab_free include/linux/kasan.h:184 [inline]
slab_free_hook mm/slub.c:2256 [inline]
slab_free mm/slub.c:4477 [inline]
kfree+0x12a/0x3b0 mm/slub.c:4598
sk_prot_free net/core/sock.c:2132 [inline]
__sk_destruct+0x5eb/0x720 net/core/sock.c:2224
sk_destruct+0xc2/0xf0 net/core/sock.c:2239
__sk_free+0xf4/0x3e0 net/core/sock.c:2250
sk_free+0x6a/0x90 net/core/sock.c:2261
sock_put include/net/sock.h:1884 [inline]
mgmt_pending_free+0xc0/0xf0 net/bluetooth/mgmt_util.c:307
cmd_status_rsp net/bluetooth/mgmt.c:1451 [inline]
cmd_complete_rsp+0x119/0x160 net/bluetooth/mgmt.c:1465
mgmt_pending_foreach+0xe2/0x140 net/bluetooth/mgmt_util.c:259
mgmt_index_removed+0x11f/0x2e0 net/bluetooth/mgmt.c:9402
hci_sock_bind+0xc49/0x16f0 net/bluetooth/hci_sock.c:1307
__sys_bind_socket net/socket.c:1833 [inline]
__sys_bind_socket net/socket.c:1825 [inline]
__sys_bind+0x1ee/0x220 net/socket.c:1857
__do_sys_bind net/socket.c:1865 [inline]
__se_sys_bind net/socket.c:1863 [inline]
__x64_sys_bind+0x72/0xb0 net/socket.c:1863
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 ffff8880306bb000
which belongs to the cache kmalloc-2k of size 2048
The buggy address is located 320 bytes inside of
freed 2048-byte region [ffff8880306bb000, ffff8880306bb800)
The buggy address belongs to the physical page:
page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x306b8
head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
anon flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff)
page_type: 0xfdffffff(slab)
raw: 00fff00000000040 ffff88801ac42000 0000000000000000 dead000000000001
raw: 0000000000000000 0000000000080008 00000001fdffffff 0000000000000000
head: 00fff00000000040 ffff88801ac42000 0000000000000000 dead000000000001
head: 0000000000000000 0000000000080008 00000001fdffffff 0000000000000000
head: 00fff00000000003 ffffea0000c1ae01 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 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5235, tgid 5235 (syz-executor), ts 113425910405, free_ts 113412156564
set_page_owner include/linux/page_owner.h:32 [inline]
post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1500
prep_new_page mm/page_alloc.c:1508 [inline]
get_page_from_freelist+0x1351/0x2e50 mm/page_alloc.c:3446
__alloc_pages_noprof+0x22b/0x2460 mm/page_alloc.c:4702
__alloc_pages_node_noprof include/linux/gfp.h:269 [inline]
alloc_pages_node_noprof include/linux/gfp.h:296 [inline]
alloc_slab_page+0x4e/0xf0 mm/slub.c:2325
allocate_slab mm/slub.c:2488 [inline]
new_slab+0x84/0x260 mm/slub.c:2541
___slab_alloc+0xdac/0x1870 mm/slub.c:3727
__slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3817
__slab_alloc_node mm/slub.c:3870 [inline]
slab_alloc_node mm/slub.c:4029 [inline]
__kmalloc_cache_noprof+0x2b4/0x300 mm/slub.c:4188
kmalloc_noprof include/linux/slab.h:681 [inline]
kzalloc_noprof include/linux/slab.h:807 [inline]
rxrpc_alloc_connection+0x8b/0x6e0 net/rxrpc/conn_object.c:62
rxrpc_prealloc_service_connection+0x26/0x380 net/rxrpc/conn_service.c:123
rxrpc_service_prealloc_one+0x2bf/0xee0 net/rxrpc/call_accept.c:87
rxrpc_kernel_charge_accept+0xd7/0x120 net/rxrpc/call_accept.c:475
afs_charge_preallocation+0xce/0x330 fs/afs/rxrpc.c:712
afs_open_socket+0x2b3/0x380 fs/afs/rxrpc.c:94
afs_net_init+0x95d/0xc60 fs/afs/main.c:123
ops_init+0xbc/0x650 net/core/net_namespace.c:139
page last free pid 5235 tgid 5235 stack trace:
reset_page_owner include/linux/page_owner.h:25 [inline]
free_pages_prepare mm/page_alloc.c:1101 [inline]
free_unref_page+0x64a/0xe40 mm/page_alloc.c:2619
__put_partials+0x14c/0x170 mm/slub.c:3055
qlink_free mm/kasan/quarantine.c:163 [inline]
qlist_free_all+0x4e/0x140 mm/kasan/quarantine.c:179
kasan_quarantine_reduce+0x192/0x1e0 mm/kasan/quarantine.c:286
__kasan_slab_alloc+0x69/0x90 mm/kasan/common.c:322
kasan_slab_alloc include/linux/kasan.h:201 [inline]
slab_post_alloc_hook mm/slub.c:3992 [inline]
slab_alloc_node mm/slub.c:4041 [inline]
__kmalloc_cache_noprof+0x11e/0x300 mm/slub.c:4188
kmalloc_noprof include/linux/slab.h:681 [inline]
kzalloc_noprof include/linux/slab.h:807 [inline]
ref_tracker_alloc+0x17c/0x5b0 lib/ref_tracker.c:203
__netdev_tracker_alloc include/linux/netdevice.h:4047 [inline]
netdev_hold include/linux/netdevice.h:4076 [inline]
netdev_hold include/linux/netdevice.h:4071 [inline]
register_netdevice+0x164b/0x1e90 net/core/dev.c:10464
register_netdev+0x2f/0x50 net/core/dev.c:10581
ip6gre_init_net+0x2fe/0x450 net/ipv6/ip6_gre.c:1628
ops_init+0xbc/0x650 net/core/net_namespace.c:139
setup_net+0x435/0xb40 net/core/net_namespace.c:343
copy_net_ns+0x2fb/0x700 net/core/net_namespace.c:508
create_new_namespaces+0x3ea/0xad0 kernel/nsproxy.c:110
unshare_nsproxy_namespaces+0xc0/0x1f0 kernel/nsproxy.c:228
ksys_unshare+0x419/0x970 kernel/fork.c:3309
Memory state around the buggy address:
ffff8880306bb000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff8880306bb080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff8880306bb100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff8880306bb180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff8880306bb200: 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+0x73a/0xa80 net/core/sock.c:485
Read of size 4 at addr ffff8880306bb174 by task syz.2.1267/8564
CPU: 0 UID: 0 PID: 8564 Comm: syz.2.1267 Tainted: G B 6.11.0-rc6-syzkaller-00183-gb831f83e40a2 #0
Tainted: [B]=BAD_PAGE
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:93 [inline]
dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:119
print_address_description mm/kasan/report.c:377 [inline]
print_report+0xc3/0x620 mm/kasan/report.c:488
kasan_report+0xd9/0x110 mm/kasan/report.c:601
__sock_queue_rcv_skb+0x73a/0xa80 net/core/sock.c:485
sock_queue_rcv_skb_reason+0xa2/0xe0 net/core/sock.c:526
sock_queue_rcv_skb include/net/sock.h:2376 [inline]
mgmt_cmd_status+0x304/0x520 net/bluetooth/mgmt_util.c:156
cmd_status_rsp net/bluetooth/mgmt.c:1450 [inline]
cmd_complete_rsp+0x111/0x160 net/bluetooth/mgmt.c:1465
mgmt_pending_foreach+0xe2/0x140 net/bluetooth/mgmt_util.c:259
__mgmt_power_off+0x12f/0x2c0 net/bluetooth/mgmt.c:9469
hci_dev_close_sync+0xc33/0x1110 net/bluetooth/hci_sync.c:5191
hci_dev_do_close+0x2e/0x90 net/bluetooth/hci_core.c:483
hci_dev_close+0x183/0x1e0 net/bluetooth/hci_core.c:508
hci_sock_ioctl+0x28c/0x880 net/bluetooth/hci_sock.c:1128
sock_do_ioctl+0x119/0x280 net/socket.c:1222
sock_ioctl+0x22e/0x6c0 net/socket.c:1341
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:907 [inline]
__se_sys_ioctl fs/ioctl.c:893 [inline]
__x64_sys_ioctl+0x196/0x220 fs/ioctl.c:893
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:0x7ff696d7cef9
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:00007ff697ba4038 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007ff696f35f80 RCX: 00007ff696d7cef9
RDX: 0000000000000000 RSI: 00000000400448ca RDI: 0000000000000004
RBP: 00007ff696def01e R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 00007ff696f35f80 R15: 00007ffffd971dc8
</TASK>
Allocated by task 7507:
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:370 [inline]
__kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:387
kasan_kmalloc include/linux/kasan.h:211 [inline]
__do_kmalloc_node mm/slub.c:4162 [inline]
__kmalloc_noprof+0x1e8/0x400 mm/slub.c:4174
kmalloc_noprof include/linux/slab.h:685 [inline]
sk_prot_alloc+0x1a8/0x2a0 net/core/sock.c:2096
sk_alloc+0x36/0xb90 net/core/sock.c:2149
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+0x331/0x800 net/socket.c:1571
sock_create net/socket.c:1622 [inline]
__sys_socket_create net/socket.c:1659 [inline]
__sys_socket+0x14f/0x260 net/socket.c:1706
__do_sys_socket net/socket.c:1720 [inline]
__se_sys_socket net/socket.c:1718 [inline]
__x64_sys_socket+0x72/0xb0 net/socket.c:1718
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 8567:
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:579
poison_slab_object+0xf7/0x160 mm/kasan/common.c:240
__kasan_slab_free+0x32/0x50 mm/kasan/common.c:256
kasan_slab_free include/linux/kasan.h:184 [inline]
slab_free_hook mm/slub.c:2256 [inline]
slab_free mm/slub.c:4477 [inline]
kfree+0x12a/0x3b0 mm/slub.c:4598
sk_prot_free net/core/sock.c:2132 [inline]
__sk_destruct+0x5eb/0x720 net/core/sock.c:2224
sk_destruct+0xc2/0xf0 net/core/sock.c:2239
__sk_free+0xf4/0x3e0 net/core/sock.c:2250
sk_free+0x6a/0x90 net/core/sock.c:2261
sock_put include/net/sock.h:1884 [inline]
mgmt_pending_free+0xc0/0xf0 net/bluetooth/mgmt_util.c:307
cmd_status_rsp net/bluetooth/mgmt.c:1451 [inline]
cmd_complete_rsp+0x119/0x160 net/bluetooth/mgmt.c:1465
mgmt_pending_foreach+0xe2/0x140 net/bluetooth/mgmt_util.c:259
mgmt_index_removed+0x11f/0x2e0 net/bluetooth/mgmt.c:9402
hci_sock_bind+0xc49/0x16f0 net/bluetooth/hci_sock.c:1307
__sys_bind_socket net/socket.c:1833 [inline]
__sys_bind_socket net/socket.c:1825 [inline]
__sys_bind+0x1ee/0x220 net/socket.c:1857
__do_sys_bind net/socket.c:1865 [inline]
__se_sys_bind net/socket.c:1863 [inline]
__x64_sys_bind+0x72/0xb0 net/socket.c:1863
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 ffff8880306bb000
which belongs to the cache kmalloc-2k of size 2048
The buggy address is located 372 bytes inside of
freed 2048-byte region [ffff8880306bb000, ffff8880306bb800)
The buggy address belongs to the physical page:
page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x306b8
head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
anon flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff)
page_type: 0xfdffffff(slab)
raw: 00fff00000000040 ffff88801ac42000 0000000000000000 dead000000000001
raw: 0000000000000000 0000000000080008 00000001fdffffff 0000000000000000
head: 00fff00000000040 ffff88801ac42000 0000000000000000 dead000000000001
head: 0000000000000000 0000000000080008 00000001fdffffff 0000000000000000
head: 00fff00000000003 ffffea0000c1ae01 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 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5235, tgid 5235 (syz-executor), ts 113425910405, free_ts 113412156564
set_page_owner include/linux/page_owner.h:32 [inline]
post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1500
prep_new_page mm/page_alloc.c:1508 [inline]
get_page_from_freelist+0x1351/0x2e50 mm/page_alloc.c:3446
__alloc_pages_noprof+0x22b/0x2460 mm/page_alloc.c:4702
__alloc_pages_node_noprof include/linux/gfp.h:269 [inline]
alloc_pages_node_noprof include/linux/gfp.h:296 [inline]
alloc_slab_page+0x4e/0xf0 mm/slub.c:2325
allocate_slab mm/slub.c:2488 [inline]
new_slab+0x84/0x260 mm/slub.c:2541
___slab_alloc+0xdac/0x1870 mm/slub.c:3727
__slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3817
__slab_alloc_node mm/slub.c:3870 [inline]
slab_alloc_node mm/slub.c:4029 [inline]
__kmalloc_cache_noprof+0x2b4/0x300 mm/slub.c:4188
kmalloc_noprof include/linux/slab.h:681 [inline]
kzalloc_noprof include/linux/slab.h:807 [inline]
rxrpc_alloc_connection+0x8b/0x6e0 net/rxrpc/conn_object.c:62
rxrpc_prealloc_service_connection+0x26/0x380 net/rxrpc/conn_service.c:123
rxrpc_service_prealloc_one+0x2bf/0xee0 net/rxrpc/call_accept.c:87
rxrpc_kernel_charge_accept+0xd7/0x120 net/rxrpc/call_accept.c:475
afs_charge_preallocation+0xce/0x330 fs/afs/rxrpc.c:712
afs_open_socket+0x2b3/0x380 fs/afs/rxrpc.c:94
afs_net_init+0x95d/0xc60 fs/afs/main.c:123
ops_init+0xbc/0x650 net/core/net_namespace.c:139
page last free pid 5235 tgid 5235 stack trace:
reset_page_owner include/linux/page_owner.h:25 [inline]
free_pages_prepare mm/page_alloc.c:1101 [inline]
free_unref_page+0x64a/0xe40 mm/page_alloc.c:2619
__put_partials+0x14c/0x170 mm/slub.c:3055
qlink_free mm/kasan/quarantine.c:163 [inline]
qlist_free_all+0x4e/0x140 mm/kasan/quarantine.c:179
kasan_quarantine_reduce+0x192/0x1e0 mm/kasan/quarantine.c:286
__kasan_slab_alloc+0x69/0x90 mm/kasan/common.c:322
kasan_slab_alloc include/linux/kasan.h:201 [inline]
slab_post_alloc_hook mm/slub.c:3992 [inline]
slab_alloc_node mm/slub.c:4041 [inline]
__kmalloc_cache_noprof+0x11e/0x300 mm/slub.c:4188
kmalloc_noprof include/linux/slab.h:681 [inline]
kzalloc_noprof include/linux/slab.h:807 [inline]
ref_tracker_alloc+0x17c/0x5b0 lib/ref_tracker.c:203
__netdev_tracker_alloc include/linux/netdevice.h:4047 [inline]
netdev_hold include/linux/netdevice.h:4076 [inline]
netdev_hold include/linux/netdevice.h:4071 [inline]
register_netdevice+0x164b/0x1e90 net/core/dev.c:10464
register_netdev+0x2f/0x50 net/core/dev.c:10581
ip6gre_init_net+0x2fe/0x450 net/ipv6/ip6_gre.c:1628
ops_init+0xbc/0x650 net/core/net_namespace.c:139
setup_net+0x435/0xb40 net/core/net_namespace.c:343
copy_net_ns+0x2fb/0x700 net/core/net_namespace.c:508
create_new_namespaces+0x3ea/0xad0 kernel/nsproxy.c:110
unshare_nsproxy_namespaces+0xc0/0x1f0 kernel/nsproxy.c:228
ksys_unshare+0x419/0x970 kernel/fork.c:3309
Memory state around the buggy address:
ffff8880306bb000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff8880306bb080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff8880306bb100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff8880306bb180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff8880306bb200: 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:1506 [inline]
BUG: KASAN: slab-use-after-free in sk_rmem_schedule include/net/sock.h:1524 [inline]
BUG: KASAN: slab-use-after-free in __sock_queue_rcv_skb+0x9ec/0xa80 net/core/sock.c:491
Read of size 8 at addr ffff8880306bb028 by task syz.2.1267/8564
CPU: 1 UID: 0 PID: 8564 Comm: syz.2.1267 Tainted: G B 6.11.0-rc6-syzkaller-00183-gb831f83e40a2 #0
Tainted: [B]=BAD_PAGE
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:93 [inline]
dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:119
print_address_description mm/kasan/report.c:377 [inline]
print_report+0xc3/0x620 mm/kasan/report.c:488
kasan_report+0xd9/0x110 mm/kasan/report.c:601
sk_has_account include/net/sock.h:1506 [inline]
sk_rmem_schedule include/net/sock.h:1524 [inline]
__sock_queue_rcv_skb+0x9ec/0xa80 net/core/sock.c:491
sock_queue_rcv_skb_reason+0xa2/0xe0 net/core/sock.c:526
sock_queue_rcv_skb include/net/sock.h:2376 [inline]
mgmt_cmd_status+0x304/0x520 net/bluetooth/mgmt_util.c:156
cmd_status_rsp net/bluetooth/mgmt.c:1450 [inline]
cmd_complete_rsp+0x111/0x160 net/bluetooth/mgmt.c:1465
mgmt_pending_foreach+0xe2/0x140 net/bluetooth/mgmt_util.c:259
__mgmt_power_off+0x12f/0x2c0 net/bluetooth/mgmt.c:9469
hci_dev_close_sync+0xc33/0x1110 net/bluetooth/hci_sync.c:5191
hci_dev_do_close+0x2e/0x90 net/bluetooth/hci_core.c:483
hci_dev_close+0x183/0x1e0 net/bluetooth/hci_core.c:508
hci_sock_ioctl+0x28c/0x880 net/bluetooth/hci_sock.c:1128
sock_do_ioctl+0x119/0x280 net/socket.c:1222
sock_ioctl+0x22e/0x6c0 net/socket.c:1341
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:907 [inline]
__se_sys_ioctl fs/ioctl.c:893 [inline]
__x64_sys_ioctl+0x196/0x220 fs/ioctl.c:893
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:0x7ff696d7cef9
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:00007ff697ba4038 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007ff696f35f80 RCX: 00007ff696d7cef9
RDX: 0000000000000000 RSI: 00000000400448ca RDI: 0000000000000004
RBP: 00007ff696def01e R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 00007ff696f35f80 R15: 00007ffffd971dc8
</TASK>
Allocated by task 7507:
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:370 [inline]
__kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:387
kasan_kmalloc include/linux/kasan.h:211 [inline]
__do_kmalloc_node mm/slub.c:4162 [inline]
__kmalloc_noprof+0x1e8/0x400 mm/slub.c:4174
kmalloc_noprof include/linux/slab.h:685 [inline]
sk_prot_alloc+0x1a8/0x2a0 net/core/sock.c:2096
sk_alloc+0x36/0xb90 net/core/sock.c:2149
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+0x331/0x800 net/socket.c:1571
sock_create net/socket.c:1622 [inline]
__sys_socket_create net/socket.c:1659 [inline]
__sys_socket+0x14f/0x260 net/socket.c:1706
__do_sys_socket net/socket.c:1720 [inline]
__se_sys_socket net/socket.c:1718 [inline]
__x64_sys_socket+0x72/0xb0 net/socket.c:1718
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 8567:
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:579
poison_slab_object+0xf7/0x160 mm/kasan/common.c:240
__kasan_slab_free+0x32/0x50 mm/kasan/common.c:256
kasan_slab_free include/linux/kasan.h:184 [inline]
slab_free_hook mm/slub.c:2256 [inline]
slab_free mm/slub.c:4477 [inline]
kfree+0x12a/0x3b0 mm/slub.c:4598
sk_prot_free net/core/sock.c:2132 [inline]
__sk_destruct+0x5eb/0x720 net/core/sock.c:2224
sk_destruct+0xc2/0xf0 net/core/sock.c:2239
__sk_free+0xf4/0x3e0 net/core/sock.c:2250
sk_free+0x6a/0x90 net/core/sock.c:2261
sock_put include/net/sock.h:1884 [inline]
mgmt_pending_free+0xc0/0xf0 net/bluetooth/mgmt_util.c:307
cmd_status_rsp net/bluetooth/mgmt.c:1451 [inline]
cmd_complete_rsp+0x119/0x160 net/bluetooth/mgmt.c:1465
mgmt_pending_foreach+0xe2/0x140 net/bluetooth/mgmt_util.c:259
mgmt_index_removed+0x11f/0x2e0 net/bluetooth/mgmt.c:9402
hci_sock_bind+0xc49/0x16f0 net/bluetooth/hci_sock.c:1307
__sys_bind_socket net/socket.c:1833 [inline]
__sys_bind_socket net/socket.c:1825 [inline]
__sys_bind+0x1ee/0x220 net/socket.c:1857
__do_sys_bind net/socket.c:1865 [inline]
__se_sys_bind net/socket.c:1863 [inline]
__x64_sys_bind+0x72/0xb0 net/socket.c:1863
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 ffff8880306bb000
which belongs to the cache kmalloc-2k of size 2048
The buggy address is located 40 bytes inside of
freed 2048-byte region [ffff8880306bb000, ffff8880306bb800)
The buggy address belongs to the physical page:
page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x306b8
head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
anon flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff)
page_type: 0xfdffffff(slab)
raw: 00fff00000000040 ffff88801ac42000 0000000000000000 dead000000000001
raw: 0000000000000000 0000000000080008 00000001fdffffff 0000000000000000
head: 00fff00000000040 ffff88801ac42000 0000000000000000 dead000000000001
head: 0000000000000000 0000000000080008 00000001fdffffff 0000000000000000
head: 00fff00000000003 ffffea0000c1ae01 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 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5235, tgid 5235 (syz-executor), ts 113425910405, free_ts 113412156564
set_page_owner include/linux/page_owner.h:32 [inline]
post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1500
prep_new_page mm/page_alloc.c:1508 [inline]
get_page_from_freelist+0x1351/0x2e50 mm/page_alloc.c:3446
__alloc_pages_noprof+0x22b/0x2460 mm/page_alloc.c:4702
__alloc_pages_node_noprof include/linux/gfp.h:269 [inline]
alloc_pages_node_noprof include/linux/gfp.h:296 [inline]
alloc_slab_page+0x4e/0xf0 mm/slub.c:2325
allocate_slab mm/slub.c:2488 [inline]
new_slab+0x84/0x260 mm/slub.c:2541
___slab_alloc+0xdac/0x1870 mm/slub.c:3727
__slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3817
__slab_alloc_node mm/slub.c:3870 [inline]
slab_alloc_node mm/slub.c:4029 [inline]
__kmalloc_cache_noprof+0x2b4/0x300 mm/slub.c:4188
kmalloc_noprof include/linux/slab.h:681 [inline]
kzalloc_noprof include/linux/slab.h:807 [inline]
rxrpc_alloc_connection+0x8b/0x6e0 net/rxrpc/conn_object.c:62
rxrpc_prealloc_service_connection+0x26/0x380 net/rxrpc/conn_service.c:123
rxrpc_service_prealloc_one+0x2bf/0xee0 net/rxrpc/call_accept.c:87
rxrpc_kernel_charge_accept+0xd7/0x120 net/rxrpc/call_accept.c:475
afs_charge_preallocation+0xce/0x330 fs/afs/rxrpc.c:712
afs_open_socket+0x2b3/0x380 fs/afs/rxrpc.c:94
afs_net_init+0x95d/0xc60 fs/afs/main.c:123
ops_init+0xbc/0x650 net/core/net_namespace.c:139
page last free pid 5235 tgid 5235 stack trace:
reset_page_owner include/linux/page_owner.h:25 [inline]
free_pages_prepare mm/page_alloc.c:1101 [inline]
free_unref_page+0x64a/0xe40 mm/page_alloc.c:2619
__put_partials+0x14c/0x170 mm/slub.c:3055
qlink_free mm/kasan/quarantine.c:163 [inline]
qlist_free_all+0x4e/0x140 mm/kasan/quarantine.c:179
kasan_quarantine_reduce+0x192/0x1e0 mm/kasan/quarantine.c:286
__kasan_slab_alloc+0x69/0x90 mm/kasan/common.c:322
kasan_slab_alloc include/linux/kasan.h:201 [inline]
slab_post_alloc_hook mm/slub.c:3992 [inline]
slab_alloc_node mm/slub.c:4041 [inline]
__kmalloc_cache_noprof+0x11e/0x300 mm/slub.c:4188
kmalloc_noprof include/linux/slab.h:681 [inline]
kzalloc_noprof include/linux/slab.h:807 [inline]
ref_tracker_alloc+0x17c/0x5b0 lib/ref_tracker.c:203
__netdev_tracker_alloc include/linux/netdevice.h:4047 [inline]
netdev_hold include/linux/netdevice.h:4076 [inline]
netdev_hold include/linux/netdevice.h:4071 [inline]
register_netdevice+0x164b/0x1e90 net/core/dev.c:10464
register_netdev+0x2f/0x50 net/core/dev.c:10581
ip6gre_init_net+0x2fe/0x450 net/ipv6/ip6_gre.c:1628
ops_init+0xbc/0x650 net/core/net_namespace.c:139
setup_net+0x435/0xb40 net/core/net_namespace.c:343
copy_net_ns+0x2fb/0x700 net/core/net_namespace.c:508
create_new_namespaces+0x3ea/0xad0 kernel/nsproxy.c:110
unshare_nsproxy_namespaces+0xc0/0x1f0 kernel/nsproxy.c:228
ksys_unshare+0x419/0x970 kernel/fork.c:3309
Memory state around the buggy address:
ffff8880306baf00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff8880306baf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff8880306bb000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff8880306bb080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff8880306bb100: 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:2321 [inline]
BUG: KASAN: slab-use-after-free in __sock_queue_rcv_skb+0x295/0xa80 net/core/sock.c:497
Write of size 4 at addr ffff8880306bb140 by task syz.2.1267/8564
CPU: 1 UID: 0 PID: 8564 Comm: syz.2.1267 Tainted: G B 6.11.0-rc6-syzkaller-00183-gb831f83e40a2 #0
Tainted: [B]=BAD_PAGE
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:93 [inline]
dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:119
print_address_description mm/kasan/report.c:377 [inline]
print_report+0xc3/0x620 mm/kasan/report.c:488
kasan_report+0xd9/0x110 mm/kasan/report.c:601
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:2321 [inline]
__sock_queue_rcv_skb+0x295/0xa80 net/core/sock.c:497
sock_queue_rcv_skb_reason+0xa2/0xe0 net/core/sock.c:526
sock_queue_rcv_skb include/net/sock.h:2376 [inline]
mgmt_cmd_status+0x304/0x520 net/bluetooth/mgmt_util.c:156
cmd_status_rsp net/bluetooth/mgmt.c:1450 [inline]
cmd_complete_rsp+0x111/0x160 net/bluetooth/mgmt.c:1465
mgmt_pending_foreach+0xe2/0x140 net/bluetooth/mgmt_util.c:259
__mgmt_power_off+0x12f/0x2c0 net/bluetooth/mgmt.c:9469
hci_dev_close_sync+0xc33/0x1110 net/bluetooth/hci_sync.c:5191
hci_dev_do_close+0x2e/0x90 net/bluetooth/hci_core.c:483
hci_dev_close+0x183/0x1e0 net/bluetooth/hci_core.c:508
hci_sock_ioctl+0x28c/0x880 net/bluetooth/hci_sock.c:1128
sock_do_ioctl+0x119/0x280 net/socket.c:1222
sock_ioctl+0x22e/0x6c0 net/socket.c:1341
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:907 [inline]
__se_sys_ioctl fs/ioctl.c:893 [inline]
__x64_sys_ioctl+0x196/0x220 fs/ioctl.c:893
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:0x7ff696d7cef9
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:00007ff697ba4038 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007ff696f35f80 RCX: 00007ff696d7cef9
RDX: 0000000000000000 RSI: 00000000400448ca RDI: 0000000000000004
RBP: 00007ff696def01e R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 00007ff696f35f80 R15: 00007ffffd971dc8
</TASK>
Allocated by task 7507:
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:370 [inline]
__kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:387
kasan_kmalloc include/linux/kasan.h:211 [inline]
__do_kmalloc_node mm/slub.c:4162 [inline]
__kmalloc_noprof+0x1e8/0x400 mm/slub.c:4174
kmalloc_noprof include/linux/slab.h:685 [inline]
sk_prot_alloc+0x1a8/0x2a0 net/core/sock.c:2096
sk_alloc+0x36/0xb90 net/core/sock.c:2149
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+0x331/0x800 net/socket.c:1571
sock_create net/socket.c:1622 [inline]
__sys_socket_create net/socket.c:1659 [inline]
__sys_socket+0x14f/0x260 net/socket.c:1706
__do_sys_socket net/socket.c:1720 [inline]
__se_sys_socket net/socket.c:1718 [inline]
__x64_sys_socket+0x72/0xb0 net/socket.c:1718
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 8567:
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:579
poison_slab_object+0xf7/0x160 mm/kasan/common.c:240
__kasan_slab_free+0x32/0x50 mm/kasan/common.c:256
kasan_slab_free include/linux/kasan.h:184 [inline]
slab_free_hook mm/slub.c:2256 [inline]
slab_free mm/slub.c:4477 [inline]
kfree+0x12a/0x3b0 mm/slub.c:4598
sk_prot_free net/core/sock.c:2132 [inline]
__sk_destruct+0x5eb/0x720 net/core/sock.c:2224
sk_destruct+0xc2/0xf0 net/core/sock.c:2239
__sk_free+0xf4/0x3e0 net/core/sock.c:2250
sk_free+0x6a/0x90 net/core/sock.c:2261
sock_put include/net/sock.h:1884 [inline]
mgmt_pending_free+0xc0/0xf0 net/bluetooth/mgmt_util.c:307
cmd_status_rsp net/bluetooth/mgmt.c:1451 [inline]
cmd_complete_rsp+0x119/0x160 net/bluetooth/mgmt.c:1465
mgmt_pending_foreach+0xe2/0x140 net/bluetooth/mgmt_util.c:259
mgmt_index_removed+0x11f/0x2e0 net/bluetooth/mgmt.c:9402
hci_sock_bind+0xc49/0x16f0 net/bluetooth/hci_sock.c:1307
__sys_bind_socket net/socket.c:1833 [inline]
__sys_bind_socket net/socket.c:1825 [inline]
__sys_bind+0x1ee/0x220 net/socket.c:1857
__do_sys_bind net/socket.c:1865 [inline]
__se_sys_bind net/socket.c:1863 [inline]
__x64_sys_bind+0x72/0xb0 net/socket.c:1863
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 ffff8880306bb000
which belongs to the cache kmalloc-2k of size 2048
The buggy address is located 320 bytes inside of
freed 2048-byte region [ffff8880306bb000, ffff8880306bb800)
The buggy address belongs to the physical page:
page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x306b8
head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
anon flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff)
page_type: 0xfdffffff(slab)
raw: 00fff00000000040 ffff88801ac42000 0000000000000000 dead000000000001
raw: 0000000000000000 0000000000080008 00000001fdffffff 0000000000000000
head: 00fff00000000040 ffff88801ac42000 0000000000000000 dead000000000001
head: 0000000000000000 0000000000080008 00000001fdffffff 0000000000000000
head: 00fff00000000003 ffffea0000c1ae01 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 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5235, tgid 5235 (syz-executor), ts 113425910405, free_ts 113412156564
set_page_owner include/linux/page_owner.h:32 [inline]
post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1500
prep_new_page mm/page_alloc.c:1508 [inline]
get_page_from_freelist+0x1351/0x2e50 mm/page_alloc.c:3446
__alloc_pages_noprof+0x22b/0x2460 mm/page_alloc.c:4702
__alloc_pages_node_noprof include/linux/gfp.h:269 [inline]
alloc_pages_node_noprof include/linux/gfp.h:296 [inline]
alloc_slab_page+0x4e/0xf0 mm/slub.c:2325
allocate_slab mm/slub.c:2488 [inline]
new_slab+0x84/0x260 mm/slub.c:2541
___slab_alloc+0xdac/0x1870 mm/slub.c:3727
__slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3817
__slab_alloc_node mm/slub.c:3870 [inline]
slab_alloc_node mm/slub.c:4029 [inline]
__kmalloc_cache_noprof+0x2b4/0x300 mm/slub.c:4188
kmalloc_noprof include/linux/slab.h:681 [inline]
kzalloc_noprof include/linux/slab.h:807 [inline]
rxrpc_alloc_connection+0x8b/0x6e0 net/rxrpc/conn_object.c:62
rxrpc_prealloc_service_connection+0x26/0x380 net/rxrpc/conn_service.c:123
rxrpc_service_prealloc_one+0x2bf/0xee0 net/rxrpc/call_accept.c:87
rxrpc_kernel_charge_accept+0xd7/0x120 net/rxrpc/call_accept.c:475
afs_charge_preallocation+0xce/0x330 fs/afs/rxrpc.c:712
afs_open_socket+0x2b3/0x380 fs/afs/rxrpc.c:94
afs_net_init+0x95d/0xc60 fs/afs/main.c:123
ops_init+0xbc/0x650 net/core/net_namespace.c:139
page last free pid 5235 tgid 5235 stack trace:
reset_page_owner include/linux/page_owner.h:25 [inline]
free_pages_prepare mm/page_alloc.c:1101 [inline]
free_unref_page+0x64a/0xe40 mm/page_alloc.c:2619
__put_partials+0x14c/0x170 mm/slub.c:3055
qlink_free mm/kasan/quarantine.c:163 [inline]
qlist_free_all+0x4e/0x140 mm/kasan/quarantine.c:179
kasan_quarantine_reduce+0x192/0x1e0 mm/kasan/quarantine.c:286
__kasan_slab_alloc+0x69/0x90 mm/kasan/common.c:322
kasan_slab_alloc include/linux/kasan.h:201 [inline]
slab_post_alloc_hook mm/slub.c:3992 [inline]
slab_alloc_node mm/slub.c:4041 [inline]
__kmalloc_cache_noprof+0x11e/0x300 mm/slub.c:4188
kmalloc_noprof include/linux/slab.h:681 [inline]
kzalloc_noprof include/linux/slab.h:807 [inline]
ref_tracker_alloc+0x17c/0x5b0 lib/ref_tracker.c:203
__netdev_tracker_alloc include/linux/netdevice.h:4047 [inline]
netdev_hold include/linux/netdevice.h:4076 [inline]
netdev_hold include/linux/netdevice.h:4071 [inline]
register_netdevice+0x164b/0x1e90 net/core/dev.c:10464
register_netdev+0x2f/0x50 net/core/dev.c:10581
ip6gre_init_net+0x2fe/0x450 net/ipv6/ip6_gre.c:1628
ops_init+0xbc/0x650 net/core/net_namespace.c:139
setup_net+0x435/0xb40 net/core/net_namespace.c:343
copy_net_ns+0x2fb/0x700 net/core/net_namespace.c:508
create_new_namespaces+0x3ea/0xad0 kernel/nsproxy.c:110
unshare_nsproxy_namespaces+0xc0/0x1f0 kernel/nsproxy.c:228
ksys_unshare+0x419/0x970 kernel/fork.c:3309
Memory state around the buggy address:
ffff8880306bb000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff8880306bb080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff8880306bb100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff8880306bb180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff8880306bb200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================