audit: type=1400 audit(1512783924.045:7): avc: denied { map } for pid=3151 comm="syzkaller934629" path="/root/syzkaller934629588" dev="sda1" ino=16481 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:user_home_t:s0 tclass=file permissive=1 ================================================================== 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 192 at addr ffff8801c5bb78fc by task syzkaller934629/3151 CPU: 1 PID: 3151 Comm: syzkaller934629 Not tainted 4.15.0-rc2-mm1+ #39 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+0xcb/0x220 crypto/shash.c:110 hmac_update+0x7e/0xa0 crypto/hmac.c:122 crypto_shash_update+0xcb/0x220 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+0x16d8/0x1a00 security/keys/dh.c:398 keyctl_dh_compute+0xac/0xf3 security/keys/dh.c:434 SYSC_keyctl security/keys/keyctl.c:1745 [inline] SyS_keyctl+0x72/0x2c0 security/keys/keyctl.c:1641 entry_SYSCALL_64_fastpath+0x1f/0x96 RIP: 0033:0x43fe89 RSP: 002b:00007ffdc7af3ec8 EFLAGS: 00000203 ORIG_RAX: 00000000000000fa RAX: ffffffffffffffda RBX: 00000000004002c8 RCX: 000000000043fe89 RDX: 00000000205cd000 RSI: 00000000204c8ff4 RDI: 0000000000000017 RBP: 00000000006ca018 R08: 0000000020550000 R09: 0000000000000000 R10: 0000000000000030 R11: 0000000000000203 R12: 00000000004017f0 R13: 0000000000401880 R14: 0000000000000000 R15: 0000000000000000 Allocated by task 3151: 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:3712 [inline] __kmalloc+0x162/0x760 mm/slab.c:3721 kmalloc include/linux/slab.h:521 [inline] kdf_alloc security/keys/dh.c:111 [inline] __keyctl_dh_compute+0x2a1/0x1a00 security/keys/dh.c:288 keyctl_dh_compute+0xac/0xf3 security/keys/dh.c:434 SYSC_keyctl security/keys/keyctl.c:1745 [inline] SyS_keyctl+0x72/0x2c0 security/keys/keyctl.c:1641 entry_SYSCALL_64_fastpath+0x1f/0x96 Freed by task 1672: 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:3492 [inline] kfree+0xca/0x250 mm/slab.c:3807 skb_free_head+0x74/0xb0 net/core/skbuff.c:550 skb_release_data+0x58c/0x790 net/core/skbuff.c:570 skb_release_all+0x4a/0x60 net/core/skbuff.c:627 __kfree_skb net/core/skbuff.c:641 [inline] consume_skb+0x153/0x490 net/core/skbuff.c:701 skb_free_datagram+0x1a/0xe0 net/core/datagram.c:329 netlink_recvmsg+0x5c6/0x1300 net/netlink/af_netlink.c:1940 sock_recvmsg_nosec net/socket.c:809 [inline] sock_recvmsg+0xc9/0x110 net/socket.c:816 ___sys_recvmsg+0x29b/0x630 net/socket.c:2185 __sys_recvmsg+0xe2/0x210 net/socket.c:2230 SYSC_recvmsg net/socket.c:2242 [inline] SyS_recvmsg+0x2d/0x50 net/socket.c:2237 entry_SYSCALL_64_fastpath+0x1f/0x96 The buggy address belongs to the object at ffff8801c5bb7800 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 252 bytes inside of 512-byte region [ffff8801c5bb7800, ffff8801c5bb7a00) The buggy address belongs to the page: page:00000000799d9b1c count:1 mapcount:0 mapping:0000000037a449e4 index:0x0 flags: 0x2fffc0000000100(slab) raw: 02fffc0000000100 ffff8801c5bb7080 0000000000000000 0000000100000006 raw: ffffea00071577a0 ffffea000716ee60 ffff8801dac00940 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8801c5bb7880: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8801c5bb7900: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff8801c5bb7980: 00 fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff8801c5bb7a00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8801c5bb7a80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================