fscrypt: AES-256-CBC-CTS using implementation "cts(cbc(ecb(aes-lib)))" ================================================================== BUG: KASAN: slab-out-of-bounds in crc32c_base lib/crc/crc32-main.c:54 [inline] BUG: KASAN: slab-out-of-bounds in crc32c_arch lib/crc/x86/crc32.h:44 [inline] BUG: KASAN: slab-out-of-bounds in crc32c+0x3cc/0x470 lib/crc/crc32-main.c:86 Read of size 1 at addr ffff88816a0ea0b0 by task syz.0.17/6006 CPU: 1 UID: 0 PID: 6006 Comm: syz.0.17 Not tainted syzkaller #0 PREEMPT(full) Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 Call Trace: dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0xba/0x230 mm/kasan/report.c:482 kasan_report+0x117/0x150 mm/kasan/report.c:595 crc32c_base lib/crc/crc32-main.c:54 [inline] crc32c_arch lib/crc/x86/crc32.h:44 [inline] crc32c+0x3cc/0x470 lib/crc/crc32-main.c:86 ext4_chksum fs/ext4/ext4.h:2553 [inline] ext4_xattr_block_csum fs/ext4/xattr.c:147 [inline] ext4_xattr_block_csum_set+0x241/0x330 fs/ext4/xattr.c:172 ext4_xattr_block_set+0x2494/0x2b00 fs/ext4/xattr.c:2165 ext4_xattr_set_handle+0xe37/0x14d0 fs/ext4/xattr.c:2458 ext4_set_context+0x233/0x560 fs/ext4/crypto.c:166 fscrypt_set_context+0x397/0x460 fs/crypto/policy.c:791 __ext4_new_inode+0x3158/0x3d20 fs/ext4/ialloc.c:1314 ext4_mkdir+0x3da/0xbf0 fs/ext4/namei.c:3005 vfs_mkdir+0x413/0x630 fs/namei.c:5233 filename_mkdirat+0x285/0x510 fs/namei.c:5266 __do_sys_mkdirat fs/namei.c:5287 [inline] __se_sys_mkdirat+0x35/0x150 fs/namei.c:5284 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x14d/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fb60ad9c799 Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 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 e8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fb60bd17028 EFLAGS: 00000246 ORIG_RAX: 0000000000000102 RAX: ffffffffffffffda RBX: 00007fb60b015fa0 RCX: 00007fb60ad9c799 RDX: 00000000000001c0 RSI: 0000200000000180 RDI: ffffffffffffff9c RBP: 00007fb60ae32bd9 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fb60b016038 R14: 00007fb60b015fa0 R15: 00007fff4bbf7228 Allocated by task 1: kasan_save_stack mm/kasan/common.c:57 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:78 unpoison_slab_object mm/kasan/common.c:340 [inline] __kasan_slab_alloc+0x6c/0x80 mm/kasan/common.c:366 kasan_slab_alloc include/linux/kasan.h:253 [inline] slab_post_alloc_hook mm/slub.c:4515 [inline] slab_alloc_node mm/slub.c:4844 [inline] kmem_cache_alloc_noprof+0x2bc/0x650 mm/slub.c:4851 __kernfs_new_node+0xe9/0x8e0 fs/kernfs/dir.c:637 kernfs_new_node+0x102/0x210 fs/kernfs/dir.c:718 __kernfs_create_file+0x4b/0x2e0 fs/kernfs/file.c:1057 sysfs_add_file_mode_ns+0x238/0x300 fs/sysfs/file.c:313 create_files fs/sysfs/group.c:82 [inline] internal_create_group+0x673/0x1180 fs/sysfs/group.c:189 internal_create_groups fs/sysfs/group.c:229 [inline] sysfs_create_groups+0x59/0x120 fs/sysfs/group.c:255 device_add_groups drivers/base/core.c:2836 [inline] device_add_attrs+0xdd/0x5b0 drivers/base/core.c:2900 device_add+0x496/0xb70 drivers/base/core.c:3643 __video_register_device+0x3e40/0x4d20 drivers/media/v4l2-core/v4l2-dev.c:1076 video_register_device include/media/v4l2-dev.h:390 [inline] vivid_create_devnodes+0xc5e/0x2bf0 drivers/media/test-drivers/vivid/vivid-core.c:1471 vivid_create_instance drivers/media/test-drivers/vivid/vivid-core.c:2042 [inline] vivid_probe+0x510d/0x72b0 drivers/media/test-drivers/vivid/vivid-core.c:2095 platform_probe+0xf9/0x190 drivers/base/platform.c:1446 call_driver_probe drivers/base/dd.c:-1 [inline] really_probe+0x267/0xaf0 drivers/base/dd.c:661 __driver_probe_device+0x18c/0x320 drivers/base/dd.c:803 driver_probe_device+0x4f/0x240 drivers/base/dd.c:833 __driver_attach+0x3e7/0x710 drivers/base/dd.c:1227 bus_for_each_dev+0x23b/0x2c0 drivers/base/bus.c:383 bus_add_driver+0x345/0x670 drivers/base/bus.c:715 driver_register+0x23a/0x320 drivers/base/driver.c:249 vivid_init+0x561/0x5f0 drivers/media/test-drivers/vivid/vivid-core.c:2294 do_one_initcall+0x250/0x8d0 init/main.c:1382 do_initcall_level+0x104/0x190 init/main.c:1444 do_initcalls+0x59/0xa0 init/main.c:1460 kernel_init_freeable+0x2a6/0x3e0 init/main.c:1692 kernel_init+0x1d/0x1d0 init/main.c:1582 ret_from_fork+0x51e/0xb90 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 The buggy address belongs to the object at ffff88816a0ea000 which belongs to the cache kernfs_node_cache of size 176 The buggy address is located 0 bytes to the right of allocated 176-byte region [ffff88816a0ea000, ffff88816a0ea0b0) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x16a0ea flags: 0x57ff00000000000(node=1|zone=2|lastcpupid=0x7ff) page_type: f5(slab) raw: 057ff00000000000 ffff8881012d3dc0 dead000000000122 0000000000000000 raw: 0000000000000000 0000000800110011 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 0xd2cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 1, tgid 1 (swapper/0), ts 19200276917, free_ts 4632825873 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x231/0x280 mm/page_alloc.c:1889 prep_new_page mm/page_alloc.c:1897 [inline] get_page_from_freelist+0x24dc/0x2580 mm/page_alloc.c:3962 __alloc_frozen_pages_noprof+0x18d/0x380 mm/page_alloc.c:5250 alloc_slab_page mm/slub.c:3269 [inline] allocate_slab+0x77/0x660 mm/slub.c:3458 new_slab mm/slub.c:3516 [inline] refill_objects+0x331/0x3c0 mm/slub.c:7153 refill_sheaf mm/slub.c:2818 [inline] __pcs_replace_empty_main+0x2b9/0x620 mm/slub.c:4592 alloc_from_pcs mm/slub.c:4695 [inline] slab_alloc_node mm/slub.c:4829 [inline] kmem_cache_alloc_noprof+0x37d/0x650 mm/slub.c:4851 __kernfs_new_node+0xe9/0x8e0 fs/kernfs/dir.c:637 kernfs_new_node+0x102/0x210 fs/kernfs/dir.c:718 kernfs_create_link+0xa7/0x200 fs/kernfs/symlink.c:39 sysfs_do_create_link_sd+0x83/0x110 fs/sysfs/symlink.c:44 device_create_sys_dev_entry+0x122/0x190 drivers/base/core.c:3515 device_add+0x733/0xb70 drivers/base/core.c:3659 cdev_device_add+0x1d6/0x390 fs/char_dev.c:553 media_devnode_register+0x287/0x420 drivers/media/mc/mc-devnode.c:247 __media_device_register+0x15c/0x3c0 drivers/media/mc/mc-device.c:753 page last free pid 10 tgid 10 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] __free_pages_prepare mm/page_alloc.c:1433 [inline] __free_frozen_pages+0xc2b/0xdb0 mm/page_alloc.c:2978 vfree+0x25a/0x400 mm/vmalloc.c:3479 delayed_vfree_work+0x55/0x80 mm/vmalloc.c:3398 process_one_work kernel/workqueue.c:3275 [inline] process_scheduled_works+0xb02/0x1830 kernel/workqueue.c:3358 worker_thread+0xa50/0xfc0 kernel/workqueue.c:3439 kthread+0x388/0x470 kernel/kthread.c:467 ret_from_fork+0x51e/0xb90 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 Memory state around the buggy address: ffff88816a0e9f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88816a0ea000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88816a0ea080: 00 00 00 00 00 00 fc fc fc fc fc fc fc fc 00 00 ^ ffff88816a0ea100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88816a0ea180: 00 00 00 00 fc fc fc fc fc fc fc fc 00 00 00 00 ==================================================================