================================================================== BUG: KASAN: use-after-free in rt_cache_valid+0x158/0x190 net/ipv4/route.c:1561 Read of size 2 at addr ffff8880a7ba49d2 by task syz-executor.0/22267 CPU: 0 PID: 22267 Comm: syz-executor.0 Not tainted 5.2.0-rc2+ #19 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+0x172/0x1f0 lib/dump_stack.c:113 print_address_description.cold+0x7c/0x20d mm/kasan/report.c:188 __kasan_report.cold+0x1b/0x40 mm/kasan/report.c:317 kasan_report+0x12/0x20 mm/kasan/common.c:614 __asan_report_load2_noabort+0x14/0x20 mm/kasan/generic_report.c:130 rt_cache_valid+0x158/0x190 net/ipv4/route.c:1561 __mkroute_output net/ipv4/route.c:2337 [inline] ip_route_output_key_hash_rcu+0x819/0x2d50 net/ipv4/route.c:2569 ip_route_output_key_hash+0x1ef/0x360 net/ipv4/route.c:2398 __ip_route_output_key include/net/route.h:129 [inline] ip_route_output_flow+0x28/0xc0 net/ipv4/route.c:2656 ip_route_connect include/net/route.h:314 [inline] tcp_v4_connect+0x8a7/0x1c40 net/ipv4/tcp_ipv4.c:233 __inet_stream_connect+0x834/0xe90 net/ipv4/af_inet.c:659 tcp_sendmsg_fastopen net/ipv4/tcp.c:1143 [inline] tcp_sendmsg_locked+0x2318/0x3920 net/ipv4/tcp.c:1185 tcp_sendmsg+0x30/0x50 net/ipv4/tcp.c:1419 inet_sendmsg+0x141/0x5d0 net/ipv4/af_inet.c:802 sock_sendmsg_nosec net/socket.c:652 [inline] sock_sendmsg+0xd7/0x130 net/socket.c:671 __sys_sendto+0x262/0x380 net/socket.c:1964 __do_sys_sendto net/socket.c:1976 [inline] __se_sys_sendto net/socket.c:1972 [inline] __x64_sys_sendto+0xe1/0x1a0 net/socket.c:1972 do_syscall_64+0xfd/0x680 arch/x86/entry/common.c:301 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x459279 Code: fd b7 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 b7 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007f0b90021c78 EFLAGS: 00000246 ORIG_RAX: 000000000000002c RAX: ffffffffffffffda RBX: 0000000000000006 RCX: 0000000000459279 RDX: 000000000000ff1b RSI: 0000000000000000 RDI: 0000000000000003 RBP: 000000000075c060 R08: 0000000020000080 R09: 0000000000000010 R10: 1000000020000000 R11: 0000000000000246 R12: 00007f0b900226d4 R13: 00000000004c700b R14: 00000000004dc1c8 R15: 00000000ffffffff Allocated by task 14399: save_stack+0x23/0x90 mm/kasan/common.c:71 set_track mm/kasan/common.c:79 [inline] __kasan_kmalloc mm/kasan/common.c:489 [inline] __kasan_kmalloc.constprop.0+0xcf/0xe0 mm/kasan/common.c:462 kasan_slab_alloc+0xf/0x20 mm/kasan/common.c:497 slab_post_alloc_hook mm/slab.h:437 [inline] slab_alloc mm/slab.c:3326 [inline] kmem_cache_alloc+0x11a/0x6f0 mm/slab.c:3488 kmem_cache_zalloc include/linux/slab.h:732 [inline] lsm_file_alloc security/security.c:502 [inline] security_file_alloc+0x39/0x170 security/security.c:1345 __alloc_file+0xac/0x300 fs/file_table.c:106 alloc_empty_file+0x72/0x170 fs/file_table.c:151 path_openat+0xef/0x46d0 fs/namei.c:3522 do_filp_open+0x1a1/0x280 fs/namei.c:3563 do_sys_open+0x3fe/0x5d0 fs/open.c:1070 __do_sys_open fs/open.c:1088 [inline] __se_sys_open fs/open.c:1083 [inline] __x64_sys_open+0x7e/0xc0 fs/open.c:1083 do_syscall_64+0xfd/0x680 arch/x86/entry/common.c:301 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 14399: save_stack+0x23/0x90 mm/kasan/common.c:71 set_track mm/kasan/common.c:79 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/common.c:451 kasan_slab_free+0xe/0x10 mm/kasan/common.c:459 __cache_free mm/slab.c:3432 [inline] kmem_cache_free+0x86/0x260 mm/slab.c:3698 security_file_free+0xb3/0xe0 security/security.c:1364 file_free fs/file_table.c:55 [inline] __fput+0x450/0x890 fs/file_table.c:298 ____fput+0x16/0x20 fs/file_table.c:313 task_work_run+0x145/0x1c0 kernel/task_work.c:113 tracehook_notify_resume include/linux/tracehook.h:188 [inline] exit_to_usermode_loop+0x273/0x2c0 arch/x86/entry/common.c:168 prepare_exit_to_usermode arch/x86/entry/common.c:199 [inline] syscall_return_slowpath arch/x86/entry/common.c:279 [inline] do_syscall_64+0x58e/0x680 arch/x86/entry/common.c:304 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff8880a7ba49c0 which belongs to the cache lsm_file_cache of size 72 The buggy address is located 18 bytes inside of 72-byte region [ffff8880a7ba49c0, ffff8880a7ba4a08) The buggy address belongs to the page: page:ffffea00029ee900 refcount:1 mapcount:0 mapping:ffff8880aa587000 index:0xffff8880a7ba41a0 flags: 0x1fffc0000000200(slab) raw: 01fffc0000000200 ffffea00025c2d88 ffffea00023cc908 ffff8880aa587000 raw: ffff8880a7ba41a0 ffff8880a7ba4000 0000000100000005 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880a7ba4880: fc fb fb fb fb fb fb fb fb fb fc fc fc fc fb fb ffff8880a7ba4900: fb fb fb fb fb fb fb fc fc fc fc fb fb fb fb fb >ffff8880a7ba4980: fb fb fb fb fc fc fc fc fb fb fb fb fb fb fb fb ^ ffff8880a7ba4a00: fb fc fc fc fc fb fb fb fb fb fb fb fb fb fc fc ffff8880a7ba4a80: fc fc fb fb fb fb fb fb fb fb fb fc fc fc fc fb ==================================================================