================================================================== BUG: KASAN: slab-out-of-bounds in nla_ok include/net/netlink.h:1230 [inline] BUG: KASAN: slab-out-of-bounds in nla_find+0xb2/0xe0 lib/nlattr.c:746 Read of size 2 at addr ffff888104eafca0 by task syz-executor.0/1863 CPU: 0 PID: 1863 Comm: syz-executor.0 Not tainted 6.7.0-rc4-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/17/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x3d/0x60 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:364 [inline] print_report+0xc4/0x620 mm/kasan/report.c:475 kasan_report+0xda/0x110 mm/kasan/report.c:588 nla_ok include/net/netlink.h:1230 [inline] nla_find+0xb2/0xe0 lib/nlattr.c:746 nla_find_nested include/net/netlink.h:1260 [inline] ____bpf_skb_get_nlattr_nest net/core/filter.c:209 [inline] bpf_skb_get_nlattr_nest+0x101/0x1d0 net/core/filter.c:192 ___bpf_prog_run+0x3910/0x9c10 kernel/bpf/core.c:1962 __bpf_prog_run32+0xb1/0xf0 kernel/bpf/core.c:2201 bpf_dispatcher_nop_func include/linux/bpf.h:1196 [inline] __bpf_prog_run include/linux/filter.h:651 [inline] bpf_prog_run include/linux/filter.h:658 [inline] __bpf_prog_run_save_cb include/linux/filter.h:781 [inline] bpf_prog_run_save_cb include/linux/filter.h:795 [inline] sk_filter_trim_cap+0x241/0x670 net/core/filter.c:157 sk_filter include/linux/filter.h:903 [inline] unix_dgram_sendmsg+0x858/0x1850 net/unix/af_unix.c:2008 sock_sendmsg_nosec net/socket.c:730 [inline] __sock_sendmsg+0xbc/0x150 net/socket.c:745 sock_write_iter+0x225/0x390 net/socket.c:1158 call_write_iter include/linux/fs.h:2020 [inline] do_iter_readv_writev+0x1a8/0x2f0 fs/read_write.c:735 do_iter_write+0x132/0x7a0 fs/read_write.c:860 vfs_writev+0x1e0/0x4e0 fs/read_write.c:933 do_writev+0x200/0x2b0 fs/read_write.c:976 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0x40/0xe0 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x63/0x6b RIP: 0033:0x7f4878cb7ba9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 00 00 90 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 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f487883a0c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000014 RAX: ffffffffffffffda RBX: 00007f4878dd6f80 RCX: 00007f4878cb7ba9 RDX: 0000000000000004 RSI: 0000000020000140 RDI: 0000000000000003 RBP: 00007f4878d0347a R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000006 R14: 00007f4878dd6f80 R15: 00007ffe36e33378 Allocated by task 811: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:374 [inline] __kasan_kmalloc+0xa2/0xb0 mm/kasan/common.c:383 kasan_kmalloc include/linux/kasan.h:198 [inline] __do_kmalloc_node mm/slab_common.c:1007 [inline] __kmalloc+0x60/0x160 mm/slab_common.c:1020 kmalloc_array include/linux/slab.h:637 [inline] kcalloc include/linux/slab.h:668 [inline] alloc_pipe_info+0x15e/0x460 fs/pipe.c:818 get_pipe_inode fs/pipe.c:892 [inline] create_pipe_files+0x82/0x730 fs/pipe.c:924 __do_pipe_flags fs/pipe.c:973 [inline] do_pipe2+0x93/0x170 fs/pipe.c:1024 __do_sys_pipe2 fs/pipe.c:1042 [inline] __se_sys_pipe2 fs/pipe.c:1040 [inline] __x64_sys_pipe2+0x4f/0x70 fs/pipe.c:1040 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0x40/0xe0 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x63/0x6b The buggy address belongs to the object at ffff888104eaf800 which belongs to the cache kmalloc-cg-1k of size 1024 The buggy address is located 160 bytes to the right of allocated 1024-byte region [ffff888104eaf800, ffff888104eafc00) The buggy address belongs to the physical page: page:ffffea000413aa00 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888104eab800 pfn:0x104ea8 head:ffffea000413aa00 order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0 memcg:ffff8881033ce001 anon flags: 0x200000000000840(slab|head|node=0|zone=2) page_type: 0xffffffff() raw: 0200000000000840 ffff88810004f280 0000000000000000 0000000000000001 raw: ffff888104eab800 000000008010000b 00000001ffffffff ffff8881033ce001 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 757, tgid 757 (dhcpcd), ts 5848167548, free_ts 5333610876 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x27f/0x2f0 mm/page_alloc.c:1544 prep_new_page mm/page_alloc.c:1551 [inline] get_page_from_freelist+0xeb8/0x36a0 mm/page_alloc.c:3319 __alloc_pages+0x342/0x5e0 mm/page_alloc.c:4575 alloc_pages_mpol+0xbf/0x370 mm/mempolicy.c:2133 alloc_slab_page mm/slub.c:1870 [inline] allocate_slab+0x24b/0x360 mm/slub.c:2017 new_slab mm/slub.c:2070 [inline] ___slab_alloc+0x8ce/0x10e0 mm/slub.c:3223 __slab_alloc.constprop.0+0x4d/0x90 mm/slub.c:3322 __slab_alloc_node mm/slub.c:3375 [inline] slab_alloc_node mm/slub.c:3468 [inline] __kmem_cache_alloc_node+0x150/0x350 mm/slub.c:3517 __do_kmalloc_node mm/slab_common.c:1006 [inline] __kmalloc_node_track_caller+0x50/0x160 mm/slab_common.c:1027 kmalloc_reserve+0xbb/0x1e0 net/core/skbuff.c:582 __alloc_skb+0xd4/0x270 net/core/skbuff.c:651 alloc_skb include/linux/skbuff.h:1298 [inline] alloc_skb_with_frags+0x83/0x620 net/core/skbuff.c:6331 sock_alloc_send_pskb+0x6a3/0x840 net/core/sock.c:2780 unix_dgram_sendmsg+0x36a/0x1850 net/unix/af_unix.c:1974 sock_sendmsg_nosec net/socket.c:730 [inline] __sock_sendmsg+0xbc/0x150 net/socket.c:745 sock_write_iter+0x225/0x390 net/socket.c:1158 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1144 [inline] free_unref_page_prepare+0x562/0xbd0 mm/page_alloc.c:2354 free_unref_page+0x33/0x2a0 mm/page_alloc.c:2494 qlink_free mm/kasan/quarantine.c:168 [inline] qlist_free_all+0x6a/0x170 mm/kasan/quarantine.c:187 kasan_quarantine_reduce+0x180/0x1b0 mm/kasan/quarantine.c:294 __kasan_slab_alloc+0x65/0x90 mm/kasan/common.c:305 kasan_slab_alloc include/linux/kasan.h:188 [inline] slab_post_alloc_hook mm/slab.h:763 [inline] slab_alloc_node mm/slub.c:3478 [inline] __kmem_cache_alloc_node+0x1bd/0x350 mm/slub.c:3517 __do_kmalloc_node mm/slab_common.c:1006 [inline] __kmalloc+0x4f/0x160 mm/slab_common.c:1020 kmalloc include/linux/slab.h:604 [inline] tomoyo_add_entry security/tomoyo/common.c:2023 [inline] tomoyo_supervisor+0xa94/0xc40 security/tomoyo/common.c:2095 tomoyo_audit_path_log security/tomoyo/file.c:168 [inline] tomoyo_path_permission security/tomoyo/file.c:587 [inline] tomoyo_path_permission+0x23d/0x330 security/tomoyo/file.c:573 tomoyo_path_perm+0x2af/0x350 security/tomoyo/file.c:838 security_inode_getattr+0xc6/0x110 security/security.c:2153 vfs_getattr fs/stat.c:173 [inline] vfs_fstat+0x36/0x80 fs/stat.c:198 __do_sys_newfstatat+0x85/0xe0 fs/stat.c:463 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0x40/0xe0 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x63/0x6b Memory state around the buggy address: ffff888104eafb80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888104eafc00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888104eafc80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff888104eafd00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888104eafd80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================