linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [syzbot] BUG: sleeping function called from invalid context in sk_psock_stop
@ 2022-06-10 14:23 syzbot
  2022-06-10 14:35 ` Daniel Borkmann
  0 siblings, 1 reply; 4+ messages in thread
From: syzbot @ 2022-06-10 14:23 UTC (permalink / raw)
  To: andrii, ast, bpf, daniel, davem, edumazet, jakub, john.fastabend,
	kafai, kpsingh, kuba, linux-kernel, netdev, pabeni,
	songliubraving, syzkaller-bugs, wangyufen, yhs

Hello,

syzbot found the following issue on:

HEAD commit:    ff539ac73ea5 Add linux-next specific files for 20220609
git tree:       linux-next
console+strace: https://syzkaller.appspot.com/x/log.txt?x=176c121bf00000
kernel config:  https://syzkaller.appspot.com/x/.config?x=a5002042f00a8bce
dashboard link: https://syzkaller.appspot.com/bug?extid=140186ceba0c496183bc
compiler:       gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=13083353f00000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=173e67f0080000

The issue was bisected to:

commit d8616ee2affcff37c5d315310da557a694a3303d
Author: Wang Yufen <wangyufen@huawei.com>
Date:   Tue May 24 07:53:11 2022 +0000

    bpf, sockmap: Fix sk->sk_forward_alloc warn_on in sk_stream_kill_queues

bisection log:  https://syzkaller.appspot.com/x/bisect.txt?x=1556d7cff00000
final oops:     https://syzkaller.appspot.com/x/report.txt?x=1756d7cff00000
console output: https://syzkaller.appspot.com/x/log.txt?x=1356d7cff00000

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+140186ceba0c496183bc@syzkaller.appspotmail.com
Fixes: d8616ee2affc ("bpf, sockmap: Fix sk->sk_forward_alloc warn_on in sk_stream_kill_queues")

BUG: sleeping function called from invalid context at kernel/workqueue.c:3010
in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 3612, name: syz-executor475
preempt_count: 201, expected: 0
RCU nest depth: 0, expected: 0
3 locks held by syz-executor475/3612:
 #0: ffff888072eb9410 (&sb->s_type->i_mutex_key#10){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:740 [inline]
 #0: ffff888072eb9410 (&sb->s_type->i_mutex_key#10){+.+.}-{3:3}, at: __sock_release+0x86/0x280 net/socket.c:649
 #1: ffff888027259ab0 (sk_lock-AF_INET6){+.+.}-{0:0}, at: lock_sock include/net/sock.h:1691 [inline]
 #1: ffff888027259ab0 (sk_lock-AF_INET6){+.+.}-{0:0}, at: tcp_close+0x1e/0xc0 net/ipv4/tcp.c:2908
 #2: ffff888027259a30 (slock-AF_INET6){+...}-{2:2}, at: spin_lock include/linux/spinlock.h:360 [inline]
 #2: ffff888027259a30 (slock-AF_INET6){+...}-{2:2}, at: __tcp_close+0x722/0x12b0 net/ipv4/tcp.c:2830
Preemption disabled at:
[<ffffffff87ddddca>] local_bh_disable include/linux/bottom_half.h:20 [inline]
[<ffffffff87ddddca>] __tcp_close+0x71a/0x12b0 net/ipv4/tcp.c:2829
CPU: 1 PID: 3612 Comm: syz-executor475 Not tainted 5.19.0-rc1-next-20220609-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106
 __might_resched.cold+0x222/0x26b kernel/sched/core.c:9823
 start_flush_work kernel/workqueue.c:3010 [inline]
 __flush_work+0x109/0xb10 kernel/workqueue.c:3074
 __cancel_work_timer+0x3f9/0x570 kernel/workqueue.c:3162
 sk_psock_stop+0x4cb/0x630 net/core/skmsg.c:802
 sock_map_destroy+0x333/0x760 net/core/sock_map.c:1581
 inet_csk_destroy_sock+0x196/0x440 net/ipv4/inet_connection_sock.c:1130
 __tcp_close+0xd5b/0x12b0 net/ipv4/tcp.c:2897
 tcp_close+0x29/0xc0 net/ipv4/tcp.c:2909
 sock_map_close+0x3b9/0x780 net/core/sock_map.c:1607
 inet_release+0x12e/0x280 net/ipv4/af_inet.c:428
 inet6_release+0x4c/0x70 net/ipv6/af_inet6.c:481
 __sock_release+0xcd/0x280 net/socket.c:650
 sock_close+0x18/0x20 net/socket.c:1365
 __fput+0x277/0x9d0 fs/file_table.c:317
 task_work_run+0xdd/0x1a0 kernel/task_work.c:177
 ptrace_notify+0x114/0x140 kernel/signal.c:2353
 ptrace_report_syscall include/linux/ptrace.h:420 [inline]
 ptrace_report_syscall_exit include/linux/ptrace.h:482 [inline]
 syscall_exit_work kernel/entry/common.c:249 [inline]
 syscall_exit_to_user_mode_prepare+0xdb/0x230 kernel/entry/common.c:276
 __syscall_exit_to_user_mode_work kernel/entry/common.c:281 [inline]
 syscall_exit_to_user_mode+0x9/0x50 kernel/entry/common.c:294
 do_syscall_64+0x42/0xb0 arch/x86/entry/common.c:86
 entry_SYSCALL_64_after_hwframe+0x46/0xb0
RIP: 0033:0x7fe7b3b8b6a3
Code: c7 c2 c0 ff ff ff f7 d8 64 89 02 48 c7 c0 ff ff ff ff eb ba 0f 1f 00 64 8b 04 25 18 00 00 00 85 c0 75 14 b8 03 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 45 c3 0f 1f 40 00 48 83 ec 18 89 7c 24 0c e8
RSP: 002b:00007ffce5903258 EFLAGS: 00000246 ORIG_RAX: 0000000000000003
RAX: 0000000000000000 RBX: 0000000000000005 RCX: 00007fe7b3b8b6a3
RDX: 0000000000000020 RSI: 0000000020000240 RDI: 0000000000000004
RBP: 0000000000000000 R08: 00007fe7b3c36e40 R09: 00007fe7b3c36e40
R10: 00007fe7b3c36e40 R11: 0000000000000246 R12: 00007ffce5903290
R13: 00007ffce5903280 R14: 00007ffce5903270 R15: 0000000000000000
 </TASK>


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzkaller@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
For information about bisection process see: https://goo.gl/tpsmEJ#bisection
syzbot can test patches for this issue, for details see:
https://goo.gl/tpsmEJ#testing-patches

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [syzbot] BUG: sleeping function called from invalid context in sk_psock_stop
  2022-06-10 14:23 [syzbot] BUG: sleeping function called from invalid context in sk_psock_stop syzbot
@ 2022-06-10 14:35 ` Daniel Borkmann
       [not found]   ` <05a652f3-35a5-9bc6-e04d-bd03fc67a9af@huawei.com>
  0 siblings, 1 reply; 4+ messages in thread
From: Daniel Borkmann @ 2022-06-10 14:35 UTC (permalink / raw)
  To: syzbot, andrii, ast, bpf, davem, edumazet, jakub, john.fastabend,
	kafai, kpsingh, kuba, linux-kernel, netdev, pabeni,
	songliubraving, syzkaller-bugs, wangyufen, yhs

On 6/10/22 4:23 PM, syzbot wrote:
> Hello,
> 
> syzbot found the following issue on:
> 
> HEAD commit:    ff539ac73ea5 Add linux-next specific files for 20220609
> git tree:       linux-next
> console+strace: https://syzkaller.appspot.com/x/log.txt?x=176c121bf00000
> kernel config:  https://syzkaller.appspot.com/x/.config?x=a5002042f00a8bce
> dashboard link: https://syzkaller.appspot.com/bug?extid=140186ceba0c496183bc
> compiler:       gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2
> syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=13083353f00000
> C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=173e67f0080000
> 
> The issue was bisected to:
> 
> commit d8616ee2affcff37c5d315310da557a694a3303d
> Author: Wang Yufen <wangyufen@huawei.com>
> Date:   Tue May 24 07:53:11 2022 +0000
> 
>      bpf, sockmap: Fix sk->sk_forward_alloc warn_on in sk_stream_kill_queues

Same ping to Wang: Please take a look, otherwise we might need to revert if it stays unfixed.

> bisection log:  https://syzkaller.appspot.com/x/bisect.txt?x=1556d7cff00000
> final oops:     https://syzkaller.appspot.com/x/report.txt?x=1756d7cff00000
> console output: https://syzkaller.appspot.com/x/log.txt?x=1356d7cff00000
> 
> IMPORTANT: if you fix the issue, please add the following tag to the commit:
> Reported-by: syzbot+140186ceba0c496183bc@syzkaller.appspotmail.com
> Fixes: d8616ee2affc ("bpf, sockmap: Fix sk->sk_forward_alloc warn_on in sk_stream_kill_queues")
> 
> BUG: sleeping function called from invalid context at kernel/workqueue.c:3010
> in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 3612, name: syz-executor475
> preempt_count: 201, expected: 0
> RCU nest depth: 0, expected: 0
> 3 locks held by syz-executor475/3612:
>   #0: ffff888072eb9410 (&sb->s_type->i_mutex_key#10){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:740 [inline]
>   #0: ffff888072eb9410 (&sb->s_type->i_mutex_key#10){+.+.}-{3:3}, at: __sock_release+0x86/0x280 net/socket.c:649
>   #1: ffff888027259ab0 (sk_lock-AF_INET6){+.+.}-{0:0}, at: lock_sock include/net/sock.h:1691 [inline]
>   #1: ffff888027259ab0 (sk_lock-AF_INET6){+.+.}-{0:0}, at: tcp_close+0x1e/0xc0 net/ipv4/tcp.c:2908
>   #2: ffff888027259a30 (slock-AF_INET6){+...}-{2:2}, at: spin_lock include/linux/spinlock.h:360 [inline]
>   #2: ffff888027259a30 (slock-AF_INET6){+...}-{2:2}, at: __tcp_close+0x722/0x12b0 net/ipv4/tcp.c:2830
> Preemption disabled at:
> [<ffffffff87ddddca>] local_bh_disable include/linux/bottom_half.h:20 [inline]
> [<ffffffff87ddddca>] __tcp_close+0x71a/0x12b0 net/ipv4/tcp.c:2829
> CPU: 1 PID: 3612 Comm: syz-executor475 Not tainted 5.19.0-rc1-next-20220609-syzkaller #0
> Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
> Call Trace:
>   <TASK>
>   __dump_stack lib/dump_stack.c:88 [inline]
>   dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106
>   __might_resched.cold+0x222/0x26b kernel/sched/core.c:9823
>   start_flush_work kernel/workqueue.c:3010 [inline]
>   __flush_work+0x109/0xb10 kernel/workqueue.c:3074
>   __cancel_work_timer+0x3f9/0x570 kernel/workqueue.c:3162
>   sk_psock_stop+0x4cb/0x630 net/core/skmsg.c:802
>   sock_map_destroy+0x333/0x760 net/core/sock_map.c:1581
>   inet_csk_destroy_sock+0x196/0x440 net/ipv4/inet_connection_sock.c:1130
>   __tcp_close+0xd5b/0x12b0 net/ipv4/tcp.c:2897
>   tcp_close+0x29/0xc0 net/ipv4/tcp.c:2909
>   sock_map_close+0x3b9/0x780 net/core/sock_map.c:1607
>   inet_release+0x12e/0x280 net/ipv4/af_inet.c:428
>   inet6_release+0x4c/0x70 net/ipv6/af_inet6.c:481
>   __sock_release+0xcd/0x280 net/socket.c:650
>   sock_close+0x18/0x20 net/socket.c:1365
>   __fput+0x277/0x9d0 fs/file_table.c:317
>   task_work_run+0xdd/0x1a0 kernel/task_work.c:177
>   ptrace_notify+0x114/0x140 kernel/signal.c:2353
>   ptrace_report_syscall include/linux/ptrace.h:420 [inline]
>   ptrace_report_syscall_exit include/linux/ptrace.h:482 [inline]
>   syscall_exit_work kernel/entry/common.c:249 [inline]
>   syscall_exit_to_user_mode_prepare+0xdb/0x230 kernel/entry/common.c:276
>   __syscall_exit_to_user_mode_work kernel/entry/common.c:281 [inline]
>   syscall_exit_to_user_mode+0x9/0x50 kernel/entry/common.c:294
>   do_syscall_64+0x42/0xb0 arch/x86/entry/common.c:86
>   entry_SYSCALL_64_after_hwframe+0x46/0xb0
> RIP: 0033:0x7fe7b3b8b6a3
> Code: c7 c2 c0 ff ff ff f7 d8 64 89 02 48 c7 c0 ff ff ff ff eb ba 0f 1f 00 64 8b 04 25 18 00 00 00 85 c0 75 14 b8 03 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 45 c3 0f 1f 40 00 48 83 ec 18 89 7c 24 0c e8
> RSP: 002b:00007ffce5903258 EFLAGS: 00000246 ORIG_RAX: 0000000000000003
> RAX: 0000000000000000 RBX: 0000000000000005 RCX: 00007fe7b3b8b6a3
> RDX: 0000000000000020 RSI: 0000000020000240 RDI: 0000000000000004
> RBP: 0000000000000000 R08: 00007fe7b3c36e40 R09: 00007fe7b3c36e40
> R10: 00007fe7b3c36e40 R11: 0000000000000246 R12: 00007ffce5903290
> R13: 00007ffce5903280 R14: 00007ffce5903270 R15: 0000000000000000
>   </TASK>
> 
> 
> ---
> This report is generated by a bot. It may contain errors.
> See https://goo.gl/tpsmEJ for more information about syzbot.
> syzbot engineers can be reached at syzkaller@googlegroups.com.
> 
> syzbot will keep track of this issue. See:
> https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
> For information about bisection process see: https://goo.gl/tpsmEJ#bisection
> syzbot can test patches for this issue, for details see:
> https://goo.gl/tpsmEJ#testing-patches
> 


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [syzbot] BUG: sleeping function called from invalid context in sk_psock_stop
       [not found]   ` <05a652f3-35a5-9bc6-e04d-bd03fc67a9af@huawei.com>
