jffs2: warning: (12041) save_xattr_datum: jffs2_flash_writev()=-22, req=65305, wrote=32, at 0x01d00c ================================================================== BUG: KASAN: slab-out-of-bounds in jffs2_sum_add_kvec+0xcc0/0x19b0 fs/jffs2/summary.c:261 Read of size 4 at addr ffff88807b8c2c74 by task syz-executor.3/12041 CPU: 1 PID: 12041 Comm: syz-executor.3 Not tainted 6.8.0-syzkaller-08951-gfe46a7dd189e #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:114 print_address_description mm/kasan/report.c:377 [inline] print_report+0x169/0x550 mm/kasan/report.c:488 kasan_report+0x143/0x180 mm/kasan/report.c:601 jffs2_sum_add_kvec+0xcc0/0x19b0 fs/jffs2/summary.c:261 jffs2_flash_direct_writev+0xaa/0xe0 fs/jffs2/writev.c:22 jffs2_flash_writev+0x175/0x1500 fs/jffs2/wbuf.c:805 jffs2_write_dnode+0x4ef/0xe90 fs/jffs2/write.c:109 jffs2_do_create+0x1a1/0xd10 fs/jffs2/write.c:465 jffs2_create+0x1b3/0x320 fs/jffs2/dir.c:203 lookup_open fs/namei.c:3497 [inline] open_last_lookups fs/namei.c:3566 [inline] path_openat+0x1425/0x3240 fs/namei.c:3796 do_filp_open+0x235/0x490 fs/namei.c:3826 do_sys_openat2+0x13e/0x1d0 fs/open.c:1406 do_sys_open fs/open.c:1421 [inline] __do_sys_openat fs/open.c:1437 [inline] __se_sys_openat fs/open.c:1432 [inline] __x64_sys_openat+0x247/0x2a0 fs/open.c:1432 do_syscall_64+0xfb/0x240 entry_SYSCALL_64_after_hwframe+0x6d/0x75 RIP: 0033:0x7f961947de69 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:00007f961a21c0c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 00007f96195abf80 RCX: 00007f961947de69 RDX: 000000000000275a RSI: 0000000020000040 RDI: ffffffffffffff9c RBP: 00007f96194ca47a R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007f96195abf80 R15: 00007ffd393a11b8 Allocated by task 12041: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 poison_kmalloc_redzone mm/kasan/common.c:370 [inline] __kasan_kmalloc+0x98/0xb0 mm/kasan/common.c:387 kasan_kmalloc include/linux/kasan.h:211 [inline] __do_kmalloc_node mm/slub.c:3966 [inline] __kmalloc+0x233/0x4a0 mm/slub.c:3979 kmalloc include/linux/slab.h:632 [inline] kzalloc include/linux/slab.h:749 [inline] jffs2_do_mount_fs+0x16f/0x23e0 fs/jffs2/build.c:387 jffs2_do_fill_super+0x53d/0xb60 fs/jffs2/fs.c:573 mtd_get_sb+0x191/0x3c0 drivers/mtd/mtdsuper.c:57 get_tree_mtd+0x659/0x820 drivers/mtd/mtdsuper.c:141 vfs_get_tree+0x90/0x2a0 fs/super.c:1779 do_new_mount+0x2be/0xb40 fs/namespace.c:3352 do_mount fs/namespace.c:3692 [inline] __do_sys_mount fs/namespace.c:3898 [inline] __se_sys_mount+0x2d9/0x3c0 fs/namespace.c:3875 do_syscall_64+0xfb/0x240 entry_SYSCALL_64_after_hwframe+0x6d/0x75 The buggy address belongs to the object at ffff88807b8c2000 which belongs to the cache kmalloc-4k of size 4096 The buggy address is located 884 bytes to the right of allocated 2304-byte region [ffff88807b8c2000, ffff88807b8c2900) The buggy address belongs to the physical page: page:ffffea0001ee3000 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x7b8c0 head:ffffea0001ee3000 order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000000840(slab|head|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000000840 ffff888014c42140 dead000000000122 0000000000000000 raw: 0000000000000000 0000000000040004 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 12041, tgid 12039 (syz-executor.3), ts 379853747399, free_ts 379819139436 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x1ea/0x210 mm/page_alloc.c:1533 prep_new_page mm/page_alloc.c:1540 [inline] get_page_from_freelist+0x33ea/0x3580 mm/page_alloc.c:3311 __alloc_pages+0x256/0x680 mm/page_alloc.c:4569 __alloc_pages_node include/linux/gfp.h:238 [inline] alloc_pages_node include/linux/gfp.h:261 [inline] alloc_slab_page+0x5f/0x160 mm/slub.c:2175 allocate_slab mm/slub.c:2338 [inline] new_slab+0x84/0x2f0 mm/slub.c:2391 ___slab_alloc+0xc73/0x1260 mm/slub.c:3525 __slab_alloc mm/slub.c:3610 [inline] __slab_alloc_node mm/slub.c:3663 [inline] slab_alloc_node mm/slub.c:3835 [inline] kmalloc_trace+0x269/0x360 mm/slub.c:3992 kmalloc include/linux/slab.h:628 [inline] kzalloc include/linux/slab.h:749 [inline] alloc_super+0x59/0x9d0 fs/super.c:317 sget_fc+0x26b/0x8c0 fs/super.c:748 sget_dev+0xbc/0x110 fs/super.c:1349 mtd_get_sb+0x50/0x3c0 drivers/mtd/mtdsuper.c:33 get_tree_mtd+0x659/0x820 drivers/mtd/mtdsuper.c:141 vfs_get_tree+0x90/0x2a0 fs/super.c:1779 do_new_mount+0x2be/0xb40 fs/namespace.c:3352 do_mount fs/namespace.c:3692 [inline] __do_sys_mount fs/namespace.c:3898 [inline] __se_sys_mount+0x2d9/0x3c0 fs/namespace.c:3875 do_syscall_64+0xfb/0x240 page last free pid 11961 tgid 11961 stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1140 [inline] free_unref_page_prepare+0x95d/0xa80 mm/page_alloc.c:2346 free_unref_page+0x37/0x3f0 mm/page_alloc.c:2486 discard_slab mm/slub.c:2437 [inline] __put_partials+0xeb/0x130 mm/slub.c:2906 put_cpu_partial+0x17c/0x250 mm/slub.c:2981 __slab_free+0x2ea/0x3d0 mm/slub.c:4151 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x5e/0xc0 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x14f/0x170 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x23/0x80 mm/kasan/common.c:322 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slub.c:3798 [inline] slab_alloc_node mm/slub.c:3845 [inline] kmalloc_trace+0x16f/0x360 mm/slub.c:3992 kmalloc include/linux/slab.h:628 [inline] kzalloc include/linux/slab.h:749 [inline] ref_tracker_alloc+0x14b/0x490 lib/ref_tracker.c:203 __netdev_tracker_alloc include/linux/netdevice.h:4064 [inline] netdev_hold include/linux/netdevice.h:4093 [inline] netdev_queue_add_kobject net/core/net-sysfs.c:1783 [inline] netdev_queue_update_kobjects+0x186/0x5f0 net/core/net-sysfs.c:1838 register_queue_kobjects net/core/net-sysfs.c:1900 [inline] netdev_register_kobject+0x265/0x320 net/core/net-sysfs.c:2140 register_netdevice+0x1208/0x1a20 net/core/dev.c:10274 geneve_configure+0x6bd/0xa60 drivers/net/geneve.c:1373 geneve_newlink+0x109/0x1b0 drivers/net/geneve.c:1624 rtnl_newlink_create net/core/rtnetlink.c:3494 [inline] __rtnl_newlink net/core/rtnetlink.c:3714 [inline] rtnl_newlink+0x158f/0x20a0 net/core/rtnetlink.c:3727 Memory state around the buggy address: ffff88807b8c2b00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88807b8c2b80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88807b8c2c00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff88807b8c2c80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88807b8c2d00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================