Re: WARNING in sk_stream_kill_queues
From: Vasily Averin
Date: Sat Sep 04 2021 - 10:48:38 EST
On 9/3/21 9:10 PM, Vasily Averin wrote:
> On 9/3/21 7:56 PM, Eric Dumazet wrote:
>> On 9/3/21 12:54 AM, Hao Sun wrote:
>>> Hello,
>>>
>>> When using Healer to fuzz the latest Linux kernel, the following crash
>>> was triggered.
>>>
>>> HEAD commit: 9e9fb7655ed58 Merge tag 'net-next-5.15'
>>> git tree: upstream
>>> console output:
>>> https://drive.google.com/file/d/1AXEQDnn7SPgFAMjqbL03_24-X_8YHoAq/view?usp=sharing
>>> kernel config: https://drive.google.com/file/d/1zgxbwaYkrM26KEmJ-5sUZX57gfXtRrwA/view?usp=sharing
>>> C reproducer: https://drive.google.com/file/d/1qa4FVNoO-EsJGuDMtGlTxtHW0li-vMSP/view?usp=sharing
>>> Syzlang reproducer:
>>> https://drive.google.com/file/d/1pL6atNID5ZGzH4GceqyBCOC5IjFfiaVN/view?usp=sharing
>
>>> If you fix this issue, please add the following tag to the commit:
>>> Reported-by: Hao Sun <sunhao.th@xxxxxxxxx>
>>
>> This is probably a dup, causes skb_expand_head() changes,
>> CC Vasily Averin <vvs@xxxxxxxxxxxxx> is currently working on a fix.
>
> Thank you for this report and especially for C reproducer!
Eric,
this problem is not related to my patches.
I've reproduced the problem locally on orignal kernel with original config,
then I've applied last version of my patch -- but it did not help, issue was reproduced again,
then I've reverted all my patches, see lest below -- and reproduced the problem once again
Thank you,
Vasily Averin
b8a0bb68ac30 (HEAD -> net-next-5.15) Revert "ipv6: allocate enough headroom in ip6_finish_output2()"
1bc2de674a1b Revert "ipv6: ip6_finish_output2: set sk into newly allocated nskb"
780e2f7d9b93 Revert "skbuff: introduce skb_expand_head()"
782eaeed9de7 Revert "ipv6: use skb_expand_head in ip6_finish_output2"
639e9842fc1f Revert "ipv6: use skb_expand_head in ip6_xmit"
3b16ee164bcd Revert "ipv4: use skb_expand_head in ip_finish_output2"
ab48caf0e632 Revert "vrf: use skb_expand_head in vrf_finish_output"
4da67a72ceef Revert "ax25: use skb_expand_head"
9b113a8a62f0 Revert "bpf: use skb_expand_head in bpf_out_neigh_v4/6"
fc4ab503ce8f Revert "vrf: fix NULL dereference in vrf_finish_output()"
>>> ------------[ cut here ]------------
>>> WARNING: CPU: 1 PID: 10229 at net/core/stream.c:207
>>> sk_stream_kill_queues+0x162/0x190 net/core/stream.c:207
>>> Modules linked in:
>>> CPU: 1 PID: 10229 Comm: syz-executor Not tainted 5.14.0+ #12
>>> Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS
>>> rel-1.12.0-59-gc9ba5276e321-prebuilt.qemu.org 04/01/2014
>>> RIP: 0010:sk_stream_kill_queues+0x162/0x190 net/core/stream.c:207
>>> Code: 41 5c e9 21 3b ce fd e8 1c 3b ce fd 89 de 48 89 ef e8 62 68 fe
>>> ff e8 0d 3b ce fd 8b 95 68 02 00 00 85 d2 74 ca e8 fe 3a ce fd <0f> 0b
>>> e8 f7 3a ce fd 8b 85 20 02 00 00 85 c0 74 c3 e8 e8 3a ce fd
>>> RSP: 0018:ffffc900080b7c98 EFLAGS: 00010202
>>> RAX: 000000000002a750 RBX: 0000000000000180 RCX: ffffc90002c0d000
>>> RDX: 0000000000040000 RSI: ffffffff836939f2 RDI: ffff8881031f0b40
>>> RBP: ffff8881031f0b40 R08: 0000000000000000 R09: 0000000000000000
>>> R10: 000000000000000d R11: 000000000004f380 R12: ffff8881031f0c90
>>> R13: ffff8881031f0bc0 R14: ffff8881031f0cf0 R15: 0000000000000000
>>> FS: 00007f311adcb700(0000) GS:ffff88813dc00000(0000) knlGS:0000000000000000
>>> CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
>>> CR2: 0000000000732190 CR3: 000000010ab01000 CR4: 0000000000752ee0
>>> DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
>>> DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
>>> PKRU: 55555554
>>> Call Trace:
>>> inet_csk_destroy_sock+0x6f/0x1a0 net/ipv4/inet_connection_sock.c:1012
>>> __tcp_close+0x512/0x610 net/ipv4/tcp.c:2869
>>> tcp_close+0x29/0xa0 net/ipv4/tcp.c:2881
>>> inet_release+0x58/0xb0 net/ipv4/af_inet.c:431
>>> __sock_release+0x47/0xf0 net/socket.c:649
>>> sock_close+0x18/0x20 net/socket.c:1314
>>> __fput+0xdf/0x380 fs/file_table.c:280
>>> task_work_run+0x86/0xd0 kernel/task_work.c:164
>>> get_signal+0xde6/0x10b0 kernel/signal.c:2596
>>> arch_do_signal_or_restart+0xa9/0x860 arch/x86/kernel/signal.c:865
>>> handle_signal_work kernel/entry/common.c:148 [inline]
>>> exit_to_user_mode_loop kernel/entry/common.c:172 [inline]
>>> exit_to_user_mode_prepare+0xf2/0x280 kernel/entry/common.c:209
>>> __syscall_exit_to_user_mode_work kernel/entry/common.c:291 [inline]
>>> syscall_exit_to_user_mode+0x19/0x60 kernel/entry/common.c:302
>>> do_syscall_64+0x40/0xb0 arch/x86/entry/common.c:86
>>> entry_SYSCALL_64_after_hwframe+0x44/0xae
>>> RIP: 0033:0x46a9a9
>>> Code: f7 d8 64 89 02 b8 ff ff ff ff c3 66 0f 1f 44 00 00 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 73 01 c3 48 c7 c1 bc ff ff ff f7 d8 64 89 01 48
>>> RSP: 002b:00007f311adcac58 EFLAGS: 00000246 ORIG_RAX: 000000000000002c
>>> RAX: 0000000000069340 RBX: 000000000078c0a0 RCX: 000000000046a9a9
>>> RDX: 0000000000088012 RSI: 0000000020000380 RDI: 0000000000000004
>>> RBP: 00000000004e4042 R08: 0000000000000000 R09: 0000000000000027
>>> R10: 000000000020c49a R11: 0000000000000246 R12: 000000000078c0a0
>>> R13: 0000000000000000 R14: 000000000078c0a0 R15: 00007ffe75b47830
>>>
>