WARNING in mptcp_reset_timer

9 views
Skip to first unread message

syzbot

unread,
Nov 18, 2020, 5:59:19ā€ÆAM11/18/20
to da...@davemloft.net, ku...@kernel.org, linux-...@vger.kernel.org, mathew.j....@linux.intel.com, matthie...@tessares.net, mp...@lists.01.org, net...@vger.kernel.org, syzkall...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 7c8ca812 Add linux-next specific files for 20201117
git tree: linux-next
console output: https://syzkaller.appspot.com/x/log.txt?x=14ccfce2500000
kernel config: https://syzkaller.appspot.com/x/.config?x=ff4bc71371dc5b13
dashboard link: https://syzkaller.appspot.com/bug?extid=42aa53dafb66a07e5a24
compiler: gcc (GCC) 10.1.0-syz 20200507
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=1342e36e500000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=17f29bba500000

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+42aa53...@syzkaller.appspotmail.com

------------[ cut here ]------------
WARNING: CPU: 1 PID: 8718 at net/mptcp/protocol.c:719 mptcp_reset_timer+0x12a/0x160 net/mptcp/protocol.c:719
Modules linked in:
CPU: 1 PID: 8718 Comm: kworker/1:3 Not tainted 5.10.0-rc4-next-20201117-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Workqueue: events mptcp_worker
RIP: 0010:mptcp_reset_timer+0x12a/0x160 net/mptcp/protocol.c:719
Code: e8 0b 87 43 fe e8 46 71 c5 f8 48 b8 00 00 00 00 00 fc ff df 48 c7 04 03 00 00 00 00 48 83 c4 40 5b 5d 41 5c c3 e8 26 71 c5 f8 <0f> 0b 41 bc 14 00 00 00 eb 98 e8 c7 d3 07 f9 e9 30 ff ff ff 48 c7
RSP: 0018:ffffc90001adfa38 EFLAGS: 00010293
RAX: 0000000000000000 RBX: 1ffff9200035bf47 RCX: ffffffff88ab2357
RDX: ffff88801ae14f80 RSI: ffffffff88ab23ba RDI: 0000000000000007
RBP: ffff888024200000 R08: 0000000000000000 R09: ffff88802420084f
R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000
R13: 0000000000281400 R14: ffff888024200000 R15: dffffc0000000000
FS: 0000000000000000(0000) GS:ffff8880b9f00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f994238f010 CR3: 0000000028d92000 CR4: 00000000001506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
mptcp_push_pending+0x1351/0x17c0 net/mptcp/protocol.c:1266
mptcp_worker+0x385/0x1a10 net/mptcp/protocol.c:1877
process_one_work+0x933/0x15a0 kernel/workqueue.c:2272
worker_thread+0x64c/0x1120 kernel/workqueue.c:2418
kthread+0x3af/0x4a0 kernel/kthread.c:292
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:296


---
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 syzk...@googlegroups.com.

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

Paolo Abeni

unread,
Nov 18, 2020, 10:44:12ā€ÆAM11/18/20
to syzbot, mp...@lists.01.org, syzkall...@googlegroups.com
On Wed, 2020-11-18 at 02:59 -0800, syzbot wrote:
> Hello,
>
> syzbot found the following issue on:
>
> HEAD commit: 7c8ca812 Add linux-next specific files for 20201117
> git tree: linux-next
> console output: https://syzkaller.appspot.com/x/log.txt?x=14ccfce2500000
> kernel config: https://syzkaller.appspot.com/x/.config?x=ff4bc71371dc5b13
> dashboard link: https://syzkaller.appspot.com/bug?extid=42aa53dafb66a07e5a24
> compiler: gcc (GCC) 10.1.0-syz 20200507
> syz repro: https://syzkaller.appspot.com/x/repro.syz?x=1342e36e500000
> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=17f29bba500000
>
> IMPORTANT: if you fix the issue, please add the following tag to the commit:
> Reported-by: syzbot+42aa53...@syzkaller.appspotmail.com

#syz test: https://github.com/multipath-tcp/mptcp_net-next.git master
---
diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index 8df013daea88..aeda4357de9a 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -1261,11 +1261,12 @@ static void mptcp_push_pending(struct sock *sk, unsigned int flags)
mptcp_push_release(sk, ssk, &info);

