================================================================== 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 ffff8801c6c14594 by task syz-executor5/13556 CPU: 0 PID: 13556 Comm: syz-executor5 Not tainted 4.19.0-rc8+ #192 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 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] nfs_fscache_get_client_cookie+0x463/0x600 fs/nfs/fscache.c:85 nfs_alloc_client+0x563/0x760 fs/nfs/client.c:188 nfs_get_client+0x8e8/0x14d0 fs/nfs/client.c:430 nfs_init_server+0x357/0x1010 fs/nfs/client.c:670 nf_conntrack: default automatic helper assignment has been turned off for security reasons and CT-based firewall rule not found. Use the iptables CT target to attach helpers instead. nfs_create_server+0x86/0x5f0 fs/nfs/client.c:954 nfs_try_mount+0x180/0xa80 fs/nfs/super.c:1884 nfs_fs_mount+0x17f8/0x2f1c fs/nfs/super.c:2695 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 __do_compat_sys_mount fs/compat.c:125 [inline] __se_compat_sys_mount fs/compat.c:92 [inline] __ia32_compat_sys_mount+0x5d5/0x860 fs/compat.c:92 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 RIP: 0023:0xf7f1eca9 Code: 85 d2 74 02 89 0a 5b 5d c3 8b 04 24 c3 8b 0c 24 c3 8b 1c 24 c3 90 90 90 90 90 90 90 90 90 90 90 90 51 52 55 89 e5 0f 34 cd 80 <5d> 5a 59 c3 90 90 90 90 eb 0d 90 90 90 90 90 90 90 90 90 90 90 90 RSP: 002b:00000000f5f1a0cc EFLAGS: 00000296 ORIG_RAX: 0000000000000015 RAX: ffffffffffffffda RBX: 00000000208deff8 RCX: 0000000020343ff8 RDX: 000000002015bffc RSI: 0000000000000000 RDI: 000000002000a000 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 Allocated by task 13556: 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] nfs_fscache_get_client_cookie+0x463/0x600 fs/nfs/fscache.c:85 nfs_alloc_client+0x563/0x760 fs/nfs/client.c:188 nfs_get_client+0x8e8/0x14d0 fs/nfs/client.c:430 nfs_init_server+0x357/0x1010 fs/nfs/client.c:670 nfs_create_server+0x86/0x5f0 fs/nfs/client.c:954 nfs_try_mount+0x180/0xa80 fs/nfs/super.c:1884 nfs_fs_mount+0x17f8/0x2f1c fs/nfs/super.c:2695 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 __do_compat_sys_mount fs/compat.c:125 [inline] __se_compat_sys_mount fs/compat.c:92 [inline] __ia32_compat_sys_mount+0x5d5/0x860 fs/compat.c:92 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 5403: 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 xt_compat_flush_offsets+0x153/0x280 net/netfilter/x_tables.c:674 get_info+0x5ee/0x6f0 net/ipv6/netfilter/ip6_tables.c:993 compat_do_ip6t_get_ctl+0x39c/0xd10 net/ipv6/netfilter/ip6_tables.c:1662 compat_nf_sockopt net/netfilter/nf_sockopt.c:139 [inline] compat_nf_getsockopt+0x9e/0x140 net/netfilter/nf_sockopt.c:163 compat_ipv6_getsockopt+0x267/0x3e0 net/ipv6/ipv6_sockglue.c:1420 inet_csk_compat_getsockopt+0x97/0x120 net/ipv4/inet_connection_sock.c:1035 compat_tcp_getsockopt+0x49/0x80 net/ipv4/tcp.c:3594 compat_sock_common_getsockopt+0xb4/0x150 net/core/sock.c:3008 __compat_sys_getsockopt+0x1b6/0x8a0 net/compat.c:530 __do_compat_sys_socketcall net/compat.c:914 [inline] __se_compat_sys_socketcall net/compat.c:842 [inline] __ia32_compat_sys_socketcall+0xb35/0x1090 net/compat.c:842 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 The buggy address belongs to the object at ffff8801c6c14580 which belongs to the cache kmalloc-32 of size 32 The buggy address is located 20 bytes inside of 32-byte region [ffff8801c6c14580, ffff8801c6c145a0) The buggy address belongs to the page: page:ffffea00071b0500 count:1 mapcount:0 mapping:ffff8801da8001c0 index:0xffff8801c6c14fc1 flags: 0x2fffc0000000100(slab) raw: 02fffc0000000100 ffffea0007392d08 ffffea000737ff08 ffff8801da8001c0 raw: ffff8801c6c14fc1 ffff8801c6c14000 000000010000003f 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8801c6c14480: fb fb fb fb fc fc fc fc 01 fc fc fc fc fc fc fc ffff8801c6c14500: 01 fc fc fc fc fc fc fc 01 fc fc fc fc fc fc fc >ffff8801c6c14580: 00 00 06 fc fc fc fc fc 01 fc fc fc fc fc fc fc ^ ffff8801c6c14600: fb fb fb fb fc fc fc fc fb fb fb fb fc fc fc fc ffff8801c6c14680: fb fb fb fb fc fc fc fc fb fb fb fb fc fc fc fc ==================================================================