================================================================== BUG: KASAN: slab-out-of-bounds in md5_block+0x95/0x8d0 lib/crypto/md5.c:39 Read of size 64 at addr ffff88802ae844e0 by task syz.0.8202/32400 CPU: 3 UID: 0 PID: 32400 Comm: syz.0.8202 Tainted: G L syzkaller #0 PREEMPT(full) Tainted: [L]=SOFTLOCKUP 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 filename_lookup+0x202/0x590 fs/namei.c:2848 vfs_statx+0xff/0x3f0 fs/stat.c:357 vfs_fstatat fs/stat.c:377 [inline] vfs_lstat include/linux/fs.h:3253 [inline] __do_compat_sys_newlstat+0xaa/0x130 fs/stat.c:875 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:79 [inline] __do_fast_syscall_32+0x14d/0x8e0 arch/x86/entry/syscall_32.c:286 do_fast_syscall_32+0x32/0x70 arch/x86/entry/syscall_32.c:311 entry_SYSENTER_compat_after_hwframe+0x84/0x8e RIP: 0023:0xf700efbc Code: d2 74 05 c1 e8 0c 89 02 8b 5d fc 31 c0 c9 c3 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 0f 1f 00 51 52 55 89 e5 0f 34 cd 80 <5d> 5a 59 c3 90 2e 8d b4 26 00 00 00 00 8d b4 26 00 00 00 00 58 b8 RSP: 002b:00000000f53fd50c EFLAGS: 00000292 ORIG_RAX: 000000000000006b RAX: ffffffffffffffda RBX: 00000000800025c0 RCX: 0000000080002600 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000292 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 Allocated by task 29147: 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_node_track_caller_noprof+0x33d/0x870 mm/slub.c:5662 alloc_dr drivers/base/devres.c:141 [inline] devm_kmalloc+0xa5/0x2b0 drivers/base/devres.c:951 devm_kzalloc include/linux/device/devres.h:50 [inline] led_allocate_basic net/bluetooth/leds.c:62 [inline] hci_leds_init+0x31/0x1e0 net/bluetooth/leds.c:89 hci_register_dev+0x34a/0xcc0 net/bluetooth/hci_core.c:2608 __vhci_create_device+0x360/0x880 drivers/bluetooth/hci_vhci.c:465 vhci_create_device drivers/bluetooth/hci_vhci.c:493 [inline] vhci_get_user drivers/bluetooth/hci_vhci.c:550 [inline] vhci_write+0x2cd/0x4a0 drivers/bluetooth/hci_vhci.c:630 new_sync_write fs/read_write.c:575 [inline] vfs_write+0x6af/0x1040 fs/read_write.c:667 ksys_write+0x12a/0x250 fs/read_write.c:719 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:79 [inline] __do_fast_syscall_32+0x14d/0x8e0 arch/x86/entry/syscall_32.c:286 do_fast_syscall_32+0x32/0x70 arch/x86/entry/syscall_32.c:311 entry_SYSENTER_compat_after_hwframe+0x84/0x8e The buggy address belongs to the object at ffff88802ae84400 which belongs to the cache kmalloc-256 of size 256 The buggy address is located 224 bytes inside of allocated 256-byte region [ffff88802ae84400, ffff88802ae84500) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x2ae84 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 14222, tgid 14221 (syz.3.2411), ts 470567754480 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] __do_kmalloc_node mm/slub.c:5530 [inline] __kmalloc_noprof+0x677/0x840 mm/slub.c:5556 _kmalloc_noprof include/linux/slab.h:995 [inline] io_cache_alloc_new+0x45/0xe0 io_uring/alloc_cache.c:40 io_cache_alloc io_uring/alloc_cache.h:61 [inline] io_uring_alloc_async_data io_uring/io_uring.h:345 [inline] io_rw_alloc_async io_uring/rw.c:197 [inline] __io_prep_rw+0x21f/0x1050 io_uring/rw.c:255 io_prep_rw+0x76/0x2c0 io_uring/rw.c:310 io_prep_rwv io_uring/rw.c:332 [inline] io_prep_readv+0x78/0x2e0 io_uring/rw.c:347 io_init_req io_uring/io_uring.c:1997 [inline] io_submit_sqe io_uring/io_uring.c:2044 [inline] io_submit_sqes+0xa48/0x2760 io_uring/io_uring.c:2212 __do_sys_io_uring_enter+0xa88/0x1b10 io_uring/io_uring.c:2903 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:79 [inline] __do_fast_syscall_32+0x14d/0x8e0 arch/x86/entry/syscall_32.c:286 do_fast_syscall_32+0x32/0x70 arch/x86/entry/syscall_32.c:311 entry_SYSENTER_compat_after_hwframe+0x84/0x8e page last free pid 10 tgid 10 ts 468577468190 stack trace: reset_page_owner include/linux/page_owner.h:26 [inline] __free_pages_prepare mm/page_alloc.c:1402 [inline] free_pages_prepare+0x586/0xe00 mm/page_alloc.c:1447 __free_contig_range_common+0x14f/0x250 mm/page_alloc.c:7123 __free_contig_range mm/page_alloc.c:7168 [inline] free_pages_bulk+0x125/0x1f0 mm/page_alloc.c:5376 vm_area_free_pages+0xb2/0x2a0 mm/vmalloc.c:3498 vfree mm/vmalloc.c:3547 [inline] vfree+0xfc/0x850 mm/vmalloc.c:3521 delayed_vfree_work+0x56/0x80 mm/vmalloc.c:3451 process_one_work+0xac7/0x1b10 kernel/workqueue.c:3495 process_scheduled_works kernel/workqueue.c:3578 [inline] worker_thread+0x5ef/0xe50 kernel/workqueue.c:3659 kthread+0x373/0x450 kernel/kthread.c:436 ret_from_fork+0x730/0xd60 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: ffff88802ae84400: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88802ae84480: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88802ae84500: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff88802ae84580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88802ae84600: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ================================================================== ---------------- Code disassembly (best guess): 0: d2 74 05 c1 shlb %cl,-0x3f(%rbp,%rax,1) 4: e8 0c 89 02 8b call 0x8b028915 9: 5d pop %rbp a: fc cld b: 31 c0 xor %eax,%eax d: c9 leave e: c3 ret f: 90 nop 10: 90 nop 11: 90 nop 12: 90 nop 13: 90 nop 14: 90 nop 15: 90 nop 16: 90 nop 17: 90 nop 18: 90 nop 19: 90 nop 1a: 90 nop 1b: 90 nop 1c: 90 nop 1d: 90 nop 1e: 0f 1f 00 nopl (%rax) 21: 51 push %rcx 22: 52 push %rdx 23: 55 push %rbp 24: 89 e5 mov %esp,%ebp 26: 0f 34 sysenter 28: cd 80 int $0x80 * 2a: 5d pop %rbp <-- trapping instruction 2b: 5a pop %rdx 2c: 59 pop %rcx 2d: c3 ret 2e: 90 nop 2f: 2e 8d b4 26 00 00 00 cs lea 0x0(%rsi,%riz,1),%esi 36: 00 37: 8d b4 26 00 00 00 00 lea 0x0(%rsi,%riz,1),%esi 3e: 58 pop %rax 3f: b8 .byte 0xb8