out:
- /* start the timer, if it's not pending */
- if (!mptcp_timer_pending(sk))
- mptcp_reset_timer(sk);
- if (copied)
+ if (copied) {
+ /* start the timer, if it's not pending */
+ if (!mptcp_timer_pending(sk))
+ mptcp_reset_timer(sk);
__mptcp_check_send_data_fin(sk);
+ }
}

static int mptcp_sendmsg(struct sock *sk, struct msghdr *msg, size_t len)

Paolo Abeni

unread,
Nov 18, 2020, 11:05:13ā€ÆAM11/18/20
to syzbot, mp...@lists.01.org, syzkall...@googlegroups.com
On Wed, 2020-11-18 at 16:44 +0100, Paolo Abeni wrote:
> On Wed, 2020-11-18 at 02:59 -0800, syzbot wrote:
> > Hello,
> >
> > syzbot found the following issue on:
> >
> > HEAD commit: 7c8ca812 Add linux-next specific files for 20201117
> > git tree: linux-next
> > console output: https://syzkaller.appspot.com/x/log.txt?x=14ccfce2500000
> > kernel config: https://syzkaller.appspot.com/x/.config?x=ff4bc71371dc5b13
> > dashboard link: https://syzkaller.appspot.com/bug?extid=42aa53dafb66a07e5a24
> > compiler: gcc (GCC) 10.1.0-syz 20200507
> > syz repro: https://syzkaller.appspot.com/x/repro.syz?x=1342e36e500000
> > C reproducer: https://syzkaller.appspot.com/x/repro.c?x=17f29bba500000
> >
> > IMPORTANT: if you fix the issue, please add the following tag to the commit:
> > Reported-by: syzbot+42aa53...@syzkaller.appspotmail.com
>
> #syz test: https://github.com/multipath-tcp/mptcp_net-next.git master

whooops... wrong git repo! Should be plain net-next instead. I'll
resend another reply for syzbot.

@syzbot team: you can stop whatever task my previous mail has
triggered, thanks!

I'm sorry for the waste of resources.

Paolo

Paolo Abeni

unread,
Nov 18, 2020, 11:08:12ā€ÆAM11/18/20
to syzbot, mp...@lists.01.org, syzkall...@googlegroups.com
On Wed, 2020-11-18 at 02:59 -0800, syzbot wrote:
> Hello,
>
> syzbot found the following issue on:
>
> HEAD commit: 7c8ca812 Add linux-next specific files for 20201117
> git tree: linux-next
> console output: https://syzkaller.appspot.com/x/log.txt?x=14ccfce2500000
> kernel config: https://syzkaller.appspot.com/x/.config?x=ff4bc71371dc5b13
> dashboard link: https://syzkaller.appspot.com/bug?extid=42aa53dafb66a07e5a24
> compiler: gcc (GCC) 10.1.0-syz 20200507
> syz repro: https://syzkaller.appspot.com/x/repro.syz?x=1342e36e500000
> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=17f29bba500000
>
> IMPORTANT: if you fix the issue, please add the following tag to the commit:
> Reported-by: syzbot+42aa53...@syzkaller.appspotmail.com

#syz test: git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git master

syzbot

unread,
Nov 18, 2020, 11:30:06ā€ÆAM11/18/20
to mp...@lists.01.org, pab...@redhat.com, syzkall...@googlegroups.com
Hello,

syzbot tried to test the proposed patch but the build/boot failed:

failed to apply patch:
can't find file to patch at input line 5
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
|index 8df013daea88..aeda4357de9a 100644
|--- a/net/mptcp/protocol.c
|+++ b/net/mptcp/protocol.c
--------------------------
No file to patch. Skipping patch.
1 out of 1 hunk ignored



Tested on:

commit: 4ba5a1c4 Merge branch 'net-next/master'
git tree: https://github.com/multipath-tcp/mptcp_net-next.git master
dashboard link: https://syzkaller.appspot.com/bug?extid=42aa53dafb66a07e5a24
compiler: gcc (GCC) 10.1.0-syz 20200507
patch: https://syzkaller.appspot.com/x/patch.diff?x=16cb71ee500000

