================================================================== BUG: KASAN: slab-out-of-bounds in crc16+0x1fb/0x280 lib/crc16.c:58 Read of size 1 at addr ffff8880175ea028 by task syz-executor.0/5882 CPU: 0 PID: 5882 Comm: syz-executor.0 Not tainted 6.3.0-syzkaller-07919-g6e98b09da931 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/14/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e7/0x2d0 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:319 [inline] print_report+0x163/0x540 mm/kasan/report.c:430 kasan_report+0x176/0x1b0 mm/kasan/report.c:536 crc16+0x1fb/0x280 lib/crc16.c:58 ext4_group_desc_csum+0x90f/0xc50 fs/ext4/super.c:3243 ext4_group_desc_csum_set+0x19b/0x240 fs/ext4/super.c:3266 ext4_mb_mark_diskspace_used+0xbd8/0x1490 fs/ext4/mballoc.c:3819 ext4_mb_new_blocks+0x11f9/0x44a0 fs/ext4/mballoc.c:5804 ext4_alloc_branch fs/ext4/indirect.c:340 [inline] ext4_ind_map_blocks+0x10d7/0x29e0 fs/ext4/indirect.c:635 ext4_map_blocks+0x9e7/0x1cf0 fs/ext4/inode.c:625 _ext4_get_block+0x238/0x6a0 fs/ext4/inode.c:779 ext4_block_write_begin+0x53e/0x15a0 fs/ext4/inode.c:1059 ext4_write_begin+0x60a/0x10a0 generic_perform_write+0x300/0x5e0 mm/filemap.c:3926 ext4_buffered_write_iter+0x122/0x3a0 fs/ext4/file.c:289 ext4_dio_write_iter fs/ext4/file.c:617 [inline] ext4_file_write_iter+0x1619/0x1930 fs/ext4/file.c:708 call_write_iter include/linux/fs.h:1854 [inline] new_sync_write fs/read_write.c:491 [inline] vfs_write+0x7da/0xbf0 fs/read_write.c:584 ksys_write+0x1a0/0x2c0 fs/read_write.c:637 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f0c5c28c169 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 19 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 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f0c5cf03168 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007f0c5c3abf80 RCX: 00007f0c5c28c169 RDX: 00000000fffffdef RSI: 0000000020000440 RDI: 0000000000000004 RBP: 00007f0c5c2e7ca1 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fff9f6700bf R14: 00007f0c5cf03300 R15: 0000000000022000 Allocated by task 24843: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4f/0x70 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:374 [inline] __kasan_kmalloc+0x98/0xb0 mm/kasan/common.c:383 kmalloc include/linux/slab.h:560 [inline] ima_add_digest_entry+0x56/0x350 security/integrity/ima/ima_queue.c:99 ima_add_template_entry+0x6a0/0x7b0 security/integrity/ima/ima_queue.c:179 ima_store_template security/integrity/ima/ima_api.c:123 [inline] ima_store_measurement+0x368/0x6f0 security/integrity/ima/ima_api.c:375 process_measurement+0x11b9/0x1ce0 security/integrity/ima/ima_main.c:349 ima_file_check+0xf1/0x170 security/integrity/ima/ima_main.c:539 do_open fs/namei.c:3562 [inline] path_openat+0x280a/0x3170 fs/namei.c:3715 do_filp_open+0x234/0x490 fs/namei.c:3742 do_sys_openat2+0x13f/0x500 fs/open.c:1356 do_sys_open fs/open.c:1372 [inline] __do_sys_open fs/open.c:1380 [inline] __se_sys_open fs/open.c:1376 [inline] __x64_sys_open+0x225/0x270 fs/open.c:1376 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd The buggy address belongs to the object at ffff8880175ea000 which belongs to the cache kmalloc-64 of size 64 The buggy address is located 0 bytes to the right of allocated 40-byte region [ffff8880175ea000, ffff8880175ea028) The buggy address belongs to the physical page: page:ffffea00005d7a80 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x175ea anon flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 ffff888012441640 ffffea0000abe740 dead000000000005 raw: 0000000000000000 0000000000200020 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 0x112c40(GFP_NOFS|__GFP_NOWARN|__GFP_NORETRY|__GFP_HARDWALL), pid 5295, tgid 5295 (udevd), ts 1427058064742, free_ts 1427037648816 prep_new_page mm/page_alloc.c:2553 [inline] get_page_from_freelist+0x3246/0x33c0 mm/page_alloc.c:4326 __alloc_pages+0x255/0x670 mm/page_alloc.c:5592 alloc_slab_page+0x6a/0x160 mm/slub.c:1851 allocate_slab mm/slub.c:1998 [inline] new_slab+0x84/0x2f0 mm/slub.c:2051 ___slab_alloc+0xa85/0x10a0 mm/slub.c:3193 __slab_alloc mm/slub.c:3292 [inline] __slab_alloc_node mm/slub.c:3345 [inline] slab_alloc_node mm/slub.c:3442 [inline] __kmem_cache_alloc_node+0x1b8/0x290 mm/slub.c:3491 __do_kmalloc_node mm/slab_common.c:965 [inline] __kmalloc+0xa8/0x230 mm/slab_common.c:979 kmalloc include/linux/slab.h:564 [inline] kzalloc include/linux/slab.h:681 [inline] tomoyo_encode2 security/tomoyo/realpath.c:45 [inline] tomoyo_encode+0x26f/0x530 security/tomoyo/realpath.c:80 tomoyo_realpath_from_path+0x598/0x5e0 security/tomoyo/realpath.c:283 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_path_number_perm+0x210/0x840 security/tomoyo/file.c:723 tomoyo_path_mknod+0x176/0x1b0 security/tomoyo/tomoyo.c:251 security_path_mknod+0xf5/0x150 security/security.c:1676 may_o_create fs/namei.c:3238 [inline] lookup_open fs/namei.c:3379 [inline] open_last_lookups fs/namei.c:3484 [inline] path_openat+0xc30/0x3170 fs/namei.c:3712 do_filp_open+0x234/0x490 fs/namei.c:3742 do_sys_openat2+0x13f/0x500 fs/open.c:1356 do_sys_open fs/open.c:1372 [inline] __do_sys_openat fs/open.c:1388 [inline] __se_sys_openat fs/open.c:1383 [inline] __x64_sys_openat+0x247/0x290 fs/open.c:1383 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1454 [inline] free_pcp_prepare mm/page_alloc.c:1504 [inline] free_unref_page_prepare+0xe2f/0xe70 mm/page_alloc.c:3388 free_unref_page+0x37/0x3f0 mm/page_alloc.c:3483 pipe_buf_release include/linux/pipe_fs_i.h:203 [inline] pipe_read+0x6e5/0x12b0 fs/pipe.c:324 call_read_iter include/linux/fs.h:1848 [inline] new_sync_read fs/read_write.c:389 [inline] vfs_read+0x7a0/0xb80 fs/read_write.c:470 ksys_read+0x1a0/0x2c0 fs/read_write.c:613 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Memory state around the buggy address: ffff8880175e9f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8880175e9f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff8880175ea000: 00 00 00 00 00 fc fc fc fc fc fc fc fc fc fc fc ^ ffff8880175ea080: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff8880175ea100: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ==================================================================