================================================================== BUG: KASAN: slab-out-of-bounds in memcpy include/linux/string.h:344 [inline] BUG: KASAN: slab-out-of-bounds in sha3_update+0xdf/0x2e0 crypto/sha3_generic.c:161 Write of size 193 at addr ffff8801c36edbbc by task syz-executor3/16226 CPU: 1 PID: 16226 Comm: syz-executor3 Not tainted 4.15.0-rc4-next-20171221+ #78 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:17 [inline] dump_stack+0x194/0x257 lib/dump_stack.c:53 print_address_description+0x73/0x250 mm/kasan/report.c:252 kasan_report_error mm/kasan/report.c:351 [inline] kasan_report+0x25b/0x340 mm/kasan/report.c:409 check_memory_region_inline mm/kasan/kasan.c:260 [inline] check_memory_region+0x137/0x190 mm/kasan/kasan.c:267 memcpy+0x37/0x50 mm/kasan/kasan.c:303 memcpy include/linux/string.h:344 [inline] sha3_update+0xdf/0x2e0 crypto/sha3_generic.c:161 crypto_shash_update+0xda/0x240 crypto/shash.c:110 hmac_update+0x7e/0xa0 crypto/hmac.c:122 crypto_shash_update+0xda/0x240 crypto/shash.c:110 kdf_ctr security/keys/dh.c:181 [inline] keyctl_dh_compute_kdf security/keys/dh.c:226 [inline] __keyctl_dh_compute+0x160f/0x1990 security/keys/dh.c:398 keyctl_dh_compute+0xac/0xf3 security/keys/dh.c:434 SYSC_keyctl security/keys/keyctl.c:1741 [inline] SyS_keyctl+0x72/0x2c0 security/keys/keyctl.c:1637 entry_SYSCALL_64_fastpath+0x1f/0x96 RIP: 0033:0x452ac9 RSP: 002b:00007fbce2623c58 EFLAGS: 00000212 ORIG_RAX: 00000000000000fa RAX: ffffffffffffffda RBX: 000000000071bea0 RCX: 0000000000452ac9 RDX: 000000002030d000 RSI: 00000000200f5ff4 RDI: 0000000000000017 RBP: 00000000000001c6 R08: 0000000020d4cfc8 R09: 0000000000000000 R10: 0000000000000036 R11: 0000000000000212 R12: 00000000006efb30 R13: 00000000ffffffff R14: 00007fbce26246d4 R15: 0000000000000000 Allocated by task 16226: save_stack+0x43/0xd0 mm/kasan/kasan.c:447 set_track mm/kasan/kasan.c:459 [inline] kasan_kmalloc+0xad/0xe0 mm/kasan/kasan.c:551 __do_kmalloc mm/slab.c:3709 [inline] __kmalloc+0x162/0x760 mm/slab.c:3718 kmalloc include/linux/slab.h:521 [inline] kdf_alloc security/keys/dh.c:111 [inline] __keyctl_dh_compute+0x2b0/0x1990 security/keys/dh.c:288 keyctl_dh_compute+0xac/0xf3 security/keys/dh.c:434 SYSC_keyctl security/keys/keyctl.c:1741 [inline] SyS_keyctl+0x72/0x2c0 security/keys/keyctl.c:1637 entry_SYSCALL_64_fastpath+0x1f/0x96 Freed by task 13107: save_stack+0x43/0xd0 mm/kasan/kasan.c:447 set_track mm/kasan/kasan.c:459 [inline] kasan_slab_free+0x71/0xc0 mm/kasan/kasan.c:524 __cache_free mm/slab.c:3489 [inline] kfree+0xd6/0x260 mm/slab.c:3804 free_ctx+0x47/0x60 kernel/events/core.c:1160 __rcu_reclaim kernel/rcu/rcu.h:172 [inline] rcu_do_batch kernel/rcu/tree.c:2675 [inline] invoke_rcu_callbacks kernel/rcu/tree.c:2934 [inline] __rcu_process_callbacks kernel/rcu/tree.c:2901 [inline] rcu_process_callbacks+0xd6c/0x17f0 kernel/rcu/tree.c:2918 __do_softirq+0x2d7/0xb85 kernel/softirq.c:285 The buggy address belongs to the object at ffff8801c36edac0 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 252 bytes inside of 512-byte region [ffff8801c36edac0, ffff8801c36edcc0) The buggy address belongs to the page: page:000000003303af98 count:1 mapcount:0 mapping:000000000e149c01 index:0xffff8801c36ed840 flags: 0x2fffc0000000100(slab) raw: 02fffc0000000100 ffff8801c36ed0c0 ffff8801c36ed840 0000000100000005 raw: ffffea00070b9c20 ffffea00070b2e20 ffff8801dac00940 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8801c36edb00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8801c36edb80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff8801c36edc00: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc ^ ffff8801c36edc80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8801c36edd00: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb ==================================================================