loop0: detected capacity change from 0 to 32768 ================================================================== BUG: KASAN: slab-out-of-bounds in diWrite+0x1209/0x1f40 fs/jfs/jfs_imap.c:753 Write of size 32 at addr ffff8880493850c0 by task syz.0.16/5954 CPU: 0 UID: 0 PID: 5954 Comm: syz.0.16 Not tainted syzkaller #0 PREEMPT(full) Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 Call Trace: dump_stack_lvl+0x189/0x250 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0xca/0x240 mm/kasan/report.c:482 kasan_report+0x118/0x150 mm/kasan/report.c:595 check_region_inline mm/kasan/generic.c:-1 [inline] kasan_check_range+0x2b0/0x2c0 mm/kasan/generic.c:200 __asan_memcpy+0x40/0x70 mm/kasan/shadow.c:106 diWrite+0x1209/0x1f40 fs/jfs/jfs_imap.c:753 txCommit+0x852/0x5430 fs/jfs/jfs_txnmgr.c:1256 add_missing_indices+0x8ce/0xce0 fs/jfs/jfs_dtree.c:2674 jfs_readdir+0x1d8f/0x3ae0 fs/jfs/jfs_dtree.c:3031 wrap_directory_iterator+0x93/0xe0 fs/readdir.c:65 iterate_dir+0x396/0x570 fs/readdir.c:108 __do_sys_getdents64 fs/readdir.c:410 [inline] __se_sys_getdents64+0xe4/0x260 fs/readdir.c:396 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f9fe8b8e929 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:00007f9fe99ea038 EFLAGS: 00000246 ORIG_RAX: 00000000000000d9 RAX: ffffffffffffffda RBX: 00007f9fe8db5fa0 RCX: 00007f9fe8b8e929 RDX: 000000000000009e RSI: 0000200000000280 RDI: 0000000000000005 RBP: 00007f9fe8c10b39 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f9fe8db5fa0 R15: 00007ffc7c216928 Allocated by task 5737: kasan_save_stack mm/kasan/common.c:56 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:77 poison_kmalloc_redzone mm/kasan/common.c:400 [inline] __kasan_kmalloc+0x93/0xb0 mm/kasan/common.c:417 kasan_kmalloc include/linux/kasan.h:262 [inline] __do_kmalloc_node mm/slub.c:5603 [inline] __kmalloc_node_track_caller_noprof+0x568/0x800 mm/slub.c:5712 __kmemdup_nul mm/util.c:64 [inline] kstrdup+0x42/0x100 mm/util.c:84 __kernfs_new_node+0x9c/0x7e0 fs/kernfs/dir.c:633 kernfs_new_node+0x102/0x210 fs/kernfs/dir.c:713 kernfs_create_link+0xa7/0x200 fs/kernfs/symlink.c:39 sysfs_do_create_link_sd+0x83/0x110 fs/sysfs/symlink.c:44 netdev_adjacent_sysfs_add net/core/dev.c:8540 [inline] __netdev_adjacent_dev_insert+0x511/0x8d0 net/core/dev.c:8596 __netdev_adjacent_dev_link_lists net/core/dev.c:8678 [inline] __netdev_adjacent_dev_link_neighbour net/core/dev.c:8702 [inline] __netdev_upper_dev_link+0x389/0x590 net/core/dev.c:8762 netdev_upper_dev_link+0x9d/0xf0 net/core/dev.c:8808 register_vlan_dev+0x3f6/0x800 net/8021q/vlan.c:183 vlan_newlink+0x4b2/0x610 net/8021q/vlan_netlink.c:194 rtnl_newlink_create+0x30d/0xb00 net/core/rtnetlink.c:3833 __rtnl_newlink net/core/rtnetlink.c:3950 [inline] rtnl_newlink+0x16e4/0x1c80 net/core/rtnetlink.c:4065 rtnetlink_rcv_msg+0x7cf/0xb70 net/core/rtnetlink.c:6954 netlink_rcv_skb+0x208/0x470 net/netlink/af_netlink.c:2552 netlink_unicast_kernel net/netlink/af_netlink.c:1320 [inline] netlink_unicast+0x82f/0x9e0 net/netlink/af_netlink.c:1346 netlink_sendmsg+0x805/0xb30 net/netlink/af_netlink.c:1896 sock_sendmsg_nosec net/socket.c:727 [inline] __sock_sendmsg+0x21c/0x270 net/socket.c:742 __sys_sendto+0x3bd/0x520 net/socket.c:2244 __do_sys_sendto net/socket.c:2251 [inline] __se_sys_sendto net/socket.c:2247 [inline] __x64_sys_sendto+0xde/0x100 net/socket.c:2247 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff8880493850c0 which belongs to the cache kmalloc-32 of size 32 The buggy address is located 0 bytes inside of allocated 17-byte region [ffff8880493850c0, ffff8880493850d1) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x49385 ksm flags: 0x4fff00000000000(node=1|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 04fff00000000000 ffff88801a041780 ffffea0001662a00 dead000000000003 raw: 0000000000000000 0000000000400040 00000000f5000000 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 0x52800(GFP_NOWAIT|__GFP_NORETRY|__GFP_COMP), pid 5448, tgid 5448 (syz-executor), ts 97665751445, free_ts 93373736444 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x240/0x2a0 mm/page_alloc.c:1850 prep_new_page mm/page_alloc.c:1858 [inline] get_page_from_freelist+0x2365/0x2440 mm/page_alloc.c:3884 __alloc_frozen_pages_noprof+0x181/0x370 mm/page_alloc.c:5183 alloc_pages_mpol+0x232/0x4a0 mm/mempolicy.c:2416 alloc_slab_page mm/slub.c:3030 [inline] allocate_slab+0x96/0x3a0 mm/slub.c:3203 new_slab mm/slub.c:3257 [inline] ___slab_alloc+0xe94/0x1920 mm/slub.c:4627 __slab_alloc+0x65/0x100 mm/slub.c:4746 __slab_alloc_node mm/slub.c:4822 [inline] slab_alloc_node mm/slub.c:5233 [inline] __kmalloc_cache_noprof+0x411/0x6f0 mm/slub.c:5719 kmalloc_noprof include/linux/slab.h:957 [inline] slab_free_hook mm/slub.c:2466 [inline] slab_free mm/slub.c:6566 [inline] kmem_cache_free+0x16f/0x690 mm/slub.c:6676 fput_close_sync+0x119/0x200 fs/file_table.c:573 __do_sys_close fs/open.c:1589 [inline] __se_sys_close fs/open.c:1574 [inline] __x64_sys_close+0x7f/0x110 fs/open.c:1574 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f page last free pid 5372 tgid 5372 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1394 [inline] __free_frozen_pages+0xbc4/0xd30 mm/page_alloc.c:2906 vfree+0x25a/0x400 mm/vmalloc.c:3440 kcov_put kernel/kcov.c:439 [inline] kcov_close+0x28/0x50 kernel/kcov.c:535 __fput+0x44c/0xa70 fs/file_table.c:468 task_work_run+0x1d1/0x260 kernel/task_work.c:227 exit_task_work include/linux/task_work.h:40 [inline] do_exit+0x6b5/0x2300 kernel/exit.c:966 do_group_exit+0x21c/0x2d0 kernel/exit.c:1107 get_signal+0x1285/0x1340 kernel/signal.c:3034 arch_do_signal_or_restart+0xa0/0x790 arch/x86/kernel/signal.c:337 exit_to_user_mode_loop+0x72/0x130 kernel/entry/common.c:40 exit_to_user_mode_prepare include/linux/irq-entry-common.h:225 [inline] syscall_exit_to_user_mode_work include/linux/entry-common.h:175 [inline] syscall_exit_to_user_mode include/linux/entry-common.h:210 [inline] do_syscall_64+0x2bd/0x3b0 arch/x86/entry/syscall_64.c:100 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff888049384f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888049385000: 00 00 00 00 fc fc fc fc 00 00 00 00 fc fc fc fc >ffff888049385080: fa fb fb fb fc fc fc fc 00 00 01 fc fc fc fc fc ^ ffff888049385100: 00 00 00 00 fc fc fc fc 00 00 00 00 fc fc fc fc ffff888049385180: 00 00 00 00 fc fc fc fc 00 00 00 00 fc fc fc fc ==================================================================