syzbot

unread,
Nov 18, 2020, 11:47:07ā€ÆAM11/18/20
to mp...@lists.01.org, pab...@redhat.com, syzkall...@googlegroups.com
Hello,

syzbot has tested the proposed patch but the reproducer is still triggering an issue:
BUG: sleeping function called from invalid context in sta_info_move_state

BUG: sleeping function called from invalid context at net/mac80211/sta_info.c:1962
in_atomic(): 0, irqs_disabled(): 0, non_block: 0, pid: 412, name: kworker/u4:4
4 locks held by kworker/u4:4/412:
#0: ffff888040956138 ((wq_completion)phy12){+.+.}-{0:0}, at: arch_atomic64_set arch/x86/include/asm/atomic64_64.h:34 [inline]
#0: ffff888040956138 ((wq_completion)phy12){+.+.}-{0:0}, at: atomic64_set include/asm-generic/atomic-instrumented.h:856 [inline]
#0: ffff888040956138 ((wq_completion)phy12){+.+.}-{0:0}, at: atomic_long_set include/asm-generic/atomic-long.h:41 [inline]
#0: ffff888040956138 ((wq_completion)phy12){+.+.}-{0:0}, at: set_work_data kernel/workqueue.c:616 [inline]
#0: ffff888040956138 ((wq_completion)phy12){+.+.}-{0:0}, at: set_work_pool_and_clear_pending kernel/workqueue.c:643 [inline]
#0: ffff888040956138 ((wq_completion)phy12){+.+.}-{0:0}, at: process_one_work+0x821/0x15a0 kernel/workqueue.c:2243
#1: ffffc9000163fda8 ((work_completion)(&sdata->work)){+.+.}-{0:0}, at: process_one_work+0x854/0x15a0 kernel/workqueue.c:2247
#2: ffff888024d04d00 (&wdev->mtx){+.+.}-{3:3}, at: sdata_lock net/mac80211/ieee80211_i.h:1015 [inline]
#2: ffff888024d04d00 (&wdev->mtx){+.+.}-{3:3}, at: ieee80211_ibss_work+0x93/0xe80 net/mac80211/ibss.c:1683
#3: ffffffff8b337160 (rcu_read_lock){....}-{1:2}, at: sta_info_insert_finish net/mac80211/sta_info.c:644 [inline]
#3: ffffffff8b337160 (rcu_read_lock){....}-{1:2}, at: sta_info_insert_rcu+0x680/0x2ba0 net/mac80211/sta_info.c:732
Preemption disabled at:
[<ffffffff88e7da0f>] __mutex_lock_common kernel/locking/mutex.c:955 [inline]
[<ffffffff88e7da0f>] __mutex_lock+0x10f/0x10e0 kernel/locking/mutex.c:1103
CPU: 0 PID: 412 Comm: kworker/u4:4 Not tainted 5.10.0-rc3-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Workqueue: phy12 ieee80211_iface_work
Call Trace:
__dump_stack lib/dump_stack.c:77 [inline]
dump_stack+0x107/0x163 lib/dump_stack.c:118
___might_sleep.cold+0x1e8/0x22e kernel/sched/core.c:7298
sta_info_move_state+0x32/0x8d0 net/mac80211/sta_info.c:1962
sta_info_free+0x65/0x3b0 net/mac80211/sta_info.c:274
sta_info_insert_rcu+0x303/0x2ba0 net/mac80211/sta_info.c:738
ieee80211_ibss_finish_sta+0x212/0x390 net/mac80211/ibss.c:592
ieee80211_ibss_work+0x2c7/0xe80 net/mac80211/ibss.c:1700
ieee80211_iface_work+0x91f/0xa90 net/mac80211/iface.c:1443
process_one_work+0x933/0x15a0 kernel/workqueue.c:2272
worker_thread+0x64c/0x1120 kernel/workqueue.c:2418
kthread+0x3af/0x4a0 kernel/kthread.c:292
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:296

