kernel msg: ebtables bug: please report to author: bad policy audit: type=1804 audit(1548627813.624:215): pid=10810 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=invalid_pcr cause=open_writers comm="syz-executor3" name="/root/syzkaller-testdir826746866/syzkaller.fFazOK/168/memory.events" dev="sda1" ino=16515 res=1 kernel msg: ebtables bug: please report to author: bad policy ================================================================== BUG: KASAN: use-after-free in memcpy include/linux/string.h:352 [inline] BUG: KASAN: use-after-free in generic_gcmaes_encrypt+0xc8/0x1a0 arch/x86/crypto/aesni-intel_glue.c:1134 Read of size 12 at addr ffff88809f8e4cc0 by task kworker/1:1/22 CPU: 1 PID: 22 Comm: kworker/1:1 Not tainted 5.0.0-rc3+ #37 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+0x1db/0x2d0 lib/dump_stack.c:113 print_address_description.cold+0x7c/0x20d mm/kasan/report.c:187 kasan_report.cold+0x1b/0x40 mm/kasan/report.c:317 check_memory_region_inline mm/kasan/generic.c:185 [inline] check_memory_region+0x123/0x190 mm/kasan/generic.c:191 memcpy+0x24/0x50 mm/kasan/common.c:130 memcpy include/linux/string.h:352 [inline] generic_gcmaes_encrypt+0xc8/0x1a0 arch/x86/crypto/aesni-intel_glue.c:1134 crypto_aead_encrypt include/crypto/aead.h:336 [inline] gcmaes_wrapper_encrypt+0x15d/0x200 arch/x86/crypto/aesni-intel_glue.c:986 crypto_aead_encrypt include/crypto/aead.h:336 [inline] pcrypt_aead_enc+0xc7/0x190 crypto/pcrypt.c:143 padata_parallel_worker+0x47f/0x7c0 kernel/padata.c:86 process_one_work+0xd0c/0x1ce0 kernel/workqueue.c:2153 worker_thread+0x143/0x14a0 kernel/workqueue.c:2296 kthread+0x357/0x430 kernel/kthread.c:246 ret_from_fork+0x3a/0x50 arch/x86/entry/entry_64.S:352 Allocated by task 10857: save_stack+0x45/0xd0 mm/kasan/common.c:73 set_track mm/kasan/common.c:85 [inline] __kasan_kmalloc mm/kasan/common.c:496 [inline] __kasan_kmalloc.constprop.0+0xcf/0xe0 mm/kasan/common.c:469 kasan_kmalloc+0x9/0x10 mm/kasan/common.c:504 audit: type=1804 audit(1548627813.764:216): pid=10819 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=invalid_pcr cause=ToMToU comm="syz-executor3" name="/root/syzkaller-testdir826746866/syzkaller.fFazOK/168/memory.events" dev="sda1" ino=16515 res=1 kmem_cache_alloc_trace+0x151/0x760 mm/slab.c:3609 kmalloc include/linux/slab.h:545 [inline] tls_set_sw_offload+0xdf7/0x1330 net/tls/tls_sw.c:1971 do_tls_setsockopt_conf net/tls/tls_main.c:469 [inline] do_tls_setsockopt net/tls/tls_main.c:516 [inline] tls_setsockopt+0x687/0x770 net/tls/tls_main.c:535 sock_common_setsockopt+0x9a/0xe0 net/core/sock.c:2991 __sys_setsockopt+0x1b0/0x3a0 net/socket.c:1902 __do_sys_setsockopt net/socket.c:1913 [inline] __se_sys_setsockopt net/socket.c:1910 [inline] __x64_sys_setsockopt+0xbe/0x150 net/socket.c:1910 do_syscall_64+0x1a3/0x800 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 10854: save_stack+0x45/0xd0 mm/kasan/common.c:73 set_track mm/kasan/common.c:85 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/common.c:458 kasan_slab_free+0xe/0x10 mm/kasan/common.c:466 __cache_free mm/slab.c:3487 [inline] kfree+0xcf/0x230 mm/slab.c:3806 tls_sk_proto_close+0x612/0x770 net/tls/tls_main.c:279 inet_release+0x105/0x1f0 net/ipv4/af_inet.c:428 inet6_release+0x53/0x80 net/ipv6/af_inet6.c:473 __sock_release+0xd3/0x250 net/socket.c:579 sock_close+0x1b/0x30 net/socket.c:1141 __fput+0x3c5/0xb10 fs/file_table.c:278 ____fput+0x16/0x20 fs/file_table.c:309 task_work_run+0x1f4/0x2b0 kernel/task_work.c:113 tracehook_notify_resume include/linux/tracehook.h:188 [inline] exit_to_usermode_loop+0x32a/0x3b0 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_64+0x696/0x800 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff88809f8e4cc0 which belongs to the cache kmalloc-32 of size 32 The buggy address is located 0 bytes inside of 32-byte region [ffff88809f8e4cc0, ffff88809f8e4ce0) The buggy address belongs to the page: page:ffffea00027e3900 count:1 mapcount:0 mapping:ffff88812c3f01c0 index:0xffff88809f8e4fc1 flags: 0x1fffc0000000200(slab) raw: 01fffc0000000200 ffffea00023c6348 ffffea000238a048 ffff88812c3f01c0 audit: type=1800 audit(1548627813.764:217): pid=10810 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=collect_data cause=failed comm="syz-executor3" name="memory.events" dev="sda1" ino=16515 res=0 raw: ffff88809f8e4fc1 ffff88809f8e4000 0000000100000024 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88809f8e4b80: fb fb fb fb fc fc fc fc fb fb fb fb fc fc fc fc ffff88809f8e4c00: 00 01 fc fc fc fc fc fc fb fb fb fb fc fc fc fc >ffff88809f8e4c80: fb fb fb fb fc fc fc fc fb fb fb fb fc fc fc fc ^ ffff88809f8e4d00: fb fb fb fb fc fc fc fc fb fb fb fb fc fc fc fc ffff88809f8e4d80: 00 01 fc fc fc fc fc fc fb fb fb fb fc fc fc fc ==================================================================