================================================================== BUG: KASAN: slab-out-of-bounds in fscache_set_key fs/fscache/cookie.c:120 [inline] BUG: KASAN: slab-out-of-bounds in fscache_alloc_cookie+0x7ad/0x880 fs/fscache/cookie.c:171 Read of size 4 at addr ffff8801ccf1a494 by task syz-executor5/1049 CPU: 0 PID: 1049 Comm: syz-executor5 Not tainted 4.19.0-rc8+ #285 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1c4/0x2b4 lib/dump_stack.c:113 TCP: request_sock_TCPv6: Possible SYN flooding on port 20002. Sending cookies. Check SNMP counters. print_address_description.cold.8+0x9/0x1ff mm/kasan/report.c:256 kasan_report_error mm/kasan/report.c:354 [inline] kasan_report.cold.9+0x242/0x309 mm/kasan/report.c:412 __asan_report_load4_noabort+0x14/0x20 mm/kasan/report.c:432 fscache_set_key fs/fscache/cookie.c:120 [inline] fscache_alloc_cookie+0x7ad/0x880 fs/fscache/cookie.c:171 __fscache_acquire_cookie+0x230/0xb60 fs/fscache/cookie.c:303 fscache_acquire_cookie include/linux/fscache.h:338 [inline] v9fs_cache_session_get_cookie+0xc4/0x270 fs/9p/cache.c:73 v9fs_session_init+0xffe/0x1a70 fs/9p/v9fs.c:464 v9fs_mount+0x7d/0x8f0 fs/9p/vfs_super.c:135 mount_fs+0xae/0x31d fs/super.c:1261 vfs_kern_mount.part.35+0xdc/0x4f0 fs/namespace.c:961 vfs_kern_mount fs/namespace.c:951 [inline] do_new_mount fs/namespace.c:2457 [inline] do_mount+0x581/0x31f0 fs/namespace.c:2787 ksys_mount+0x12d/0x140 fs/namespace.c:3003 __do_sys_mount fs/namespace.c:3017 [inline] __se_sys_mount fs/namespace.c:3014 [inline] __x64_sys_mount+0xbe/0x150 fs/namespace.c:3014 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x457569 Code: fd b3 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 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 0f 83 cb b3 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007f534c21ac78 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 0000000000000005 RCX: 0000000000457569 RDX: 00000000200008c0 RSI: 0000000020000000 RDI: 0000000000000000 RBP: 000000000072bf00 R08: 0000000020000b80 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f534c21b6d4 R13: 00000000004c28a1 R14: 00000000004d3c90 R15: 00000000ffffffff Allocated by task 1049: 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 __do_kmalloc mm/slab.c:3718 [inline] __kmalloc+0x14e/0x760 mm/slab.c:3727 kmalloc include/linux/slab.h:518 [inline] kzalloc include/linux/slab.h:707 [inline] fscache_set_key fs/fscache/cookie.c:101 [inline] fscache_alloc_cookie+0x6f7/0x880 fs/fscache/cookie.c:171 __fscache_acquire_cookie+0x230/0xb60 fs/fscache/cookie.c:303 fscache_acquire_cookie include/linux/fscache.h:338 [inline] v9fs_cache_session_get_cookie+0xc4/0x270 fs/9p/cache.c:73 v9fs_session_init+0xffe/0x1a70 fs/9p/v9fs.c:464 v9fs_mount+0x7d/0x8f0 fs/9p/vfs_super.c:135 mount_fs+0xae/0x31d fs/super.c:1261 vfs_kern_mount.part.35+0xdc/0x4f0 fs/namespace.c:961 vfs_kern_mount fs/namespace.c:951 [inline] do_new_mount fs/namespace.c:2457 [inline] do_mount+0x581/0x31f0 fs/namespace.c:2787 ksys_mount+0x12d/0x140 fs/namespace.c:3003 __do_sys_mount fs/namespace.c:3017 [inline] __se_sys_mount fs/namespace.c:3014 [inline] __x64_sys_mount+0xbe/0x150 fs/namespace.c:3014 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 5286: 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:3813 kvfree+0x61/0x70 mm/util.c:452 __vunmap+0x328/0x460 mm/vmalloc.c:1529 vfree+0x68/0x100 mm/vmalloc.c:1593 copy_entries_to_user net/ipv6/netfilter/ip6_tables.c:886 [inline] get_entries net/ipv6/netfilter/ip6_tables.c:1044 [inline] do_ip6t_get_ctl+0xa1e/0xbf0 net/ipv6/netfilter/ip6_tables.c:1712 nf_sockopt net/netfilter/nf_sockopt.c:104 [inline] nf_getsockopt+0x80/0xe0 net/netfilter/nf_sockopt.c:122 ipv6_getsockopt+0x1f0/0x320 net/ipv6/ipv6_sockglue.c:1381 tcp_getsockopt+0x93/0xe0 net/ipv4/tcp.c:3583 sock_common_getsockopt+0x9a/0xe0 net/core/sock.c:2997 __sys_getsockopt+0x1ad/0x390 net/socket.c:1939 __do_sys_getsockopt net/socket.c:1950 [inline] __se_sys_getsockopt net/socket.c:1947 [inline] __x64_sys_getsockopt+0xbe/0x150 net/socket.c:1947 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff8801ccf1a480 which belongs to the cache kmalloc-32 of size 32 The buggy address is located 20 bytes inside of 32-byte region [ffff8801ccf1a480, ffff8801ccf1a4a0) The buggy address belongs to the page: page:ffffea000733c680 count:1 mapcount:0 mapping:ffff8801da8001c0 index:0xffff8801ccf1afc1 flags: 0x2fffc0000000100(slab) raw: 02fffc0000000100 ffffea0007462148 ffffea000760bc88 ffff8801da8001c0 raw: ffff8801ccf1afc1 ffff8801ccf1a000 000000010000003e 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8801ccf1a380: fb fb fb fb fc fc fc fc 00 06 fc fc fc fc fc fc ffff8801ccf1a400: fb fb fb fb fc fc fc fc 00 07 fc fc fc fc fc fc >ffff8801ccf1a480: 00 00 07 fc fc fc fc fc 00 00 00 00 fc fc fc fc ^ ffff8801ccf1a500: fb fb fb fb fc fc fc fc fb fb fb fb fc fc fc fc ffff8801ccf1a580: fb fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc ==================================================================