================================================================== 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 ffff8801d2861354 by task syz-executor4/23795 CPU: 0 PID: 23795 Comm: syz-executor4 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 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 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 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:00007fc114b80c78 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 0000000000000005 RCX: 0000000000457569 RDX: 0000000020000180 RSI: 0000000020000140 RDI: 00000000200002c0 RBP: 000000000072bf00 R08: 000000002000a000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007fc114b816d4 R13: 00000000004c289b R14: 00000000004d3c78 R15: 00000000ffffffff Allocated by task 23795: 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 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 5356: 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 apparmor_sk_free_security+0xdd/0x120 security/apparmor/lsm.c:788 security_sk_free+0x4a/0x80 security/security.c:1471 sk_prot_free net/core/sock.c:1501 [inline] __sk_destruct+0x713/0xa80 net/core/sock.c:1587 sk_destruct+0x78/0x90 net/core/sock.c:1595 __sk_free+0xcf/0x300 net/core/sock.c:1606 sk_free+0x42/0x50 net/core/sock.c:1617 sock_put include/net/sock.h:1691 [inline] tcp_close+0xd3c/0x1300 net/ipv4/tcp.c:2484 inet_release+0x104/0x1f0 net/ipv4/af_inet.c:428 __sock_release+0xd7/0x250 net/socket.c:579 sock_close+0x19/0x20 net/socket.c:1141 __fput+0x385/0xa30 fs/file_table.c:278 ____fput+0x15/0x20 fs/file_table.c:309 task_work_run+0x1e8/0x2a0 kernel/task_work.c:113 tracehook_notify_resume include/linux/tracehook.h:193 [inline] exit_to_usermode_loop+0x318/0x380 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+0x6be/0x820 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff8801d2861340 which belongs to the cache kmalloc-32 of size 32 The buggy address is located 20 bytes inside of 32-byte region [ffff8801d2861340, ffff8801d2861360) The buggy address belongs to the page: page:ffffea00074a1840 count:1 mapcount:0 mapping:ffff8801da8001c0 index:0xffff8801d2861fc1 flags: 0x2fffc0000000100(slab) raw: 02fffc0000000100 ffffea00075fe388 ffffea000734e408 ffff8801da8001c0 raw: ffff8801d2861fc1 ffff8801d2861000 000000010000003f 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8801d2861200: fb fb fb fb fc fc fc fc 07 fc fc fc fc fc fc fc ffff8801d2861280: 07 fc fc fc fc fc fc fc fb fb fb fb fc fc fc fc >ffff8801d2861300: 07 fc fc fc fc fc fc fc 00 00 06 fc fc fc fc fc ^ ffff8801d2861380: fb fb fb fb fc fc fc fc fb fb fb fb fc fc fc fc ffff8801d2861400: fb fb fb fb fc fc fc fc 05 fc fc fc fc fc fc fc ==================================================================