================================================================== BUG: KASAN: slab-out-of-bounds in md5_block lib/crypto/md5.c:39 [inline] BUG: KASAN: slab-out-of-bounds in md5_blocks+0x120/0xbd0 lib/crypto/md5.c:125 Read of size 64 at addr ffff88803550a820 by task syz.0.0/5358 CPU: 0 UID: 0 PID: 5358 Comm: syz.0.0 Not tainted syzkaller #0 PREEMPT(full) Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 Call Trace: dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120 print_address_description+0x55/0x1e0 mm/kasan/report.c:378 print_report+0x58/0x70 mm/kasan/report.c:482 kasan_report+0x117/0x150 mm/kasan/report.c:595 check_region_inline mm/kasan/generic.c:-1 [inline] kasan_check_range+0x264/0x2c0 mm/kasan/generic.c:200 __asan_memcpy+0x29/0x70 mm/kasan/shadow.c:105 md5_block lib/crypto/md5.c:39 [inline] md5_blocks+0x120/0xbd0 lib/crypto/md5.c:125 md5_update+0xef/0x150 lib/crypto/md5.c:160 md5+0xed/0x180 lib/crypto/md5.c:201 ecryptfs_write_tag_70_packet+0x820/0x12e0 fs/ecryptfs/keystore.c:741 ecryptfs_encrypt_filename fs/ecryptfs/crypto.c:1378 [inline] ecryptfs_encrypt_and_encode_filename+0x576/0x1580 fs/ecryptfs/crypto.c:1789 ecryptfs_lookup+0x20e/0x780 fs/ecryptfs/inode.c:402 lookup_open+0xa54/0x1ae0 fs/namei.c:4536 open_last_lookups fs/namei.c:4774 [inline] path_openat+0x70c/0x20f0 fs/namei.c:5013 do_file_open+0x23e/0x4a0 fs/namei.c:5045 do_sys_openat2+0x115/0x200 fs/open.c:1443 do_sys_open fs/open.c:1449 [inline] __do_sys_openat fs/open.c:1465 [inline] __se_sys_openat fs/open.c:1460 [inline] __x64_sys_openat+0x138/0x170 fs/open.c:1460 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x16a/0x530 arch/x86/entry/syscall_64.c:89 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f2684da94d9 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:00007f2685c7afe8 EFLAGS: 00000246 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 00007f2685026090 RCX: 00007f2684da94d9 RDX: 0000000000000002 RSI: 0000200000000580 RDI: ffffffffffffff9c RBP: 00007f2684e3804e R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f2685026128 R14: 00007f2685026090 R15: 00007ffca6640f88 Allocated by task 1375: kasan_save_stack mm/kasan/common.c:57 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:78 poison_kmalloc_redzone mm/kasan/common.c:409 [inline] __kasan_kmalloc+0x93/0xb0 mm/kasan/common.c:426 kasan_kmalloc include/linux/kasan.h:263 [inline] __kmalloc_cache_noprof+0x31c/0x600 mm/slub.c:5680 _kmalloc_noprof include/linux/slab.h:991 [inline] _kzalloc_noprof include/linux/slab.h:1312 [inline] ref_tracker_alloc+0x221/0x530 lib/ref_tracker.c:270 __netdev_tracker_alloc include/linux/netdevice.h:4556 [inline] netdev_hold include/linux/netdevice.h:4585 [inline] dst_init+0xbe/0x470 net/core/dst.c:52 dst_alloc+0x12a/0x170 net/core/dst.c:94 ip6_dst_alloc net/ipv6/route.c:365 [inline] icmp6_dst_alloc+0x72/0x430 net/ipv6/route.c:3344 mld_sendpack+0x697/0xe10 net/ipv6/mcast.c:1879 mld_send_cr net/ipv6/mcast.c:2191 [inline] mld_ifc_work+0x842/0xd60 net/ipv6/mcast.c:2739 process_one_work kernel/workqueue.c:3495 [inline] process_scheduled_works+0xc3d/0x1630 kernel/workqueue.c:3578 worker_thread+0xa47/0xfb0 kernel/workqueue.c:3659 kthread+0x38b/0x480 kernel/kthread.c:436 ret_from_fork+0x514/0xb70 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 ffff88803550a800 which belongs to the cache kmalloc-32 of size 32 The buggy address is located 0 bytes to the right of allocated 32-byte region [ffff88803550a800, ffff88803550a820) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x3550a flags: 0x4fff00000000000(node=1|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 04fff00000000000 ffff88801c841780 dead000000000100 dead000000000122 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 0xd2800(GFP_NOWAIT|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 3836, tgid 3836 (kworker/u4:0), ts 29310877099 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0x1f9/0x250 mm/page_alloc.c:1860 prep_new_page mm/page_alloc.c:1868 [inline] get_page_from_freelist+0x225d/0x22e0 mm/page_alloc.c:3950 __alloc_frozen_pages_noprof+0x211/0x450 mm/page_alloc.c:5492 alloc_slab_page mm/slub.c:3384 [inline] allocate_slab+0x7d/0x5e0 mm/slub.c:3499 new_slab mm/slub.c:3550 [inline] refill_objects+0x2d5/0x350 mm/slub.c:7539 refill_sheaf mm/slub.c:2917 [inline] __pcs_replace_empty_main+0x2c8/0x6c0 mm/slub.c:4811 alloc_from_pcs mm/slub.c:4887 [inline] slab_alloc_node mm/slub.c:5021 [inline] __kmalloc_cache_noprof+0x396/0x600 mm/slub.c:5676 _kmalloc_noprof include/linux/slab.h:991 [inline] slab_free_hook mm/slub.c:2732 [inline] slab_free mm/slub.c:6630 [inline] kmem_cache_free+0x156/0x650 mm/slub.c:6757 __fput_deferred+0x2ae/0x390 fs/file_table.c:568 fput_close+0x11f/0x240 fs/file_table.c:630 path_openat+0x198e/0x20f0 fs/namei.c:5025 do_file_open+0x23e/0x4a0 fs/namei.c:5045 do_open_execat+0x12b/0x590 fs/exec.c:786 alloc_bprm+0x24/0x640 fs/exec.c:1514 class_bprm_constructor fs/exec.c:1580 [inline] kernel_execve+0x85/0x9a0 fs/exec.c:1976 call_usermodehelper_exec_async+0x20f/0x360 kernel/umh.c:107 page last free pid 13 tgid 13 ts 29310339808 stack trace: reset_page_owner include/linux/page_owner.h:26 [inline] __free_pages_prepare mm/page_alloc.c:1402 [inline] __free_frozen_pages+0xd1a/0xe10 mm/page_alloc.c:2958 __kasan_populate_vmalloc_do mm/kasan/shadow.c:393 [inline] __kasan_populate_vmalloc+0x1a8/0x1c0 mm/kasan/shadow.c:424 kasan_populate_vmalloc include/linux/kasan.h:580 [inline] alloc_vmap_area+0xd10/0x1410 mm/vmalloc.c:2151 __get_vm_area_node+0x200/0x2f0 mm/vmalloc.c:3281 __vmalloc_node_range_noprof+0x36e/0x16f0 mm/vmalloc.c:4112 __vmalloc_node_noprof+0xc2/0x100 mm/vmalloc.c:4213 alloc_thread_stack_node kernel/fork.c:359 [inline] dup_task_struct+0x2c6/0xa00 kernel/fork.c:931 copy_process+0x7ea/0x4510 kernel/fork.c:2150 kernel_clone+0x2d7/0x940 kernel/fork.c:2798 user_mode_thread+0x115/0x180 kernel/fork.c:2875 call_usermodehelper_exec_work+0x5c/0x230 kernel/umh.c:169 process_one_work kernel/workqueue.c:3495 [inline] process_scheduled_works+0xc3d/0x1630 kernel/workqueue.c:3578 worker_thread+0xa47/0xfb0 kernel/workqueue.c:3659 kthread+0x38b/0x480 kernel/kthread.c:436 ret_from_fork+0x514/0xb70 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: ffff88803550a700: fa fb fb fb fc fc fc fc 00 00 04 fc fc fc fc fc ffff88803550a780: 00 00 00 00 fc fc fc fc 00 00 00 00 fc fc fc fc >ffff88803550a800: 00 00 00 00 fc fc fc fc fa fb fb fb fc fc fc fc ^ ffff88803550a880: 00 00 00 00 fc fc fc fc 00 00 00 00 fc fc fc fc ffff88803550a900: 00 00 00 00 fc fc fc fc 00 00 00 03 fc fc fc fc ==================================================================