================================================================== BUG: KASAN: slab-out-of-bounds in md5_block+0x95/0x8d0 lib/crypto/md5.c:39 Read of size 64 at addr ffff88803ce35ce0 by task syz.4.158/6680 CPU: 2 UID: 0 PID: 6680 Comm: syz.4.158 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 lib/dump_stack.c:94 [inline] dump_stack_lvl+0x100/0x190 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0x13d/0x4b0 mm/kasan/report.c:482 kasan_report+0xdf/0x1c0 mm/kasan/report.c:595 check_region_inline mm/kasan/generic.c:186 [inline] kasan_check_range+0x10f/0x1e0 mm/kasan/generic.c:200 __asan_memcpy+0x23/0x60 mm/kasan/shadow.c:105 md5_block+0x95/0x8d0 lib/crypto/md5.c:39 md5_blocks lib/crypto/md5.c:125 [inline] md5_update+0xf7/0x210 lib/crypto/md5.c:160 md5+0xc7/0x120 lib/crypto/md5.c:201 ecryptfs_write_tag_70_packet+0x880/0x1410 fs/ecryptfs/keystore.c:741 ecryptfs_encrypt_filename fs/ecryptfs/crypto.c:1378 [inline] ecryptfs_encrypt_and_encode_filename+0x428/0xa60 fs/ecryptfs/crypto.c:1789 ecryptfs_lookup+0x1f7/0x830 fs/ecryptfs/inode.c:402 __lookup_slow+0x155/0x320 fs/namei.c:1925 lookup_slow+0x54/0x80 fs/namei.c:1942 walk_component fs/namei.c:2288 [inline] lookup_last fs/namei.c:2795 [inline] path_lookupat+0x5e8/0xc40 fs/namei.c:2819 do_o_path fs/namei.c:4987 [inline] path_openat+0x16ed/0x23f0 fs/namei.c:5009 do_file_open+0x20e/0x430 fs/namei.c:5045 do_sys_openat2+0x163/0x1d0 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+0x12d/0x210 fs/open.c:1460 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x123/0x7b0 arch/x86/entry/syscall_64.c:89 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f11d89a94d9 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:00007f11d992e028 EFLAGS: 00000246 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 00007f11d8c25fa0 RCX: 00007f11d89a94d9 RDX: 0000000000240000 RSI: 0000200000000140 RDI: ffffffffffffff9c RBP: 00007f11d8a3804e R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000041 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f11d8c26038 R14: 00007f11d8c25fa0 R15: 00007ffc402202c8 Allocated by task 5777: kasan_save_stack+0x30/0x50 mm/kasan/common.c:57 kasan_save_track+0x14/0x30 mm/kasan/common.c:78 poison_kmalloc_redzone mm/kasan/common.c:409 [inline] __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:426 kasan_kmalloc include/linux/kasan.h:263 [inline] __do_kmalloc_node mm/slub.c:5531 [inline] __kmalloc_flags_noprof+0x370/0x8e0 mm/slub.c:5719 _kmalloc_flags_noprof mm/slab.h:55 [inline] __alloc_empty_sheaf mm/slub.c:2854 [inline] alloc_empty_sheaf mm/slub.c:2874 [inline] __pcs_replace_empty_main+0x3fa/0x650 mm/slub.c:4806 alloc_from_pcs mm/slub.c:4887 [inline] slab_alloc_node mm/slub.c:5021 [inline] __kmalloc_cache_noprof+0x4ef/0x6d0 mm/slub.c:5676 _kmalloc_noprof include/linux/slab.h:991 [inline] _kzalloc_noprof include/linux/slab.h:1312 [inline] kernfs_get_open_node fs/kernfs/file.c:537 [inline] kernfs_fop_open+0xcc7/0x10f0 fs/kernfs/file.c:725 do_dentry_open+0x674/0x1470 fs/open.c:1000 vfs_open_consume+0xcc/0x460 fs/open.c:1131 do_open fs/namei.c:4851 [inline] path_openat+0x1547/0x23f0 fs/namei.c:5016 do_file_open+0x20e/0x430 fs/namei.c:5045 do_sys_openat2+0x163/0x1d0 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+0x12d/0x210 fs/open.c:1460 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x123/0x7b0 arch/x86/entry/syscall_64.c:89 entry_SYSCALL_64_after_hwframe+0x77/0x7f Last potentially related work creation: kasan_save_stack+0x30/0x50 mm/kasan/common.c:57 kasan_record_aux_stack+0xa7/0xc0 mm/kasan/generic.c:556 __call_rcu_common.constprop.0+0x7b/0x2b0 kernel/rcu/tree.c:3287 __kfree_rcu_sheaf+0x33a/0x7e0 mm/slub.c:6334 kfree_rcu_sheaf mm/slab_common.c:1689 [inline] kvfree_call_rcu+0x1c0/0x4e0 mm/slab_common.c:2044 kernfs_unlink_open_file+0x3bc/0x4c0 fs/kernfs/file.c:611 kernfs_fop_release+0xe9/0x1f0 fs/kernfs/file.c:790 __fput+0x3fb/0xb50 fs/file_table.c:512 fput_close_sync+0x118/0x250 fs/file_table.c:618 filp_close_sync+0x75/0xa0 fs/open.c:1574 __do_sys_close fs/open.c:1597 [inline] __se_sys_close fs/open.c:1584 [inline] __x64_sys_close+0x81/0x110 fs/open.c:1584 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x123/0x7b0 arch/x86/entry/syscall_64.c:89 entry_SYSCALL_64_after_hwframe+0x77/0x7f Second to last potentially related work creation: kasan_save_stack+0x30/0x50 mm/kasan/common.c:57 kasan_record_aux_stack+0xa7/0xc0 mm/kasan/generic.c:556 __call_rcu_common.constprop.0+0x7b/0x2b0 kernel/rcu/tree.c:3287 __kfree_rcu_sheaf+0x33a/0x7e0 mm/slub.c:6334 kfree_rcu_sheaf mm/slab_common.c:1689 [inline] kvfree_call_rcu+0x1c0/0x4e0 mm/slab_common.c:2044 kernfs_unlink_open_file+0x3bc/0x4c0 fs/kernfs/file.c:611 kernfs_fop_release+0xe9/0x1f0 fs/kernfs/file.c:790 __fput+0x3fb/0xb50 fs/file_table.c:512 fput_close_sync+0x118/0x250 fs/file_table.c:618 filp_close_sync+0x75/0xa0 fs/open.c:1574 __do_sys_close fs/open.c:1597 [inline] __se_sys_close fs/open.c:1584 [inline] __x64_sys_close+0x81/0x110 fs/open.c:1584 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x123/0x7b0 arch/x86/entry/syscall_64.c:89 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff88803ce35c00 which belongs to the cache kmalloc-256 of size 256 The buggy address is located 224 bytes inside of allocated 256-byte region [ffff88803ce35c00, ffff88803ce35d00) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x3ce34 head: order:1 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000040 ffff88801d442b40 dead000000000100 dead000000000122 raw: 0000000000000000 0000000000100010 00000000f5000000 0000000000000000 head: 00fff00000000040 ffff88801d442b40 dead000000000100 dead000000000122 head: 0000000000000000 0000000000100010 00000000f5000000 0000000000000000 head: 00fff00000000001 ffffffffffffff81 00000000ffffffff 00000000ffffffff head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000002 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 1, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5776, tgid 5776 (syz-executor), ts 47889312894 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0xfd/0x120 mm/page_alloc.c:1860 prep_new_page mm/page_alloc.c:1868 [inline] get_page_from_freelist+0xdae/0x2c80 mm/page_alloc.c:3950 __alloc_frozen_pages_noprof+0x2ad/0x31e0 mm/page_alloc.c:5492 alloc_slab_page mm/slub.c:3384 [inline] allocate_slab mm/slub.c:3499 [inline] new_slab+0xb1/0x6d0 mm/slub.c:3550 refill_objects+0xe3/0x410 mm/slub.c:7539 refill_sheaf mm/slub.c:2917 [inline] __pcs_replace_empty_main+0x35e/0x650 mm/slub.c:4811 alloc_from_pcs mm/slub.c:4887 [inline] slab_alloc_node mm/slub.c:5021 [inline] __kmalloc_cache_noprof+0x4ef/0x6d0 mm/slub.c:5676 _kmalloc_noprof include/linux/slab.h:991 [inline] _kzalloc_noprof include/linux/slab.h:1312 [inline] nsim_dev_traps_init+0xa3/0x5d0 drivers/net/netdevsim/dev.c:867 nsim_drv_probe+0x712/0x1350 drivers/net/netdevsim/dev.c:1625 call_driver_probe drivers/base/dd.c:629 [inline] really_probe+0x241/0xa60 drivers/base/dd.c:707 __driver_probe_device+0x210/0x460 drivers/base/dd.c:869 driver_probe_device+0x4a/0x140 drivers/base/dd.c:899 __device_attach_driver+0x1df/0x320 drivers/base/dd.c:1027 bus_for_each_drv+0x159/0x1e0 drivers/base/bus.c:500 __device_attach+0x1e4/0x4c0 drivers/base/dd.c:1131 device_initial_probe+0xaf/0xf0 drivers/base/dd.c:1190 page last free pid 5776 tgid 5776 ts 47864625718 stack trace: reset_page_owner include/linux/page_owner.h:26 [inline] __free_pages_prepare mm/page_alloc.c:1402 [inline] __free_frozen_pages+0x7b1/0x10f0 mm/page_alloc.c:2958 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x47/0xf0 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x1a0/0x1f0 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x69/0x90 mm/kasan/common.c:361 kasan_slab_alloc include/linux/kasan.h:253 [inline] slab_post_alloc_hook mm/slub.c:4720 [inline] slab_alloc_node mm/slub.c:5033 [inline] __kmalloc_cache_noprof+0x278/0x6d0 mm/slub.c:5676 _kmalloc_noprof include/linux/slab.h:991 [inline] _kzalloc_noprof include/linux/slab.h:1312 [inline] ref_tracker_alloc+0x18b/0x600 lib/ref_tracker.c:270 __netdev_tracker_alloc include/linux/netdevice.h:4556 [inline] netdev_hold include/linux/netdevice.h:4585 [inline] netdev_hold include/linux/netdevice.h:4580 [inline] netdev_queue_add_kobject net/core/net-sysfs.c:2014 [inline] netdev_queue_update_kobjects+0x2e1/0x6f0 net/core/net-sysfs.c:2076 register_queue_kobjects net/core/net-sysfs.c:2139 [inline] netdev_register_kobject+0x2e9/0x410 net/core/net-sysfs.c:2385 register_netdevice+0x1313/0x26b0 net/core/dev.c:11720 geneve_configure drivers/net/geneve.c:2106 [inline] geneve_newlink+0x9a2/0x1250 drivers/net/geneve.c:2452 rtnl_newlink_create net/core/rtnetlink.c:4006 [inline] __rtnl_newlink net/core/rtnetlink.c:4135 [inline] rtnl_newlink+0x1697/0x2620 net/core/rtnetlink.c:4252 rtnetlink_rcv_msg+0x95e/0xe90 net/core/rtnetlink.c:7169 netlink_rcv_skb+0x159/0x420 net/netlink/af_netlink.c:2584 netlink_unicast_kernel net/netlink/af_netlink.c:1335 [inline] netlink_unicast+0x668/0x950 net/netlink/af_netlink.c:1361 netlink_sendmsg+0x9ac/0x10c0 net/netlink/af_netlink.c:1920 sock_sendmsg_nosec net/socket.c:800 [inline] __sock_sendmsg net/socket.c:818 [inline] __sys_sendto+0x492/0x4e0 net/socket.c:2283 Memory state around the buggy address: ffff88803ce35c00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88803ce35c80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88803ce35d00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff88803ce35d80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88803ce35e00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================