================================================================== 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 l2cap_sock_setsockopt+0x1a2e/0x1e00 net/bluetooth/l2cap_sock.c:982 Read of size 4 at addr ffff8881171c9b1b by task syz.2.18/483 CPU: 1 PID: 483 Comm: syz.2.18 Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/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] l2cap_sock_setsockopt+0x1a2e/0x1e00 net/bluetooth/l2cap_sock.c:982 __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:0x7f8ef029aef9 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:00007f8ef00ff028 EFLAGS: 00000246 ORIG_RAX: 0000000000000036 RAX: ffffffffffffffda RBX: 00007f8ef0505fa0 RCX: 00007f8ef029aef9 RDX: 0000000000000008 RSI: 0000000000000112 RDI: 0000000000000004 RBP: 00007f8ef032fee0 R08: 0000000000000001 R09: 0000000000000000 R10: 0000200000000040 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f8ef0506038 R14: 00007f8ef0505fa0 R15: 00007ffe6a789e78 Allocated by task 483: 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 ffff8881171c9b18 which belongs to the cache kmalloc-8 of size 8 The buggy address is located 3 bytes inside of 8-byte region [ffff8881171c9b18, ffff8881171c9b20) The buggy address belongs to the page: page:ffffea00045c7240 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1171c9 flags: 0x4000000000000200(slab|zone=1) raw: 4000000000000200 0000000000000000 0000000100000001 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 0x12cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY), pid 106, ts 4230813357, free_ts 4229420123 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0x192/0x1b0 mm/page_alloc.c:2607 prep_new_page+0x1c/0x110 mm/page_alloc.c:2613 get_page_from_freelist+0x2c3a/0x2cd0 mm/page_alloc.c:4487 __alloc_pages+0x1a2/0x460 mm/page_alloc.c:5824 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 include/linux/slab.h:624 [inline] get_modalias+0xcf/0x3e0 drivers/firmware/dmi-id.c:117 sys_dmi_modalias_show+0x28/0xa0 drivers/firmware/dmi-id.c:138 dev_attr_show+0x56/0xd0 drivers/base/core.c:2120 sysfs_kf_seq_show+0x266/0x3d0 fs/sysfs/file.c:61 kernfs_seq_show+0x119/0x160 fs/kernfs/file.c:168 seq_read_iter+0x472/0xce0 fs/seq_file.c:230 kernfs_fop_read_iter+0x146/0x460 fs/kernfs/file.c:241 call_read_iter include/linux/fs.h:2206 [inline] new_sync_read fs/read_write.c:404 [inline] vfs_read+0x6c0/0xc20 fs/read_write.c:485 page last free stack trace: reset_page_owner include/linux/page_owner.h:26 [inline] free_pages_prepare mm/page_alloc.c:1474 [inline] free_pcp_prepare mm/page_alloc.c:1546 [inline] free_unref_page_prepare+0x5fa/0x600 mm/page_alloc.c:3536 free_unref_page+0xae/0x540 mm/page_alloc.c:3618 free_the_page mm/page_alloc.c:805 [inline] __free_pages+0x6c/0x100 mm/page_alloc.c:5900 free_pages+0x82/0x90 mm/page_alloc.c:5911 selinux_genfs_get_sid+0x20b/0x250 security/selinux/hooks.c:1382 inode_doinit_with_dentry+0x884/0xd90 security/selinux/hooks.c:1577 selinux_d_instantiate+0x27/0x40 security/selinux/hooks.c:6496 security_d_instantiate+0x9e/0xf0 security/security.c:2075 d_splice_alias+0x6d/0x390 fs/dcache.c:3073 kernfs_iop_lookup+0x2c2/0x310 fs/kernfs/dir.c:1175 __lookup_slow+0x2b8/0x410 fs/namei.c:1671 lookup_slow+0x57/0x70 fs/namei.c:1688 walk_component+0x326/0x460 fs/namei.c:1984 lookup_last fs/namei.c:2439 [inline] path_lookupat+0x155/0x430 fs/namei.c:2463 filename_lookup+0x21e/0x550 fs/namei.c:2492 user_path_at_empty+0x46/0x1c0 fs/namei.c:2891 Memory state around the buggy address: ffff8881171c9a00: 06 fc fc fc fc 05 fc fc fc fc 04 fc fc fc fc 00 ffff8881171c9a80: fc fc fc fc 06 fc fc fc fc 05 fc fc fc fc 07 fc >ffff8881171c9b00: fc fc fc 01 fc fc fc fc fa fc fc fc fc fa fc fc ^ ffff8881171c9b80: fc fc 00 fc fc fc fc fa fc fc fc fc 05 fc fc fc ffff8881171c9c00: fc 00 fc fc fc fc 06 fc fc fc fc fb fc fc fc fc ==================================================================