=============================
[ BUG: Invalid wait context ]
5.10.0-rc3-syzkaller #0 Tainted: G W
-----------------------------
kworker/u4:4/412 is trying to lock:
ffff8880268c29d0 (&local->chanctx_mtx){+.+.}-{3:3}, at: ieee80211_recalc_min_chandef+0x49/0x140 net/mac80211/util.c:2741
other info that might help us debug this:
context-{4:4}
4 locks held by kworker/u4:4/412:
#0: ffff888040956138 ((wq_completion)phy12){+.+.}-{0:0}, at: arch_atomic64_set arch/x86/include/asm/atomic64_64.h:34 [inline]
#0: ffff888040956138 ((wq_completion)phy12){+.+.}-{0:0}, at: atomic64_set include/asm-generic/atomic-instrumented.h:856 [inline]
#0: ffff888040956138 ((wq_completion)phy12){+.+.}-{0:0}, at: atomic_long_set include/asm-generic/atomic-long.h:41 [inline]
#0: ffff888040956138 ((wq_completion)phy12){+.+.}-{0:0}, at: set_work_data kernel/workqueue.c:616 [inline]
#0: ffff888040956138 ((wq_completion)phy12){+.+.}-{0:0}, at: set_work_pool_and_clear_pending kernel/workqueue.c:643 [inline]
#0: ffff888040956138 ((wq_completion)phy12){+.+.}-{0:0}, at: process_one_work+0x821/0x15a0 kernel/workqueue.c:2243
#1: ffffc9000163fda8 ((work_completion)(&sdata->work)){+.+.}-{0:0}, at: process_one_work+0x854/0x15a0 kernel/workqueue.c:2247
#2: ffff888024d04d00 (&wdev->mtx){+.+.}-{3:3}, at: sdata_lock net/mac80211/ieee80211_i.h:1015 [inline]
#2: ffff888024d04d00 (&wdev->mtx){+.+.}-{3:3}, at: ieee80211_ibss_work+0x93/0xe80 net/mac80211/ibss.c:1683
#3: ffffffff8b337160 (rcu_read_lock){....}-{1:2}, at: sta_info_insert_finish net/mac80211/sta_info.c:644 [inline]
#3: ffffffff8b337160 (rcu_read_lock){....}-{1:2}, at: sta_info_insert_rcu+0x680/0x2ba0 net/mac80211/sta_info.c:732
stack backtrace:
CPU: 1 PID: 412 Comm: kworker/u4:4 Tainted: G W 5.10.0-rc3-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Workqueue: phy12 ieee80211_iface_work
Call Trace:
__dump_stack lib/dump_stack.c:77 [inline]
dump_stack+0x107/0x163 lib/dump_stack.c:118
print_lock_invalid_wait_context kernel/locking/lockdep.c:4483 [inline]
check_wait_context kernel/locking/lockdep.c:4544 [inline]
__lock_acquire.cold+0x310/0x3a2 kernel/locking/lockdep.c:4781
lock_acquire kernel/locking/lockdep.c:5436 [inline]
lock_acquire+0x2a3/0x8c0 kernel/locking/lockdep.c:5401
__mutex_lock_common kernel/locking/mutex.c:956 [inline]
__mutex_lock+0x134/0x10e0 kernel/locking/mutex.c:1103
ieee80211_recalc_min_chandef+0x49/0x140 net/mac80211/util.c:2741
sta_info_move_state+0x3cf/0x8d0 net/mac80211/sta_info.c:2019
sta_info_free+0x65/0x3b0 net/mac80211/sta_info.c:274
sta_info_insert_rcu+0x303/0x2ba0 net/mac80211/sta_info.c:738
ieee80211_ibss_finish_sta+0x212/0x390 net/mac80211/ibss.c:592
ieee80211_ibss_work+0x2c7/0xe80 net/mac80211/ibss.c:1700
ieee80211_iface_work+0x91f/0xa90 net/mac80211/iface.c:1443
process_one_work+0x933/0x15a0 kernel/workqueue.c:2272
worker_thread+0x64c/0x1120 kernel/workqueue.c:2418
kthread+0x3af/0x4a0 kernel/kthread.c:292
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:296


Tested on:

