From: Vlad Buslov <vlad@buslov.dev>
To: Cong Wang <xiyou.wangcong@gmail.com>
Cc: netdev@vger.kernel.org,
syzbot+80e32b5d1f9923f8ace6@syzkaller.appspotmail.com,
Jamal Hadi Salim <jhs@mojatatu.com>,
Vlad Buslov <vladbu@mellanox.com>, Jiri Pirko <jiri@resnulli.us>
Subject: Re: [Patch net] act_ife: load meta modules before tcf_idr_check_alloc()
Date: Mon, 07 Sep 2020 15:12:34 +0300 [thread overview]
Message-ID: <87a6y1bxal.fsf@buslov.dev> (raw)
In-Reply-To: <20200904021011.27002-1-xiyou.wangcong@gmail.com>
On Fri 04 Sep 2020 at 05:10, Cong Wang <xiyou.wangcong@gmail.com> wrote:
> The following deadlock scenario is triggered by syzbot:
>
> Thread A: Thread B:
> tcf_idr_check_alloc()
> ...
> populate_metalist()
> rtnl_unlock()
> rtnl_lock()
> ...
> request_module() tcf_idr_check_alloc()
> rtnl_lock()
>
> At this point, thread A is waiting for thread B to release RTNL
> lock, while thread B is waiting for thread A to commit the IDR
> change with tcf_idr_insert() later.
>
> Break this deadlock situation by preloading ife modules earlier,
> before tcf_idr_check_alloc(), this is fine because we only need
> to load modules we need potentially.
>
> Reported-and-tested-by: syzbot+80e32b5d1f9923f8ace6@syzkaller.appspotmail.com
> Fixes: 0190c1d452a9 ("net: sched: atomically check-allocate action")
> Cc: Jamal Hadi Salim <jhs@mojatatu.com>
> Cc: Vlad Buslov <vladbu@mellanox.com>
> Cc: Jiri Pirko <jiri@resnulli.us>
> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
> ---
Thanks for fixing this, Cong! I've verified that all tdc ife tests pass
with this patch.
Reviewed-by: Vlad Buslov <vlad@buslov.dev>
Tested-by: Vlad Buslov <vlad@buslov.dev>
prev parent reply other threads:[~2020-09-07 12:15 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-04 2:10 [Patch net] act_ife: load meta modules before tcf_idr_check_alloc() Cong Wang
2020-09-05 5:14 ` Jakub Kicinski
2020-09-07 12:13 ` Vlad Buslov
2020-09-07 12:12 ` Vlad Buslov [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87a6y1bxal.fsf@buslov.dev \
--to=vlad@buslov.dev \
--cc=jhs@mojatatu.com \
--cc=jiri@resnulli.us \
--cc=netdev@vger.kernel.org \
--cc=syzbot+80e32b5d1f9923f8ace6@syzkaller.appspotmail.com \
--cc=vladbu@mellanox.com \
--cc=xiyou.wangcong@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).