================================================================== BUG: KASAN: slab-out-of-bounds in memcpy include/linux/fortify-string.h:225 [inline] BUG: KASAN: slab-out-of-bounds in decrypt_internal+0x1471/0x1d90 net/tls/tls_sw.c:1497 Read of size 16 at addr ffff88801be2a360 by task syz-executor159/3604 CPU: 0 PID: 3604 Comm: syz-executor159 Not tainted 5.16.0-rc8-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 print_address_description.constprop.0.cold+0x8d/0x320 mm/kasan/report.c:247 __kasan_report mm/kasan/report.c:433 [inline] kasan_report.cold+0x83/0xdf mm/kasan/report.c:450 check_region_inline mm/kasan/generic.c:183 [inline] kasan_check_range+0x13d/0x180 mm/kasan/generic.c:189 memcpy+0x20/0x60 mm/kasan/shadow.c:65 memcpy include/linux/fortify-string.h:225 [inline] decrypt_internal+0x1471/0x1d90 net/tls/tls_sw.c:1497 decrypt_skb_update+0x141/0xbc0 net/tls/tls_sw.c:1577 tls_sw_recvmsg+0x5f2/0x1570 net/tls/tls_sw.c:1848 inet6_recvmsg+0x11b/0x5e0 net/ipv6/af_inet6.c:660 sock_recvmsg_nosec net/socket.c:944 [inline] sock_recvmsg net/socket.c:962 [inline] sock_recvmsg net/socket.c:958 [inline] ____sys_recvmsg+0x2c4/0x600 net/socket.c:2628 ___sys_recvmsg+0x127/0x200 net/socket.c:2670 do_recvmmsg+0x24d/0x6d0 net/socket.c:2764 __sys_recvmmsg net/socket.c:2843 [inline] __do_sys_recvmmsg net/socket.c:2866 [inline] __se_sys_recvmmsg net/socket.c:2859 [inline] __x64_sys_recvmmsg+0x20b/0x260 net/socket.c:2859 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7fb06e8ab3f9 Code: 28 c3 e8 2a 14 00 00 66 2e 0f 1f 84 00 00 00 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 c0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007ffe8af05658 EFLAGS: 00000246 ORIG_RAX: 000000000000012b RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007fb06e8ab3f9 RDX: 0000000000000001 RSI: 0000000020002900 RDI: 0000000000000003 RBP: 00007fb06e86f3e0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007fb06e86f470 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 Allocated by task 3604: kasan_save_stack+0x1e/0x50 mm/kasan/common.c:38 kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:434 [inline] ____kasan_kmalloc mm/kasan/common.c:513 [inline] ____kasan_kmalloc mm/kasan/common.c:472 [inline] __kasan_kmalloc+0xa9/0xd0 mm/kasan/common.c:522 kmalloc include/linux/slab.h:595 [inline] tls_set_sw_offload+0x800/0x1430 net/tls/tls_sw.c:2525 do_tls_setsockopt_conf net/tls/tls_main.c:656 [inline] do_tls_setsockopt net/tls/tls_main.c:692 [inline] tls_setsockopt+0xb39/0xe70 net/tls/tls_main.c:712 __sys_setsockopt+0x2db/0x610 net/socket.c:2176 __do_sys_setsockopt net/socket.c:2187 [inline] __se_sys_setsockopt net/socket.c:2184 [inline] __x64_sys_setsockopt+0xba/0x150 net/socket.c:2184 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae The buggy address belongs to the object at ffff88801be2a360 which belongs to the cache kmalloc-16 of size 16 The buggy address is located 0 bytes inside of 16-byte region [ffff88801be2a360, ffff88801be2a370) The buggy address belongs to the page: page:ffffea00006f8a80 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1be2a flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 ffffea0000517380 dead000000000002 ffff888010c413c0 raw: 0000000000000000 0000000080800080 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 0x12cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY), pid 8, ts 8089498734, free_ts 8088137532 prep_new_page mm/page_alloc.c:2418 [inline] get_page_from_freelist+0xa72/0x2f50 mm/page_alloc.c:4149 __alloc_pages+0x1b2/0x500 mm/page_alloc.c:5369 alloc_pages+0x1a7/0x300 mm/mempolicy.c:2190 alloc_slab_page mm/slub.c:1793 [inline] allocate_slab mm/slub.c:1930 [inline] new_slab+0x32d/0x4a0 mm/slub.c:1993 ___slab_alloc+0x918/0xfe0 mm/slub.c:3022 __slab_alloc.constprop.0+0x4d/0xa0 mm/slub.c:3109 slab_alloc_node mm/slub.c:3200 [inline] slab_alloc mm/slub.c:3242 [inline] __kmalloc_track_caller+0x2e7/0x320 mm/slub.c:4925 kvasprintf+0xb5/0x150 lib/kasprintf.c:25 kvasprintf_const+0x60/0x190 lib/kasprintf.c:49 kobject_set_name_vargs+0x56/0x150 lib/kobject.c:289 dev_set_name+0xbb/0xf0 drivers/base/core.c:3182 scsi_sysfs_device_initialize+0x398/0xa30 drivers/scsi/scsi_sysfs.c:1608 scsi_alloc_sdev+0xa30/0xd60 drivers/scsi/scsi_scan.c:321 scsi_probe_and_add_lun+0x200b/0x3590 drivers/scsi/scsi_scan.c:1122 __scsi_scan_target+0x21f/0xdb0 drivers/scsi/scsi_scan.c:1604 scsi_scan_channel drivers/scsi/scsi_scan.c:1692 [inline] scsi_scan_channel+0x148/0x1e0 drivers/scsi/scsi_scan.c:1668 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1338 [inline] free_pcp_prepare+0x374/0x870 mm/page_alloc.c:1389 free_unref_page_prepare mm/page_alloc.c:3309 [inline] free_unref_page_list+0x1a9/0xfa0 mm/page_alloc.c:3425 release_pages+0x3f4/0x1480 mm/swap.c:980 tlb_batch_pages_flush mm/mmu_gather.c:49 [inline] tlb_flush_mmu_free mm/mmu_gather.c:242 [inline] tlb_flush_mmu mm/mmu_gather.c:249 [inline] tlb_finish_mmu+0x165/0x8c0 mm/mmu_gather.c:340 exit_mmap+0x1ea/0x630 mm/mmap.c:3172 __mmput+0x122/0x4b0 kernel/fork.c:1113 mmput+0x56/0x60 kernel/fork.c:1134 free_bprm+0x65/0x2e0 fs/exec.c:1481 kernel_execve+0x380/0x460 fs/exec.c:1978 call_usermodehelper_exec_async+0x2e3/0x580 kernel/umh.c:112 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 Memory state around the buggy address: ffff88801be2a200: fb fb fc fc fb fb fc fc fb fb fc fc fb fb fc fc ffff88801be2a280: fb fb fc fc fb fb fc fc fb fb fc fc fb fb fc fc >ffff88801be2a300: fb fb fc fc fb fb fc fc fa fb fc fc 00 04 fc fc ^ ffff88801be2a380: fa fb fc fc fa fb fc fc fb fb fc fc fa fb fc fc ffff88801be2a400: 00 00 fc fc fa fb fc fc fa fb fc fc fa fb fc fc ==================================================================