@ 2022-06-14 19:58     ` Daniel Borkmann
  0 siblings, 0 replies; 4+ messages in thread
From: Daniel Borkmann @ 2022-06-14 19:58 UTC (permalink / raw)
  To: wangyufen, syzbot, andrii, ast, bpf, davem, edumazet, jakub,
	john.fastabend, kafai, kpsingh, kuba, linux-kernel, netdev,
	pabeni, songliubraving, syzkaller-bugs, yhs

On 6/13/22 12:52 PM, wangyufen wrote:
> 在 2022/6/10 22:35, Daniel Borkmann 写道:
>> On 6/10/22 4:23 PM, syzbot wrote:
>>> Hello,
>>>
>>> syzbot found the following issue on:
>>>
>>> HEAD commit:    ff539ac73ea5 Add linux-next specific files for 20220609
>>> git tree:       linux-next
>>> console+strace: https://syzkaller.appspot.com/x/log.txt?x=176c121bf00000
>>> kernel config: https://syzkaller.appspot.com/x/.config?x=a5002042f00a8bce
>>> dashboard link: https://syzkaller.appspot.com/bug?extid=140186ceba0c496183bc
>>> compiler:       gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2
>>> syz repro: https://syzkaller.appspot.com/x/repro.syz?x=13083353f00000
>>> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=173e67f0080000
>>>
>>> The issue was bisected to:
>>>
>>> commit d8616ee2affcff37c5d315310da557a694a3303d
>>> Author: Wang Yufen <wangyufen@huawei.com>
>>> Date:   Tue May 24 07:53:11 2022 +0000
>>>
>>>      bpf, sockmap: Fix sk->sk_forward_alloc warn_on in sk_stream_kill_queues
>>
>> Same ping to Wang: Please take a look, otherwise we might need to revert if it stays unfixed.
> 
> Thanks for Hillf's fix : https://groups.google.com/g/syzkaller-bugs/c/zunoClAqFQo/m/6SP7LIQoCQAJ
> 
> and sorry for the delay.

Please send this as a proper fix then, so it lands in patchwork and can be applied.

Thanks,
Daniel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [syzbot] BUG: sleeping function called from invalid context in sk_psock_stop
       [not found] <20220611015957.1549-1-hdanton@sina.com>
@ 2022-06-11  2:19 ` syzbot
  0 siblings, 0 replies; 4+ messages in thread
