================================================================== BUG: KASAN: use-after-free in __nf_ct_ext_exist include/net/netfilter/nf_conntrack_extend.h:53 [inline] BUG: KASAN: use-after-free in nf_ct_ext_exist include/net/netfilter/nf_conntrack_extend.h:58 [inline] BUG: KASAN: use-after-free in __nf_ct_ext_find include/net/netfilter/nf_conntrack_extend.h:63 [inline] BUG: KASAN: use-after-free in nf_ct_ecache_find include/net/netfilter/nf_conntrack_ecache.h:35 [inline] BUG: KASAN: use-after-free in nf_ct_deliver_cached_events+0x5c3/0x6d0 net/netfilter/nf_conntrack_ecache.c:205 Read of size 1 at addr ffff888099560004 by task syz-executor.1/8831 CPU: 0 PID: 8831 Comm: syz-executor.1 Not tainted 5.4.0-rc4-next-20191025 #0 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.constprop.0.cold+0xd4/0x30b mm/kasan/report.c:374 __kasan_report.cold+0x1b/0x41 mm/kasan/report.c:506 kasan_report+0x12/0x20 mm/kasan/common.c:634 __asan_report_load1_noabort+0x14/0x20 mm/kasan/generic_report.c:129 __nf_ct_ext_exist include/net/netfilter/nf_conntrack_extend.h:53 [inline] nf_ct_ext_exist include/net/netfilter/nf_conntrack_extend.h:58 [inline] __nf_ct_ext_find include/net/netfilter/nf_conntrack_extend.h:63 [inline] nf_ct_ecache_find include/net/netfilter/nf_conntrack_ecache.h:35 [inline] nf_ct_deliver_cached_events+0x5c3/0x6d0 net/netfilter/nf_conntrack_ecache.c:205 nf_conntrack_confirm include/net/netfilter/nf_conntrack_core.h:65 [inline] nf_confirm+0x3d8/0x4d0 net/netfilter/nf_conntrack_proto.c:154 ipv4_confirm+0x14c/0x240 net/netfilter/nf_conntrack_proto.c:169 nf_hook_entry_hookfn include/linux/netfilter.h:135 [inline] nf_hook_slow+0xbc/0x1e0 net/netfilter/core.c:512 nf_hook include/linux/netfilter.h:262 [inline] NF_HOOK_COND include/linux/netfilter.h:295 [inline] ip_output+0x40d/0x670 net/ipv4/ip_output.c:432 dst_output include/net/dst.h:436 [inline] ip_local_out+0xbb/0x1b0 net/ipv4/ip_output.c:125 ip_send_skb+0x42/0xf0 net/ipv4/ip_output.c:1559 udp_send_skb.isra.0+0x6d5/0x11b0 net/ipv4/udp.c:891 udp_sendmsg+0x1e8f/0x2810 net/ipv4/udp.c:1178 inet_sendmsg+0x9e/0xe0 net/ipv4/af_inet.c:807 sock_sendmsg_nosec net/socket.c:638 [inline] sock_sendmsg+0xd7/0x130 net/socket.c:658 kernel_sendmsg+0x44/0x50 net/socket.c:678 rxrpc_send_abort_packet+0x479/0xe70 net/rxrpc/output.c:305 rxrpc_release_calls_on_socket+0x6db/0x1320 net/rxrpc/call_object.c:527 rxrpc_release_sock net/rxrpc/af_rxrpc.c:897 [inline] rxrpc_release+0x2a6/0x550 net/rxrpc/af_rxrpc.c:927 __sock_release+0xce/0x280 net/socket.c:591 sock_close+0x1e/0x30 net/socket.c:1269 __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 get_signal+0x206e/0x24f0 kernel/signal.c:2528 do_signal+0x87/0x1700 arch/x86/kernel/signal.c:815 exit_to_usermode_loop+0x286/0x380 arch/x86/entry/common.c:159 prepare_exit_to_usermode arch/x86/entry/common.c:194 [inline] syscall_return_slowpath arch/x86/entry/common.c:274 [inline] do_syscall_64+0x65f/0x760 arch/x86/entry/common.c:300 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x459ef9 Code: ad b6 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 7b b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007f6e7b9f5c78 EFLAGS: 00000246 ORIG_RAX: 000000000000012b RAX: fffffffffffffe00 RBX: 0000000000000005 RCX: 0000000000459ef9 RDX: 0000000000000001 RSI: 0000000020001f40 RDI: 0000000000000005 RBP: 000000000075bfc8 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f6e7b9f66d4 R13: 00000000004c7820 R14: 00000000004dd440 R15: 00000000ffffffff Allocated by task 8831: save_stack+0x23/0x90 mm/kasan/common.c:69 set_track mm/kasan/common.c:77 [inline] __kasan_kmalloc mm/kasan/common.c:510 [inline] __kasan_kmalloc.constprop.0+0xcf/0xe0 mm/kasan/common.c:483 kasan_krealloc+0x84/0xc0 mm/kasan/common.c:565 __do_krealloc mm/slab_common.c:1655 [inline] krealloc+0xa6/0xd0 mm/slab_common.c:1710 nf_ct_ext_add+0x2c7/0x630 net/netfilter/nf_conntrack_extend.c:74 nf_ct_ecache_ext_add include/net/netfilter/nf_conntrack_ecache.h:55 [inline] init_conntrack.isra.0+0x5ed/0x11a0 net/netfilter/nf_conntrack_core.c:1470 resolve_normal_ct net/netfilter/nf_conntrack_core.c:1547 [inline] nf_conntrack_in+0xd94/0x1460 net/netfilter/nf_conntrack_core.c:1707 ipv4_conntrack_local+0x127/0x220 net/netfilter/nf_conntrack_proto.c:200 nf_hook_entry_hookfn include/linux/netfilter.h:135 [inline] nf_hook_slow+0xbc/0x1e0 net/netfilter/core.c:512 nf_hook include/linux/netfilter.h:262 [inline] __ip_local_out+0x403/0x870 net/ipv4/ip_output.c:114 ip_local_out+0x2d/0x1b0 net/ipv4/ip_output.c:123 ip_send_skb+0x42/0xf0 net/ipv4/ip_output.c:1559 udp_send_skb.isra.0+0x6d5/0x11b0 net/ipv4/udp.c:891 udp_sendmsg+0x1e8f/0x2810 net/ipv4/udp.c:1178 inet_sendmsg+0x9e/0xe0 net/ipv4/af_inet.c:807 sock_sendmsg_nosec net/socket.c:638 [inline] sock_sendmsg+0xd7/0x130 net/socket.c:658 kernel_sendmsg+0x44/0x50 net/socket.c:678 rxrpc_send_abort_packet+0x479/0xe70 net/rxrpc/output.c:305 rxrpc_release_calls_on_socket+0x6db/0x1320 net/rxrpc/call_object.c:527 rxrpc_release_sock net/rxrpc/af_rxrpc.c:897 [inline] rxrpc_release+0x2a6/0x550 net/rxrpc/af_rxrpc.c:927 __sock_release+0xce/0x280 net/socket.c:591 sock_close+0x1e/0x30 net/socket.c:1269 __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 get_signal+0x206e/0x24f0 kernel/signal.c:2528 do_signal+0x87/0x1700 arch/x86/kernel/signal.c:815 exit_to_usermode_loop+0x286/0x380 arch/x86/entry/common.c:159 prepare_exit_to_usermode arch/x86/entry/common.c:194 [inline] syscall_return_slowpath arch/x86/entry/common.c:274 [inline] do_syscall_64+0x65f/0x760 arch/x86/entry/common.c:300 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 8831: save_stack+0x23/0x90 mm/kasan/common.c:69 set_track mm/kasan/common.c:77 [inline] kasan_set_free_info mm/kasan/common.c:332 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/common.c:471 kasan_slab_free+0xe/0x10 mm/kasan/common.c:480 __cache_free mm/slab.c:3426 [inline] kfree+0x10a/0x2c0 mm/slab.c:3757 nf_ct_ext_destroy+0x2ab/0x2e0 net/netfilter/nf_conntrack_extend.c:38 nf_conntrack_free+0x8f/0xe0 net/netfilter/nf_conntrack_core.c:1418 destroy_conntrack+0x1a2/0x270 net/netfilter/nf_conntrack_core.c:626 nf_conntrack_destroy+0xed/0x230 net/netfilter/core.c:600 nf_conntrack_put include/linux/netfilter/nf_conntrack_common.h:34 [inline] nf_conntrack_put include/linux/netfilter/nf_conntrack_common.h:31 [inline] nf_ct_resolve_clash net/netfilter/nf_conntrack_core.c:915 [inline] __nf_conntrack_confirm+0x21ca/0x2830 net/netfilter/nf_conntrack_core.c:1038 nf_conntrack_confirm include/net/netfilter/nf_conntrack_core.h:63 [inline] nf_confirm+0x3e7/0x4d0 net/netfilter/nf_conntrack_proto.c:154 ipv4_confirm+0x14c/0x240 net/netfilter/nf_conntrack_proto.c:169 nf_hook_entry_hookfn include/linux/netfilter.h:135 [inline] nf_hook_slow+0xbc/0x1e0 net/netfilter/core.c:512 nf_hook include/linux/netfilter.h:262 [inline] NF_HOOK_COND include/linux/netfilter.h:295 [inline] ip_output+0x40d/0x670 net/ipv4/ip_output.c:432 dst_output include/net/dst.h:436 [inline] ip_local_out+0xbb/0x1b0 net/ipv4/ip_output.c:125 ip_send_skb+0x42/0xf0 net/ipv4/ip_output.c:1559 udp_send_skb.isra.0+0x6d5/0x11b0 net/ipv4/udp.c:891 udp_sendmsg+0x1e8f/0x2810 net/ipv4/udp.c:1178 inet_sendmsg+0x9e/0xe0 net/ipv4/af_inet.c:807 sock_sendmsg_nosec net/socket.c:638 [inline] sock_sendmsg+0xd7/0x130 net/socket.c:658 kernel_sendmsg+0x44/0x50 net/socket.c:678 rxrpc_send_abort_packet+0x479/0xe70 net/rxrpc/output.c:305 rxrpc_release_calls_on_socket+0x6db/0x1320 net/rxrpc/call_object.c:527 rxrpc_release_sock net/rxrpc/af_rxrpc.c:897 [inline] rxrpc_release+0x2a6/0x550 net/rxrpc/af_rxrpc.c:927 __sock_release+0xce/0x280 net/socket.c:591 sock_close+0x1e/0x30 net/socket.c:1269 __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 get_signal+0x206e/0x24f0 kernel/signal.c:2528 do_signal+0x87/0x1700 arch/x86/kernel/signal.c:815 exit_to_usermode_loop+0x286/0x380 arch/x86/entry/common.c:159 prepare_exit_to_usermode arch/x86/entry/common.c:194 [inline] syscall_return_slowpath arch/x86/entry/common.c:274 [inline] do_syscall_64+0x65f/0x760 arch/x86/entry/common.c:300 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff888099560000 which belongs to the cache kmalloc-128 of size 128 The buggy address is located 4 bytes inside of 128-byte region [ffff888099560000, ffff888099560080) The buggy address belongs to the page: page:ffffea0002655800 refcount:1 mapcount:0 mapping:ffff8880aa400700 index:0x0 flags: 0x1fffc0000000200(slab) raw: 01fffc0000000200 ffffea00029de8c8 ffffea00027a79c8 ffff8880aa400700 raw: 0000000000000000 ffff888099560000 0000000100000010 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88809955ff00: fb fb fb fb fc fc fc fc fc fc fc fc fc fc fc fc ffff88809955ff80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888099560000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888099560080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888099560100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================