================================================================== BUG: KASAN: slab-out-of-bounds in udf_write_aext+0x5e9/0x7a0 fs/udf/inode.c:2105 Write of size 4 at addr ffff88805a2bd3f0 by task syz.0.165/4720 CPU: 1 PID: 4720 Comm: syz.0.165 Not tainted 6.1.111-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106 print_address_description mm/kasan/report.c:284 [inline] print_report+0x15f/0x4f0 mm/kasan/report.c:395 kasan_report+0x136/0x160 mm/kasan/report.c:495 udf_write_aext+0x5e9/0x7a0 fs/udf/inode.c:2105 udf_add_entry+0x17b7/0x3350 fs/udf/namei.c:482 udf_mkdir+0x1a8/0xaa0 fs/udf/namei.c:681 vfs_mkdir+0x3b6/0x590 fs/namei.c:4108 do_mkdirat+0x225/0x360 fs/namei.c:4133 __do_sys_mkdirat fs/namei.c:4148 [inline] __se_sys_mkdirat fs/namei.c:4146 [inline] __x64_sys_mkdirat+0x85/0x90 fs/namei.c:4146 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 RIP: 0033:0x7f4f3857def9 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:00007f4f39466038 EFLAGS: 00000246 ORIG_RAX: 0000000000000102 RAX: ffffffffffffffda RBX: 00007f4f38735f80 RCX: 00007f4f3857def9 RDX: 0000000000000000 RSI: 00000000200005c0 RDI: ffffffffffffff9c RBP: 00007f4f385f0b76 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f4f38735f80 R15: 00007fffcc442e98 Allocated by task 3724: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4b/0x70 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:374 [inline] __kasan_kmalloc+0x97/0xb0 mm/kasan/common.c:383 kmalloc include/linux/slab.h:557 [inline] kzalloc include/linux/slab.h:693 [inline] device_private_init drivers/base/core.c:3536 [inline] device_add+0xb5/0xfd0 drivers/base/core.c:3586 netdev_register_kobject+0x176/0x310 net/core/net-sysfs.c:2013 register_netdevice+0x108a/0x1720 net/core/dev.c:10099 nsim_init_netdevsim drivers/net/netdevsim/netdev.c:317 [inline] nsim_create+0x34b/0x3f0 drivers/net/netdevsim/netdev.c:365 __nsim_dev_port_add+0x6ba/0xb10 drivers/net/netdevsim/dev.c:1393 nsim_dev_port_add_all drivers/net/netdevsim/dev.c:1451 [inline] nsim_dev_reload_create drivers/net/netdevsim/dev.c:1503 [inline] nsim_dev_reload_up+0x693/0x8e0 drivers/net/netdevsim/dev.c:985 devlink_reload+0x2a0/0x6a0 net/devlink/leftover.c:4499 devlink_pernet_pre_exit+0x14e/0x2c0 net/devlink/leftover.c:12521 ops_pre_exit_list net/core/net_namespace.c:162 [inline] cleanup_net+0x59c/0xb60 net/core/net_namespace.c:592 process_one_work+0x8a9/0x11d0 kernel/workqueue.c:2292 worker_thread+0xa47/0x1200 kernel/workqueue.c:2439 kthread+0x28d/0x320 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 Freed by task 4559: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4b/0x70 mm/kasan/common.c:52 kasan_save_free_info+0x27/0x40 mm/kasan/generic.c:516 ____kasan_slab_free+0xd6/0x120 mm/kasan/common.c:236 kasan_slab_free include/linux/kasan.h:177 [inline] slab_free_hook mm/slub.c:1724 [inline] slab_free_freelist_hook mm/slub.c:1750 [inline] slab_free mm/slub.c:3661 [inline] __kmem_cache_free+0x25c/0x3c0 mm/slub.c:3674 kobject_cleanup lib/kobject.c:681 [inline] kobject_release lib/kobject.c:712 [inline] kref_put include/linux/kref.h:65 [inline] kobject_put+0x224/0x460 lib/kobject.c:729 __nsim_dev_port_del+0x153/0x1b0 drivers/net/netdevsim/dev.c:1430 nsim_dev_port_del_all drivers/net/netdevsim/dev.c:1442 [inline] nsim_dev_reload_destroy+0x286/0x490 drivers/net/netdevsim/dev.c:1659 nsim_drv_remove+0x5c/0x160 drivers/net/netdevsim/dev.c:1675 device_remove drivers/base/dd.c:548 [inline] __device_release_driver drivers/base/dd.c:1260 [inline] device_release_driver_internal+0x4f3/0x880 drivers/base/dd.c:1286 bus_remove_device+0x2e5/0x400 drivers/base/bus.c:529 device_del+0x6e2/0xbd0 drivers/base/core.c:3880 device_unregister+0x1c/0xc0 drivers/base/core.c:3923 nsim_bus_dev_del drivers/net/netdevsim/bus.c:310 [inline] del_device_store+0x35f/0x480 drivers/net/netdevsim/bus.c:219 kernfs_fop_write_iter+0x3a2/0x4f0 fs/kernfs/file.c:334 call_write_iter include/linux/fs.h:2265 [inline] new_sync_write fs/read_write.c:491 [inline] vfs_write+0x857/0xbc0 fs/read_write.c:584 ksys_write+0x19c/0x2c0 fs/read_write.c:637 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 The buggy address belongs to the object at ffff88805a2bd000 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 496 bytes to the right of 512-byte region [ffff88805a2bd000, ffff88805a2bd200) The buggy address belongs to the physical page: page:ffffea000168af00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x5a2bc head:ffffea000168af00 order:2 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 dead000000000100 dead000000000122 ffff888017c41c80 raw: 0000000000000000 0000000080100010 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 2, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 3638, tgid 3638 (syz-executor), ts 65362150809, free_ts 17517133142 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x18d/0x1b0 mm/page_alloc.c:2517 prep_new_page mm/page_alloc.c:2524 [inline] get_page_from_freelist+0x322e/0x33b0 mm/page_alloc.c:4290 __alloc_pages+0x28d/0x770 mm/page_alloc.c:5558 alloc_slab_page+0x6a/0x150 mm/slub.c:1794 allocate_slab mm/slub.c:1939 [inline] new_slab+0x84/0x2d0 mm/slub.c:1992 ___slab_alloc+0xc20/0x1270 mm/slub.c:3180 __slab_alloc mm/slub.c:3279 [inline] slab_alloc_node mm/slub.c:3364 [inline] __kmem_cache_alloc_node+0x19f/0x260 mm/slub.c:3437 __do_kmalloc_node mm/slab_common.c:935 [inline] __kmalloc+0xa1/0x230 mm/slab_common.c:949 kmalloc include/linux/slab.h:562 [inline] kzalloc include/linux/slab.h:693 [inline] fib6_info_alloc+0x2c/0xd0 net/ipv6/ip6_fib.c:156 ip6_route_info_create+0x446/0x12c0 net/ipv6/route.c:3754 addrconf_f6i_alloc+0x3a0/0x7d0 net/ipv6/route.c:4579 ipv6_add_addr+0x450/0xee0 net/ipv6/addrconf.c:1121 inet6_addr_add+0x47c/0x9f0 net/ipv6/addrconf.c:2996 inet6_rtm_newaddr+0x85f/0x2660 net/ipv6/addrconf.c:4959 rtnetlink_rcv_msg+0x818/0xff0 net/core/rtnetlink.c:6121 netlink_rcv_skb+0x1cd/0x410 net/netlink/af_netlink.c:2507 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1444 [inline] free_pcp_prepare mm/page_alloc.c:1494 [inline] free_unref_page_prepare+0xf63/0x1120 mm/page_alloc.c:3369 free_unref_page+0x33/0x3e0 mm/page_alloc.c:3464 free_contig_range+0x9a/0x150 mm/page_alloc.c:9518 destroy_args+0xfe/0x997 mm/debug_vm_pgtable.c:1031 debug_vm_pgtable+0x416/0x46b mm/debug_vm_pgtable.c:1354 do_one_initcall+0x265/0x8f0 init/main.c:1298 do_initcall_level+0x157/0x207 init/main.c:1371 do_initcalls+0x49/0x86 init/main.c:1387 kernel_init_freeable+0x45c/0x60f init/main.c:1626 kernel_init+0x19/0x290 init/main.c:1514 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 Memory state around the buggy address: ffff88805a2bd280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88805a2bd300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88805a2bd380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff88805a2bd400: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88805a2bd480: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================