find_entry called with index = 0 find_entry called with index = 0 find_entry called with index = 0 find_entry called with index = 0 find_entry called with index = 0 ================================================================== BUG: KASAN: use-after-free in dbAllocBits+0x516/0x5f0 fs/jfs/jfs_dmap.c:2232 Read of size 8 at addr ffff8880201ec038 by task syz-executor331/3609 CPU: 1 PID: 3609 Comm: syz-executor331 Not tainted 6.1.0-rc1-next-20221021-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/11/2022 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:253 [inline] print_report+0x15e/0x45d mm/kasan/report.c:364 kasan_report+0xbb/0x1f0 mm/kasan/report.c:464 dbAllocBits+0x516/0x5f0 fs/jfs/jfs_dmap.c:2232 dbAllocDmap+0x61/0x110 fs/jfs/jfs_dmap.c:2009 dbAllocDmapLev+0x158/0x2c0 fs/jfs/jfs_dmap.c:1963 dbAllocCtl+0x131/0x780 fs/jfs/jfs_dmap.c:1803 dbAllocAny+0x10e/0x1a0 fs/jfs/jfs_dmap.c:1517 dbAlloc+0x46d/0xa70 fs/jfs/jfs_dmap.c:869 extBalloc fs/jfs/jfs_extent.c:321 [inline] extAlloc+0x4e7/0xeb0 fs/jfs/jfs_extent.c:122 jfs_get_block+0x661/0xa90 fs/jfs/inode.c:248 get_more_blocks fs/direct-io.c:665 [inline] do_direct_IO fs/direct-io.c:953 [inline] __blockdev_direct_IO+0x174d/0x45f0 fs/direct-io.c:1266 blockdev_direct_IO include/linux/fs.h:3214 [inline] jfs_direct_IO+0x10a/0x2c0 fs/jfs/inode.c:336 generic_file_direct_write+0x1e8/0x540 mm/filemap.c:3695 __generic_file_write_iter+0x1a2/0x4d0 mm/filemap.c:3855 generic_file_write_iter+0xdf/0x350 mm/filemap.c:3931 call_write_iter include/linux/fs.h:2191 [inline] do_iter_readv_writev+0x20b/0x3b0 fs/read_write.c:735 do_iter_write+0x182/0x700 fs/read_write.c:861 vfs_writev+0x1aa/0x630 fs/read_write.c:934 do_pwritev+0x1b6/0x270 fs/read_write.c:1031 __do_sys_pwritev2 fs/read_write.c:1090 [inline] __se_sys_pwritev2 fs/read_write.c:1081 [inline] __x64_sys_pwritev2+0xeb/0x150 fs/read_write.c:1081 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f1a43abedc9 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 c0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007ffceda8f9d8 EFLAGS: 00000246 ORIG_RAX: 0000000000000148 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f1a43abedc9 RDX: 0000000000000001 RSI: 0000000020000240 RDI: 0000000000000003 RBP: 00007f1a43a7e590 R08: 0000000000000000 R09: 0000000000000003 R10: 0000000000001400 R11: 0000000000000246 R12: 0000000200000004 R13: 0000000000000000 R14: 00080000000000fc R15: 0000000000000000 Allocated by task 3598: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:45 __kasan_unpoison_range-0xf/0x10 ____kasan_slab_free-0xf/0x1c0 kasan_kmalloc include/linux/kasan.h:211 [inline] __do_kmalloc_node mm/slab_common.c:955 [inline] __kmalloc+0x54/0xc0 mm/slab_common.c:968 kmalloc include/linux/slab.h:587 [inline] sk_prot_alloc+0x143/0x290 net/core/sock.c:2030 sk_alloc+0x36/0x770 net/core/sock.c:2083 __netlink_create+0x63/0x380 net/netlink/af_netlink.c:647 netlink_create+0x3ad/0x5e0 net/netlink/af_netlink.c:710 __sock_create+0x355/0x790 net/socket.c:1515 sock_create net/socket.c:1566 [inline] __sys_socket_create net/socket.c:1603 [inline] __sys_socket_create net/socket.c:1588 [inline] __sys_socket+0x12f/0x240 net/socket.c:1636 __do_sys_socket net/socket.c:1649 [inline] __se_sys_socket net/socket.c:1647 [inline] __x64_sys_socket+0x6f/0xb0 net/socket.c:1647 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Freed by task 0: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:45 __kasan_unpoison_range-0xf/0x10 kasan_save_free_info+0x2a/0x40 mm/kasan/generic.c:511 ____kasan_slab_free mm/kasan/common.c:236 [inline] ____kasan_slab_free+0x160/0x1c0 mm/kasan/common.c:200 kasan_slab_free include/linux/kasan.h:177 [inline] slab_free_hook mm/slub.c:1724 [inline] slab_free_freelist_hook+0x8b/0x1c0 mm/slub.c:1750 slab_free mm/slub.c:3666 [inline] __kmem_cache_free+0xab/0x3b0 mm/slub.c:3679 sk_prot_free net/core/sock.c:2066 [inline] __sk_destruct+0x6b6/0x8f0 net/core/sock.c:2152 sk_destruct net/core/sock.c:2167 [inline] __sk_free+0x175/0x460 net/core/sock.c:2178 sk_free+0x78/0xa0 net/core/sock.c:2189 deferred_put_nlk_sk+0x151/0x2f0 net/netlink/af_netlink.c:745 rcu_do_batch kernel/rcu/tree.c:2270 [inline] rcu_core+0x81f/0x1980 kernel/rcu/tree.c:2528 __do_softirq+0x1f7/0xad8 kernel/softirq.c:571 Last potentially related work creation: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:45 __kasan_record_aux_stack+0xbc/0xd0 mm/kasan/generic.c:481 __call_rcu_common.constprop.0+0x99/0x820 kernel/rcu/tree.c:2777 netlink_release+0xeff/0x1db0 net/netlink/af_netlink.c:815 __sock_release+0xcd/0x280 net/socket.c:650 sock_alloc_file-0x8/0x190 __fput+0x27c/0xa90 fs/file_table.c:320 task_work_run+0x16b/0x270 kernel/task_work.c:179 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] exit_to_user_mode_loop kernel/entry/common.c:171 [inline] exit_to_user_mode_prepare+0x23c/0x250 kernel/entry/common.c:203 __syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline] syscall_exit_to_user_mode+0x19/0x50 kernel/entry/common.c:296 do_syscall_64+0x42/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x63/0xcd The buggy address belongs to the object at ffff8880201ec000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 56 bytes inside of 2048-byte region [ffff8880201ec000, ffff8880201ec800) The buggy address belongs to the physical page: page:ffffea0000807a00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x201e8 head:ffffea0000807a00 order:3 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 ffff888011842000 dead000080080008 0000000000000000 raw: 0000000000000000 dead000000000001 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 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 1, tgid 1 (swapper/0), ts 8498126987, free_ts 0 prep_new_page mm/page_alloc.c:2538 [inline] get_page_from_freelist+0x10b5/0x2d50 mm/page_alloc.c:4287 __alloc_pages+0x1c7/0x5a0 mm/page_alloc.c:5546 alloc_page_interleave+0x1e/0x200 mm/mempolicy.c:2118 alloc_pages+0x22f/0x270 mm/mempolicy.c:2280 alloc_slab_page mm/slub.c:1794 [inline] allocate_slab+0x213/0x300 mm/slub.c:1939 new_slab mm/slub.c:1992 [inline] ___slab_alloc+0xa91/0x1400 mm/slub.c:3185 __slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3284 slab_alloc_node mm/slub.c:3369 [inline] __kmem_cache_alloc_node+0x191/0x3e0 mm/slub.c:3442 __do_kmalloc_node mm/slab_common.c:954 [inline] __kmalloc+0x44/0xc0 mm/slab_common.c:968 kmalloc_array include/linux/slab.h:634 [inline] kcalloc include/linux/slab.h:665 [inline] slip_init+0xbc/0x116 drivers/net/slip/slip.c:1300 do_one_initcall+0x13d/0x780 init/main.c:1306 do_initcall_level init/main.c:1379 [inline] do_initcalls init/main.c:1395 [inline] do_basic_setup init/main.c:1414 [inline] kernel_init_freeable+0x6f9/0x782 init/main.c:1634 kernel_init+0x1a/0x1d0 init/main.c:1522 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 page_owner free stack trace missing Memory state around the buggy address: ffff8880201ebf00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8880201ebf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8880201ec000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880201ec080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880201ec100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================