================================================================== BUG: KASAN: slab-out-of-bounds in copy_from_sockptr_offset include/linux/sockptr.h:49 [inline] BUG: KASAN: slab-out-of-bounds in copy_from_sockptr include/linux/sockptr.h:55 [inline] BUG: KASAN: slab-out-of-bounds in hci_sock_setsockopt+0x7b6/0x820 net/bluetooth/hci_sock.c:1925 Read of size 4 at addr ffff8881435d7783 by task syz.8.1592/5764 CPU: 1 PID: 5764 Comm: syz.8.1592 Tainted: G W syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/07/2026 Call Trace: __dump_stack+0x21/0x30 lib/dump_stack.c:88 dump_stack_lvl+0x110/0x170 lib/dump_stack.c:106 print_address_description+0x7f/0x2c0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:427 [inline] kasan_report+0x10f/0x150 mm/kasan/report.c:444 __asan_report_load_n_noabort+0xf/0x20 mm/kasan/report_generic.c:319 copy_from_sockptr_offset include/linux/sockptr.h:49 [inline] copy_from_sockptr include/linux/sockptr.h:55 [inline] hci_sock_setsockopt+0x7b6/0x820 net/bluetooth/hci_sock.c:1925 __sys_setsockopt+0x2e9/0x470 net/socket.c:2203 __do_sys_setsockopt net/socket.c:2214 [inline] __se_sys_setsockopt net/socket.c:2211 [inline] __x64_sys_setsockopt+0xbf/0xd0 net/socket.c:2211 x64_sys_call+0x982/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:55 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 RIP: 0033:0x7fdc3748d559 Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 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 e8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fdc35ee5028 EFLAGS: 00000246 ORIG_RAX: 0000000000000036 RAX: ffffffffffffffda RBX: 00007fdc37713fa0 RCX: 00007fdc3748d559 RDX: 0000000000000001 RSI: 0000000000000000 RDI: 0000000000000005 RBP: 00007fdc37524b20 R08: 0000000000000001 R09: 0000000000000000 R10: 0000200000000340 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fdc37714038 R14: 00007fdc37713fa0 R15: 00007ffd63ea2f08 Allocated by task 5764: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:45 [inline] set_alloc_info mm/kasan/common.c:433 [inline] ____kasan_kmalloc mm/kasan/common.c:512 [inline] __kasan_kmalloc+0xd4/0x100 mm/kasan/common.c:521 kasan_kmalloc include/linux/kasan.h:227 [inline] __kmalloc+0x13d/0x2c0 mm/slub.c:4436 kmalloc include/linux/slab.h:624 [inline] __cgroup_bpf_run_filter_setsockopt+0x8e7/0xaa0 kernel/bpf/cgroup.c:1511 __sys_setsockopt+0x40e/0x470 net/socket.c:2186 __do_sys_setsockopt net/socket.c:2214 [inline] __se_sys_setsockopt net/socket.c:2211 [inline] __x64_sys_setsockopt+0xbf/0xd0 net/socket.c:2211 x64_sys_call+0x982/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:55 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 The buggy address belongs to the object at ffff8881435d7780 which belongs to the cache kmalloc-8 of size 8 The buggy address is located 3 bytes inside of 8-byte region [ffff8881435d7780, ffff8881435d7788) The buggy address belongs to the page: page:ffffea00050d75c0 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1435d7 flags: 0x4000000000000200(slab|zone=1) raw: 4000000000000200 0000000000000000 dead000000000122 ffff888100042300 raw: 0000000000000000 0000000080660066 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x112cc0(GFP_USER|__GFP_NOWARN|__GFP_NORETRY), pid 1562, ts 349650787636, free_ts 349650731776 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0x192/0x1b0 mm/page_alloc.c:2610 prep_new_page+0x1c/0x110 mm/page_alloc.c:2616 get_page_from_freelist+0x2d42/0x2dd0 mm/page_alloc.c:4492 __alloc_pages+0x1a2/0x460 mm/page_alloc.c:5829 alloc_slab_page mm/slub.c:-1 [inline] allocate_slab mm/slub.c:1937 [inline] new_slab+0xa0/0x4d0 mm/slub.c:2000 ___slab_alloc+0x3ac/0x840 mm/slub.c:3033 __slab_alloc+0x49/0x90 mm/slub.c:3120 slab_alloc_node mm/slub.c:3211 [inline] slab_alloc mm/slub.c:3255 [inline] __kmalloc+0x16a/0x2c0 mm/slub.c:4432 __kmalloc_node include/linux/slab.h:487 [inline] kmalloc_node include/linux/slab.h:642 [inline] __vmalloc_area_node mm/vmalloc.c:2967 [inline] __vmalloc_node_range+0x384/0xad0 mm/vmalloc.c:3147 __vmalloc_node mm/vmalloc.c:3212 [inline] vzalloc+0x78/0x90 mm/vmalloc.c:3282 alloc_counters+0x65/0x540 net/ipv4/netfilter/ip_tables.c:800 copy_entries_to_user net/ipv6/netfilter/ip6_tables.c:844 [inline] get_entries net/ipv6/netfilter/ip6_tables.c:1044 [inline] do_ip6t_get_ctl+0xa2d/0x1120 net/ipv6/netfilter/ip6_tables.c:1681 nf_getsockopt+0x26d/0x290 net/netfilter/nf_sockopt.c:116 ipv6_getsockopt+0x1af3/0x21d0 net/ipv6/ipv6_sockglue.c:1489 tcp_getsockopt+0x1fc/0x23a0 net/ipv4/tcp.c:4315 sock_common_getsockopt+0x98/0xb0 net/core/sock.c:3448 page last free stack trace: reset_page_owner include/linux/page_owner.h:26 [inline] free_pages_prepare mm/page_alloc.c:1477 [inline] free_pcp_prepare mm/page_alloc.c:1549 [inline] free_unref_page_prepare+0x5fa/0x600 mm/page_alloc.c:3540 free_unref_page+0xae/0x540 mm/page_alloc.c:3622 free_the_page mm/page_alloc.c:808 [inline] __free_pages+0x6c/0x100 mm/page_alloc.c:5905 __vunmap+0x801/0x980 mm/vmalloc.c:2660 __vfree mm/vmalloc.c:2709 [inline] vfree+0x8b/0xc0 mm/vmalloc.c:2740 copy_entries_to_user net/ipv6/netfilter/ip6_tables.c:887 [inline] get_entries net/ipv6/netfilter/ip6_tables.c:1044 [inline] do_ip6t_get_ctl+0xe3a/0x1120 net/ipv6/netfilter/ip6_tables.c:1681 nf_getsockopt+0x26d/0x290 net/netfilter/nf_sockopt.c:116 ipv6_getsockopt+0x1af3/0x21d0 net/ipv6/ipv6_sockglue.c:1489 tcp_getsockopt+0x1fc/0x23a0 net/ipv4/tcp.c:4315 sock_common_getsockopt+0x98/0xb0 net/core/sock.c:3448 __sys_getsockopt+0x207/0x400 net/socket.c:2247 __do_sys_getsockopt net/socket.c:2262 [inline] __se_sys_getsockopt net/socket.c:2259 [inline] __x64_sys_getsockopt+0xbf/0xd0 net/socket.c:2259 x64_sys_call+0x6db/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:56 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 Memory state around the buggy address: ffff8881435d7680: fc fc fa fc fc fc fc fc fc fc fc fc fa fc fc fc ffff8881435d7700: fc fa fc fc fc fc fa fc fc fc fc fa fc fc fc fc >ffff8881435d7780: 01 fc fc fc fc fa fc fc fc fc fa fc fc fc fc fc ^ ffff8881435d7800: fc fc fc fc fc fc fc fc fc fa fc fc fc fc fa fc ffff8881435d7880: fc fc fc fa fc fc fc fc fa fc fc fc fc fa fc fc ==================================================================