kvm: apic: phys broadcast and lowest prio ================================================================== BUG: KASAN: use-after-free in memcpy include/linux/string.h:352 [inline] BUG: KASAN: use-after-free in crypto_gcm_init_common+0xe2/0x710 crypto/gcm.c:181 Read of size 12 at addr ffff8881b88d5ac0 by task kworker/1:3/6312 CPU: 1 PID: 6312 Comm: kworker/1:3 Not tainted 4.20.0-rc3+ #244 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: pencrypt padata_parallel_worker Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x244/0x39d lib/dump_stack.c:113 print_address_description.cold.7+0x9/0x1ff mm/kasan/report.c:256 kasan_report_error mm/kasan/report.c:354 [inline] kasan_report.cold.8+0x242/0x309 mm/kasan/report.c:412 check_memory_region_inline mm/kasan/kasan.c:260 [inline] check_memory_region+0x13e/0x1b0 mm/kasan/kasan.c:267 memcpy+0x23/0x50 mm/kasan/kasan.c:302 memcpy include/linux/string.h:352 [inline] crypto_gcm_init_common+0xe2/0x710 crypto/gcm.c:181 crypto_gcm_encrypt+0xe2/0x6b0 crypto/gcm.c:479 crypto_aead_encrypt include/crypto/aead.h:364 [inline] pcrypt_aead_enc+0xd6/0x340 crypto/pcrypt.c:143 padata_parallel_worker+0x49d/0x760 kernel/padata.c:86 process_one_work+0xc90/0x1c40 kernel/workqueue.c:2153 worker_thread+0x17f/0x1390 kernel/workqueue.c:2296 kthread+0x35a/0x440 kernel/kthread.c:246 ret_from_fork+0x3a/0x50 arch/x86/entry/entry_64.S:352 Allocated by task 12736: save_stack+0x43/0xd0 mm/kasan/kasan.c:448 set_track mm/kasan/kasan.c:460 [inline] kasan_kmalloc+0xc7/0xe0 mm/kasan/kasan.c:553 kmem_cache_alloc_trace+0x152/0x750 mm/slab.c:3620 kmalloc include/linux/slab.h:546 [inline] tls_set_sw_offload+0xcb3/0x1390 net/tls/tls_sw.c:1945 do_tls_setsockopt_conf net/tls/tls_main.c:467 [inline] do_tls_setsockopt net/tls/tls_main.c:514 [inline] tls_setsockopt+0x689/0x770 net/tls/tls_main.c:533 sock_common_setsockopt+0x9a/0xe0 net/core/sock.c:2978 smc_setsockopt+0xcf/0x750 net/smc/af_smc.c:1640 __compat_sys_setsockopt+0x329/0x860 net/compat.c:407 __do_compat_sys_setsockopt net/compat.c:417 [inline] __se_compat_sys_setsockopt net/compat.c:414 [inline] __ia32_compat_sys_setsockopt+0xbd/0x150 net/compat.c:414 do_syscall_32_irqs_on arch/x86/entry/common.c:326 [inline] do_fast_syscall_32+0x34d/0xfb2 arch/x86/entry/common.c:397 entry_SYSENTER_compat+0x70/0x7f arch/x86/entry/entry_64_compat.S:139 Freed by task 12735: save_stack+0x43/0xd0 mm/kasan/kasan.c:448 set_track mm/kasan/kasan.c:460 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/kasan.c:521 kasan_slab_free+0xe/0x10 mm/kasan/kasan.c:528 __cache_free mm/slab.c:3498 [inline] kfree+0xcf/0x230 mm/slab.c:3817 tls_sk_proto_close+0x5fa/0x750 net/tls/tls_main.c:277 inet_release+0x104/0x1f0 net/ipv4/af_inet.c:428 __sock_release+0x1d9/0x250 net/socket.c:579 sock_release+0x17/0x20 net/socket.c:598 smc_release+0x1a8/0x730 net/smc/af_smc.c:148 __sock_release+0xd7/0x250 net/socket.c:579 sock_close+0x19/0x20 net/socket.c:1141 __fput+0x385/0xa30 fs/file_table.c:278 ____fput+0x15/0x20 fs/file_table.c:309 task_work_run+0x1e8/0x2a0 kernel/task_work.c:113 tracehook_notify_resume include/linux/tracehook.h:188 [inline] exit_to_usermode_loop+0x318/0x380 arch/x86/entry/common.c:166 prepare_exit_to_usermode arch/x86/entry/common.c:197 [inline] syscall_return_slowpath arch/x86/entry/common.c:268 [inline] do_syscall_32_irqs_on arch/x86/entry/common.c:341 [inline] do_fast_syscall_32+0xcd5/0xfb2 arch/x86/entry/common.c:397 entry_SYSENTER_compat+0x70/0x7f arch/x86/entry/entry_64_compat.S:139 The buggy address belongs to the object at ffff8881b88d5ac0 which belongs to the cache kmalloc-32 of size 32 The buggy address is located 0 bytes inside of 32-byte region [ffff8881b88d5ac0, ffff8881b88d5ae0) The buggy address belongs to the page: page:ffffea0006e23540 count:1 mapcount:0 mapping:ffff8881da8001c0 index:0xffff8881b88d5fc1 flags: 0x2fffc0000000200(slab) raw: 02fffc0000000200 ffffea000761f348 ffffea0006ed6388 ffff8881da8001c0 raw: ffff8881b88d5fc1 ffff8881b88d5000 000000010000003d 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8881b88d5980: fb fb fb fb fc fc fc fc fb fb fb fb fc fc fc fc ffff8881b88d5a00: fb fb fb fb fc fc fc fc fb fb fb fb fc fc fc fc >ffff8881b88d5a80: fb fb fb fb fc fc fc fc fb fb fb fb fc fc fc fc ^ ffff8881b88d5b00: fb fb fb fb fc fc fc fc fb fb fb fb fc fc fc fc ffff8881b88d5b80: fb fb fb fb fc fc fc fc fb fb fb fb fc fc fc fc ==================================================================