================================================================== BUG: KASAN: slab-out-of-bounds in sysv_new_inode+0x1062/0x11f0 fs/sysv/ialloc.c:153 Read of size 2 at addr ffff888062c921ce by task syz.2.344/5307 CPU: 1 PID: 5307 Comm: syz.2.344 Not tainted 5.15.163-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/27/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2d0 lib/dump_stack.c:106 print_address_description+0x63/0x3b0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:434 [inline] kasan_report+0x16b/0x1c0 mm/kasan/report.c:451 sysv_new_inode+0x1062/0x11f0 fs/sysv/ialloc.c:153 sysv_mknod+0x4a/0xe0 fs/sysv/namei.c:53 lookup_open fs/namei.c:3462 [inline] open_last_lookups fs/namei.c:3532 [inline] path_openat+0x130a/0x2f20 fs/namei.c:3739 do_filp_open+0x21c/0x460 fs/namei.c:3769 do_sys_openat2+0x13b/0x4f0 fs/open.c:1253 do_sys_open fs/open.c:1269 [inline] __do_sys_openat fs/open.c:1285 [inline] __se_sys_openat fs/open.c:1280 [inline] __x64_sys_openat+0x243/0x290 fs/open.c:1280 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 RIP: 0033:0x7fb8590b7299 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:00007fb857536048 EFLAGS: 00000246 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 00007fb859245f80 RCX: 00007fb8590b7299 RDX: 000000000000275a RSI: 0000000020000080 RDI: ffffffffffffff9c RBP: 00007fb8591248e6 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007fb859245f80 R15: 00007ffe41178138 Allocated by task 12227: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:434 [inline] ____kasan_kmalloc+0xba/0xf0 mm/kasan/common.c:513 kasan_kmalloc include/linux/kasan.h:264 [inline] kmem_cache_alloc_trace+0x143/0x290 mm/slub.c:3247 kmalloc include/linux/slab.h:591 [inline] __hw_addr_create net/core/dev_addr_lists.c:29 [inline] __hw_addr_add_ex+0x206/0x770 net/core/dev_addr_lists.c:93 __dev_mc_add net/core/dev_addr_lists.c:832 [inline] dev_mc_add+0x93/0x100 net/core/dev_addr_lists.c:850 ip_mc_filter_add net/ipv4/igmp.c:1155 [inline] igmp_group_added+0x1b4/0x800 net/ipv4/igmp.c:1344 ____ip_mc_inc_group+0x994/0xbf0 net/ipv4/igmp.c:1478 __ip_mc_inc_group net/ipv4/igmp.c:1487 [inline] ip_mc_inc_group net/ipv4/igmp.c:1493 [inline] ip_mc_up+0x11b/0x2f0 net/ipv4/igmp.c:1792 inetdev_event+0xf24/0x1490 net/ipv4/devinet.c:1573 notifier_call_chain kernel/notifier.c:83 [inline] raw_notifier_call_chain+0xd0/0x170 kernel/notifier.c:391 __dev_notify_flags+0x304/0x610 dev_change_flags+0xe7/0x190 net/core/dev.c:8889 do_setlink+0xcd1/0x3b00 net/core/rtnetlink.c:2741 __rtnl_newlink net/core/rtnetlink.c:3429 [inline] rtnl_newlink+0x17a4/0x2070 net/core/rtnetlink.c:3549 rtnetlink_rcv_msg+0x993/0xee0 net/core/rtnetlink.c:5629 netlink_rcv_skb+0x1cf/0x410 net/netlink/af_netlink.c:2504 netlink_unicast_kernel net/netlink/af_netlink.c:1326 [inline] netlink_unicast+0x7b6/0x980 net/netlink/af_netlink.c:1352 netlink_sendmsg+0xa30/0xd60 net/netlink/af_netlink.c:1920 sock_sendmsg_nosec net/socket.c:704 [inline] __sock_sendmsg net/socket.c:716 [inline] __sys_sendto+0x564/0x720 net/socket.c:2058 __do_sys_sendto net/socket.c:2070 [inline] __se_sys_sendto net/socket.c:2066 [inline] __x64_sys_sendto+0xda/0xf0 net/socket.c:2066 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 Last potentially related work creation: kasan_save_stack+0x36/0x60 mm/kasan/common.c:38 kasan_record_aux_stack+0xba/0x100 mm/kasan/generic.c:348 kvfree_call_rcu+0x118/0x8a0 kernel/rcu/tree.c:3596 __hw_addr_flush net/core/dev_addr_lists.c:484 [inline] dev_addr_flush+0x168/0x200 net/core/dev_addr_lists.c:513 free_netdev+0x1fc/0x480 net/core/dev.c:10962 netdev_run_todo+0xa43/0xc40 net/core/dev.c:10653 default_device_exit_batch+0x395/0x3f0 net/core/dev.c:11628 ops_exit_list net/core/net_namespace.c:177 [inline] cleanup_net+0x763/0xb60 net/core/net_namespace.c:599 process_one_work+0x8a1/0x10c0 kernel/workqueue.c:2310 worker_thread+0xaca/0x1280 kernel/workqueue.c:2457 kthread+0x3f6/0x4f0 kernel/kthread.c:334 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287 Second to last potentially related work creation: kasan_save_stack+0x36/0x60 mm/kasan/common.c:38 kasan_record_aux_stack+0xba/0x100 mm/kasan/generic.c:348 kvfree_call_rcu+0x118/0x8a0 kernel/rcu/tree.c:3596 __hw_addr_del_entry net/core/dev_addr_lists.c:145 [inline] __hw_addr_del_ex+0x537/0x630 net/core/dev_addr_lists.c:194 __dev_mc_del net/core/dev_addr_lists.c:873 [inline] dev_mc_del+0x8f/0x100 net/core/dev_addr_lists.c:891 igmp6_group_dropped+0x1b8/0xce0 net/ipv6/mcast.c:715 __ipv6_dev_mc_dec+0x2b9/0x330 net/ipv6/mcast.c:978 addrconf_leave_solict net/ipv6/addrconf.c:2213 [inline] __ipv6_ifa_notify+0x901/0x11d0 net/ipv6/addrconf.c:6190 addrconf_ifdown+0xec0/0x1bb0 net/ipv6/addrconf.c:3901 addrconf_notify+0x432/0xf30 notifier_call_chain kernel/notifier.c:83 [inline] raw_notifier_call_chain+0xd0/0x170 kernel/notifier.c:391 call_netdevice_notifiers_info net/core/dev.c:2018 [inline] call_netdevice_notifiers_extack net/core/dev.c:2030 [inline] call_netdevice_notifiers net/core/dev.c:2044 [inline] dev_close_many+0x37c/0x530 net/core/dev.c:1619 unregister_netdevice_many+0x4b0/0x18f0 net/core/dev.c:11070 default_device_exit_batch+0x390/0x3f0 net/core/dev.c:11627 ops_exit_list net/core/net_namespace.c:177 [inline] cleanup_net+0x763/0xb60 net/core/net_namespace.c:599 process_one_work+0x8a1/0x10c0 kernel/workqueue.c:2310 worker_thread+0xaca/0x1280 kernel/workqueue.c:2457 kthread+0x3f6/0x4f0 kernel/kthread.c:334 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287 The buggy address belongs to the object at ffff888062c92100 which belongs to the cache kmalloc-128 of size 128 The buggy address is located 78 bytes to the right of 128-byte region [ffff888062c92100, ffff888062c92180) The buggy address belongs to the page: page:ffffea00018b2480 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x62c92 flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 0000000000000000 0000000100000001 ffff888011c418c0 raw: 0000000000000000 0000000000100010 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 3580, ts 50693656609, free_ts 11438100283 prep_new_page mm/page_alloc.c:2426 [inline] get_page_from_freelist+0x322a/0x33c0 mm/page_alloc.c:4159 __alloc_pages+0x272/0x700 mm/page_alloc.c:5423 alloc_slab_page mm/slub.c:1775 [inline] allocate_slab mm/slub.c:1912 [inline] new_slab+0xbb/0x4b0 mm/slub.c:1975 ___slab_alloc+0x6f6/0xe10 mm/slub.c:3008 __slab_alloc mm/slub.c:3095 [inline] slab_alloc_node mm/slub.c:3186 [inline] __kmalloc_node+0x1fa/0x390 mm/slub.c:4451 kmalloc_node include/linux/slab.h:614 [inline] kvmalloc_node+0x80/0x140 mm/util.c:619 kvmalloc include/linux/mm.h:805 [inline] kvzalloc include/linux/mm.h:813 [inline] allocate_hook_entries_size net/netfilter/core.c:61 [inline] nf_hook_entries_grow+0x331/0x760 net/netfilter/core.c:128 __nf_register_net_hook+0x22f/0x8e0 net/netfilter/core.c:401 nf_register_net_hook+0xac/0x180 net/netfilter/core.c:536 nf_register_net_hooks+0x3d/0x1a0 net/netfilter/core.c:552 ip6t_register_table+0x4d0/0x7b0 net/ipv6/netfilter/ip6_tables.c:1789 ip6table_filter_table_init+0x80/0xb0 net/ipv6/netfilter/ip6table_filter.c:56 xt_find_table_lock+0x2cc/0x3a0 net/netfilter/x_tables.c:1259 xt_request_find_table_lock+0x22/0xf0 net/netfilter/x_tables.c:1284 get_info net/ipv6/netfilter/ip6_tables.c:981 [inline] do_ip6t_get_ctl+0x86d/0x1890 net/ipv6/netfilter/ip6_tables.c:1670 nf_getsockopt+0x28e/0x2b0 net/netfilter/nf_sockopt.c:116 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1340 [inline] free_pcp_prepare mm/page_alloc.c:1391 [inline] free_unref_page_prepare+0xc34/0xcf0 mm/page_alloc.c:3317 free_unref_page+0x95/0x2d0 mm/page_alloc.c:3396 free_contig_range+0x95/0xf0 mm/page_alloc.c:9342 destroy_args+0xfe/0x980 mm/debug_vm_pgtable.c:1018 debug_vm_pgtable+0x40d/0x470 mm/debug_vm_pgtable.c:1331 do_one_initcall+0x22b/0x7a0 init/main.c:1302 do_initcall_level+0x157/0x210 init/main.c:1375 do_initcalls+0x49/0x90 init/main.c:1391 kernel_init_freeable+0x425/0x5c0 init/main.c:1615 kernel_init+0x19/0x290 init/main.c:1506 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287 Memory state around the buggy address: ffff888062c92080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888062c92100: 00 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc >ffff888062c92180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff888062c92200: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888062c92280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================