================================================================== BUG: KASAN: slab-out-of-bounds in rt_cache_valid+0x158/0x190 net/ipv4/route.c:1560 Read of size 2 at addr ffff88809a5083b2 by task syz-executor.0/23708 CPU: 0 PID: 23708 Comm: syz-executor.0 Not tainted 5.2.0-rc1+ #30 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:1560 __mkroute_output net/ipv4/route.c:2336 [inline] ip_route_output_key_hash_rcu+0x819/0x2d50 net/ipv4/route.c:2568 ip_route_output_key_hash+0x1ef/0x360 net/ipv4/route.c:2397 __ip_route_output_key include/net/route.h:129 [inline] ip_route_output_flow+0x28/0xc0 net/ipv4/route.c:2655 ip_route_output_key include/net/route.h:139 [inline] sctp_v4_get_dst+0x467/0x1260 net/sctp/protocol.c:450 sctp_transport_route+0x12d/0x360 net/sctp/transport.c:312 sctp_assoc_add_peer+0x53e/0xfc0 net/sctp/associola.c:678 sctp_process_param net/sctp/sm_make_chunk.c:2546 [inline] sctp_process_init+0x2491/0x2b10 net/sctp/sm_make_chunk.c:2359 sctp_sf_do_unexpected_init net/sctp/sm_statefuns.c:1556 [inline] sctp_sf_do_unexpected_init.isra.0+0x7cd/0x1350 net/sctp/sm_statefuns.c:1456 sctp_sf_do_5_2_1_siminit+0x35/0x40 net/sctp/sm_statefuns.c:1685 sctp_do_sm+0x121/0x50e0 net/sctp/sm_sideeffect.c:1162 sctp_assoc_bh_rcv+0x343/0x660 net/sctp/associola.c:1074 sctp_inq_push+0x1e4/0x280 net/sctp/inqueue.c:95 sctp_backlog_rcv+0x196/0xbe0 net/sctp/input.c:354 sk_backlog_rcv include/net/sock.h:950 [inline] __release_sock+0x129/0x390 net/core/sock.c:2418 release_sock+0x59/0x1c0 net/core/sock.c:2934 sctp_sendmsg+0x10c0/0x17d0 net/sctp/socket.c:2122 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:00007fc447decc78 EFLAGS: 00000246 ORIG_RAX: 000000000000002c RAX: ffffffffffffffda RBX: 0000000000000006 RCX: 0000000000459279 RDX: 0000000000000001 RSI: 0000000020000000 RDI: 0000000000000004 RBP: 000000000075bf20 R08: 0000000020bb6000 R09: 000000000000001c R10: 00000000feffffff R11: 0000000000000246 R12: 00007fc447ded6d4 R13: 00000000004c6d9d R14: 00000000004dbc40 R15: 00000000ffffffff Allocated by task 30816: 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_kmalloc+0x9/0x10 mm/kasan/common.c:503 kmem_cache_alloc_trace+0x151/0x750 mm/slab.c:3555 kmalloc include/linux/slab.h:547 [inline] kzalloc include/linux/slab.h:742 [inline] apparmor_sk_alloc_security+0x87/0x110 security/apparmor/lsm.c:767 security_sk_alloc+0x77/0xc0 security/security.c:2030 sk_prot_alloc+0xa5/0x2e0 net/core/sock.c:1611 sk_alloc+0x39/0xf70 net/core/sock.c:1662 inet_create net/ipv4/af_inet.c:325 [inline] inet_create+0x36a/0xe00 net/ipv4/af_inet.c:251 __sock_create+0x3d8/0x730 net/socket.c:1430 sock_create net/socket.c:1481 [inline] __sys_socket+0x103/0x220 net/socket.c:1523 __do_sys_socket net/socket.c:1532 [inline] __se_sys_socket net/socket.c:1530 [inline] __x64_sys_socket+0x73/0xb0 net/socket.c:1530 do_syscall_64+0xfd/0x680 arch/x86/entry/common.c:301 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 30816: 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] kfree+0xcf/0x220 mm/slab.c:3755 apparmor_sk_free_security+0xd9/0x120 security/apparmor/lsm.c:786 security_sk_free+0x41/0x80 security/security.c:2035 sk_prot_free net/core/sock.c:1641 [inline] __sk_destruct+0x4a7/0x6e0 net/core/sock.c:1731 sk_destruct+0x7b/0x90 net/core/sock.c:1739 __sk_free+0xce/0x300 net/core/sock.c:1750 sk_free+0x42/0x50 net/core/sock.c:1761 sock_put include/net/sock.h:1728 [inline] tcp_close+0xbbd/0x10c0 net/ipv4/tcp.c:2490 inet_release+0xff/0x1e0 net/ipv4/af_inet.c:432 __sock_release+0xce/0x2a0 net/socket.c:607 sock_close+0x1b/0x30 net/socket.c:1279 __fput+0x2ff/0x890 fs/file_table.c:280 ____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 ffff88809a508380 which belongs to the cache kmalloc-32 of size 32 The buggy address is located 18 bytes to the right of 32-byte region [ffff88809a508380, ffff88809a5083a0) The buggy address belongs to the page: page:ffffea0002694200 refcount:1 mapcount:0 mapping:ffff8880aa4001c0 index:0xffff88809a508fc1 flags: 0x1fffc0000000200(slab) raw: 01fffc0000000200 ffffea0002a67348 ffffea0002806508 ffff8880aa4001c0 raw: ffff88809a508fc1 ffff88809a508000 0000000100000036 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88809a508280: fb fb fb fb fc fc fc fc fb fb fb fb fc fc fc fc ffff88809a508300: fb fb fb fb fc fc fc fc fb fb fb fb fc fc fc fc >ffff88809a508380: fb fb fb fb fc fc fc fc fb fb fb fb fc fc fc fc ^ ffff88809a508400: fb fb fb fb fc fc fc fc 00 06 fc fc fc fc fc fc ffff88809a508480: fb fb fb fb fc fc fc fc fb fb fb fb fc fc fc fc ==================================================================