From: syzbot @ 2022-06-11  2:19 UTC (permalink / raw)
  To: hdanton, linux-kernel, syzkaller-bugs

Hello,

syzbot has tested the proposed patch and the reproducer did not trigger any issue:

Reported-and-tested-by: syzbot+140186ceba0c496183bc@syzkaller.appspotmail.com

Tested on:

commit:         ff539ac7 Add linux-next specific files for 20220609
git tree:       https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
console output: https://syzkaller.appspot.com/x/log.txt?x=1462f61bf00000
kernel config:  https://syzkaller.appspot.com/x/.config?x=a5002042f00a8bce
dashboard link: https://syzkaller.appspot.com/bug?extid=140186ceba0c496183bc
compiler:       gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2
patch:          https://syzkaller.appspot.com/x/patch.diff?x=12a7d9bff00000

Note: testing is done by a robot and is best-effort only.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-06-14 19:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-10 14:23 [syzbot] BUG: sleeping function called from invalid context in sk_psock_stop syzbot
2022-06-10 14:35 ` Daniel Borkmann
     [not found]   ` <05a652f3-35a5-9bc6-e04d-bd03fc67a9af@huawei.com>
2022-06-14 19:58     ` Daniel Borkmann
     [not found] <20220611015957.1549-1-hdanton@sina.com>
2022-06-11  2:19 ` syzbot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).