================================================================== BUG: KASAN: slab-out-of-bounds in get_max_inline_xattr_value_size+0x369/0x510 fs/ext4/inline.c:62 Read of size 4 at addr ffff8880770e705c by task syz-executor.1/6977 CPU: 1 PID: 6977 Comm: syz-executor.1 Not tainted 6.3.0-rc3-syzkaller-00338-gda8e7da11e4b #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/02/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e7/0x2d0 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:319 [inline] print_report+0x163/0x540 mm/kasan/report.c:430 kasan_report+0x176/0x1b0 mm/kasan/report.c:536 get_max_inline_xattr_value_size+0x369/0x510 fs/ext4/inline.c:62 ext4_get_max_inline_size+0x141/0x200 fs/ext4/inline.c:113 ext4_prepare_inline_data+0x87/0x1d0 fs/ext4/inline.c:393 ext4_da_write_inline_data_begin+0x208/0xe40 fs/ext4/inline.c:931 ext4_da_write_begin+0x4da/0x960 fs/ext4/inode.c:3064 generic_perform_write+0x300/0x5e0 mm/filemap.c:3926 ext4_buffered_write_iter+0x122/0x3a0 fs/ext4/file.c:289 ext4_file_write_iter+0x1d6/0x1930 do_iter_write+0x6ea/0xc50 fs/read_write.c:861 iter_file_splice_write+0x843/0xfe0 fs/splice.c:778 do_splice_from fs/splice.c:856 [inline] direct_splice_actor+0xe7/0x1c0 fs/splice.c:1022 splice_direct_to_actor+0x4c4/0xbd0 fs/splice.c:977 do_splice_direct+0x283/0x3d0 fs/splice.c:1065 do_sendfile+0x620/0xff0 fs/read_write.c:1255 __do_sys_sendfile64 fs/read_write.c:1323 [inline] __se_sys_sendfile64+0x17c/0x1e0 fs/read_write.c:1309 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f1fb688c0f9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 19 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 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f1fb7690168 EFLAGS: 00000246 ORIG_RAX: 0000000000000028 RAX: ffffffffffffffda RBX: 00007f1fb69abf80 RCX: 00007f1fb688c0f9 RDX: 0000000000000000 RSI: 0000000000000005 RDI: 0000000000000006 RBP: 00007f1fb68e7b39 R08: 0000000000000000 R09: 0000000000000000 R10: 000000000001ffff R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffe3c751a5f R14: 00007f1fb7690300 R15: 0000000000022000 Allocated by task 5130: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4f/0x70 mm/kasan/common.c:52 __kasan_slab_alloc+0x66/0x70 mm/kasan/common.c:328 kasan_slab_alloc include/linux/kasan.h:186 [inline] slab_post_alloc_hook+0x68/0x3a0 mm/slab.h:769 slab_alloc_node mm/slub.c:3452 [inline] slab_alloc mm/slub.c:3460 [inline] __kmem_cache_alloc_lru mm/slub.c:3467 [inline] kmem_cache_alloc+0x11f/0x2e0 mm/slub.c:3476 fib6_add_1+0x8fb/0x1390 fib6_add+0x1ff/0x3d40 net/ipv6/ip6_fib.c:1392 __ip6_ins_rt net/ipv6/route.c:1302 [inline] ip6_ins_rt+0x106/0x170 net/ipv6/route.c:1312 __ipv6_ifa_notify+0x5c0/0x11d0 net/ipv6/addrconf.c:6162 ipv6_ifa_notify net/ipv6/addrconf.c:6201 [inline] add_addr+0x2ce/0x480 net/ipv6/addrconf.c:3108 add_v4_addrs+0x8d3/0x1180 net/ipv6/addrconf.c:3167 addrconf_gre_config net/ipv6/addrconf.c:3443 [inline] addrconf_init_auto_addrs+0x203/0xe90 net/ipv6/addrconf.c:3461 addrconf_notify+0xb59/0xfe0 net/ipv6/addrconf.c:3642 notifier_call_chain kernel/notifier.c:87 [inline] raw_notifier_call_chain+0xd4/0x170 kernel/notifier.c:455 __dev_notify_flags+0x359/0x650 dev_change_flags+0xf0/0x1a0 net/core/dev.c:8604 do_setlink+0xe93/0x2ae0 net/core/rtnetlink.c:2833 __rtnl_newlink net/core/rtnetlink.c:3623 [inline] rtnl_newlink+0x172d/0x2010 net/core/rtnetlink.c:3670 rtnetlink_rcv_msg+0x825/0xf40 net/core/rtnetlink.c:6174 netlink_rcv_skb+0x1df/0x430 net/netlink/af_netlink.c:2574 netlink_unicast_kernel net/netlink/af_netlink.c:1339 [inline] netlink_unicast+0x7c3/0x990 net/netlink/af_netlink.c:1365 netlink_sendmsg+0xa2a/0xd60 net/netlink/af_netlink.c:1942 sock_sendmsg_nosec net/socket.c:724 [inline] sock_sendmsg net/socket.c:747 [inline] __sys_sendto+0x475/0x630 net/socket.c:2142 __do_sys_sendto net/socket.c:2154 [inline] __se_sys_sendto net/socket.c:2150 [inline] __x64_sys_sendto+0xde/0xf0 net/socket.c:2150 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd The buggy address belongs to the object at ffff8880770e7000 which belongs to the cache fib6_nodes of size 72 The buggy address is located 20 bytes to the right of allocated 72-byte region [ffff8880770e7000, ffff8880770e7048) The buggy address belongs to the physical page: page:ffffea0001dc39c0 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x770e7 flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 ffff88801e8f2b40 dead000000000122 0000000000000000 raw: 0000000000000000 0000000000200020 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 0x12820(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY), pid 5130, tgid 5130 (syz-executor.1), ts 371143105255, free_ts 370829101350 prep_new_page mm/page_alloc.c:2553 [inline] get_page_from_freelist+0x3246/0x33c0 mm/page_alloc.c:4326 __alloc_pages+0x255/0x670 mm/page_alloc.c:5592 alloc_slab_page+0x6a/0x160 mm/slub.c:1851 allocate_slab mm/slub.c:1998 [inline] new_slab+0x84/0x2f0 mm/slub.c:2051 ___slab_alloc+0xa85/0x10a0 mm/slub.c:3193 __slab_alloc mm/slub.c:3292 [inline] __slab_alloc_node mm/slub.c:3345 [inline] slab_alloc_node mm/slub.c:3442 [inline] slab_alloc mm/slub.c:3460 [inline] __kmem_cache_alloc_lru mm/slub.c:3467 [inline] kmem_cache_alloc+0x1b9/0x2e0 mm/slub.c:3476 fib6_add_1+0x8fb/0x1390 fib6_add+0x1ff/0x3d40 net/ipv6/ip6_fib.c:1392 __ip6_ins_rt net/ipv6/route.c:1302 [inline] ip6_ins_rt+0x106/0x170 net/ipv6/route.c:1312 __ipv6_ifa_notify+0x5c0/0x11d0 net/ipv6/addrconf.c:6162 ipv6_ifa_notify net/ipv6/addrconf.c:6201 [inline] add_addr+0x2ce/0x480 net/ipv6/addrconf.c:3108 add_v4_addrs+0x8d3/0x1180 net/ipv6/addrconf.c:3167 addrconf_gre_config net/ipv6/addrconf.c:3443 [inline] addrconf_init_auto_addrs+0x203/0xe90 net/ipv6/addrconf.c:3461 addrconf_notify+0xb59/0xfe0 net/ipv6/addrconf.c:3642 notifier_call_chain kernel/notifier.c:87 [inline] raw_notifier_call_chain+0xd4/0x170 kernel/notifier.c:455 __dev_notify_flags+0x359/0x650 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1454 [inline] free_pcp_prepare mm/page_alloc.c:1504 [inline] free_unref_page_prepare+0xe2f/0xe70 mm/page_alloc.c:3388 free_unref_page+0x37/0x3f0 mm/page_alloc.c:3483 discard_slab mm/slub.c:2098 [inline] __unfreeze_partials+0x1b1/0x1f0 mm/slub.c:2637 put_cpu_partial+0x116/0x180 mm/slub.c:2713 qlist_free_all+0x22/0x60 mm/kasan/quarantine.c:187 kasan_quarantine_reduce+0x14b/0x160 mm/kasan/quarantine.c:294 __kasan_slab_alloc+0x23/0x70 mm/kasan/common.c:305 kasan_slab_alloc include/linux/kasan.h:186 [inline] slab_post_alloc_hook+0x68/0x3a0 mm/slab.h:769 slab_alloc_node mm/slub.c:3452 [inline] slab_alloc mm/slub.c:3460 [inline] __kmem_cache_alloc_lru mm/slub.c:3467 [inline] kmem_cache_alloc_lru+0x11f/0x2e0 mm/slub.c:3483 alloc_inode_sb include/linux/fs.h:2686 [inline] sock_alloc_inode+0x28/0xc0 net/socket.c:305 alloc_inode fs/inode.c:260 [inline] new_inode_pseudo+0x65/0x1d0 fs/inode.c:1019 sock_alloc net/socket.c:630 [inline] __sock_create+0x123/0x8d0 net/socket.c:1509 sock_create net/socket.c:1596 [inline] __sys_socket_create net/socket.c:1633 [inline] __sys_socket+0x13a/0x3a0 net/socket.c:1661 __do_sys_socket net/socket.c:1674 [inline] __se_sys_socket net/socket.c:1672 [inline] __x64_sys_socket+0x7a/0x90 net/socket.c:1672 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Memory state around the buggy address: ffff8880770e6f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8880770e6f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff8880770e7000: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc ^ ffff8880770e7080: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc ffff8880770e7100: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc ==================================================================