commit: 6997faa9 Merge branch 'fix-several-bad-kernel-doc-markups'
git tree: net-next
console output: https://syzkaller.appspot.com/x/log.txt?x=15ae97be500000
kernel config: https://syzkaller.appspot.com/x/.config?x=f9f2db0042d65d21
dashboard link: https://syzkaller.appspot.com/bug?extid=42aa53dafb66a07e5a24
compiler: gcc (GCC) 10.1.0-syz 20200507
patch: https://syzkaller.appspot.com/x/patch.diff?x=12080af2500000

Paolo Abeni

unread,
Nov 18, 2020, 12:03:07ā€ÆPM11/18/20
to syzbot, mp...@lists.01.org, syzkall...@googlegroups.com
This looks unrelated?!? Likely introduced by:

commit dcd479e10a0510522a5d88b29b8f79ea3467d501
Author: Johannes Berg <
johann...@intel.com>
Date: Fri Oct 9 14:17:11 2020 +0200

mac80211: always wind down STA state

and fixed by:

commit 7bc40aedf24d31d8bea80e1161e996ef4299fb10
Author: Johannes Berg <johann...@intel.com>
Date: Thu Nov 12 11:22:04 2020 +0100

mac80211: free sta in sta_info_insert_finish() on errors

which stands only in the -net tree.

I'll try to squash my tentative fix with the above...

Thanks,

Paolo

Paolo Abeni

unread,
Nov 18, 2020, 12:07:27ā€ÆPM11/18/20
to syzbot, mp...@lists.01.org, syzkall...@googlegroups.com
On Wed, 2020-11-18 at 02:59 -0800, syzbot wrote:
> Hello,
>
> syzbot found the following issue on:
>
> HEAD commit: 7c8ca812 Add linux-next specific files for 20201117
> git tree: linux-next
> console output: https://syzkaller.appspot.com/x/log.txt?x=14ccfce2500000
> kernel config: https://syzkaller.appspot.com/x/.config?x=ff4bc71371dc5b13
> dashboard link: https://syzkaller.appspot.com/bug?extid=42aa53dafb66a07e5a24
> compiler: gcc (GCC) 10.1.0-syz 20200507
> syz repro: https://syzkaller.appspot.com/x/repro.syz?x=1342e36e500000
> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=17f29bba500000
>
> IMPORTANT: if you fix the issue, please add the following tag to the commit:
> Reported-by: syzbot+42aa53...@syzkaller.appspotmail.com

#syz test: https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git master
---
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
index 4fe284ff1ea3..ec6973ee88ef 100644
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
@@ -705,7 +705,7 @@ static int sta_info_insert_finish(struct sta_info *sta) __acquires(RCU)
out_drop_sta:
local->num_sta--;
synchronize_net();
- __cleanup_single_sta(sta);
+ cleanup_single_sta(sta);
out_err:
mutex_unlock(&local->sta_mtx);
kfree(sinfo);
@@ -724,19 +724,13 @@ int sta_info_insert_rcu(struct sta_info *sta) __acquires(RCU)

err = sta_info_insert_check(sta);
if (err) {
+ sta_info_free(local, sta);
mutex_unlock(&local->sta_mtx);
rcu_read_lock();
- goto out_free;
+ return err;
}

- err = sta_info_insert_finish(sta);
- if (err)
- goto out_free;
-
- return 0;
- out_free:
- sta_info_free(local, sta);
- return err;
+ return sta_info_insert_finish(sta);
}

int sta_info_insert(struct sta_info *sta)
diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index 8df013daea88..aeda4357de9a 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c

syzbot

unread,
Nov 18, 2020, 4:58:06ā€ÆPM11/18/20
to mp...@lists.01.org, pab...@redhat.com, syzkall...@googlegroups.com
Hello,

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

Reported-and-tested-by: syzbot+42aa53...@syzkaller.appspotmail.com

Tested on:

commit: 2b8473d2 Documentation: Remove the deleted "framerelay" do..
git tree: https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git master
kernel config: https://syzkaller.appspot.com/x/.config?x=f9f2db0042d65d21
dashboard link: https://syzkaller.appspot.com/bug?extid=42aa53dafb66a07e5a24
compiler: gcc (GCC) 10.1.0-syz 20200507
patch: https://syzkaller.appspot.com/x/patch.diff?x=16b5865e500000

Note: testing is done by a robot and is best-effort only.
Reply all
Reply to author
Forward
0 new messages