From: Greg KH <gregkh@linuxfoundation.org>
To: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Cc: stable@vger.kernel.org, netdev@vger.kernel.org, kuba@kernel.org,
davem@davemloft.net, jiri@resnulli.us, xiyou.wangcong@gmail.com,
jhs@mojatatu.com, vladbu@mellanox.com
Subject: Re: [PATCH 4.9.y] net: sched: prevent UAF on tc_ctl_tfilter when temporarily dropping rtnl_lock
Date: Tue, 3 May 2022 16:27:20 +0200 [thread overview]
Message-ID: <YnE7yBTTsJ/9JSjm@kroah.com> (raw)
In-Reply-To: <YnE7AbD1eYTBBVeE@quatroqueijos>
On Tue, May 03, 2022 at 11:24:01AM -0300, Thadeu Lima de Souza Cascardo wrote:
> On Tue, May 03, 2022 at 03:49:15PM +0200, Greg KH wrote:
> > On Mon, May 02, 2022 at 05:49:24PM -0300, Thadeu Lima de Souza Cascardo wrote:
> > > When dropping the rtnl_lock for looking up for a module, the device may be
> > > removed, releasing the qdisc and class memory. Right after trying to load
> > > the module, cl_ops->put is called, leading to a potential use-after-free.
> > >
> > > Though commit e368fdb61d8e ("net: sched: use Qdisc rcu API instead of
> > > relying on rtnl lock") fixes this, it involves a lot of refactoring of the
> > > net/sched/ code, complicating its backport.
> >
> > What about 4.14.y? We can not take a commit for 4.9.y with it also
> > being broken in 4.14.y, and yet fixed in 4.19.y, right? Anyone who
> > updates from 4.9 to 4.14 will have a regression.
> >
> > thanks,
> >
> > greg k-h
>
> 4.14.y does not call cl_ops->put (the get/put and class refcount has been done
> with on 4.14.y). However, on the error path after the lock has been dropped,
> tcf_chain_put is called. But it does not touch the qdisc, but only the chain
> and block objects, which cannot be released on a race condition, as far as I
> was able to investigate.
So what changed between 4.9 and 4.14 that requires this out-of-tree
change to 4.9 for the issue? Shouldn't we backport that change instead
of this custom one?
thanks,
greg k-h
next prev parent reply other threads:[~2022-05-03 14:27 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-02 20:49 [PATCH 4.9.y] net: sched: prevent UAF on tc_ctl_tfilter when temporarily dropping rtnl_lock Thadeu Lima de Souza Cascardo
2022-05-03 13:49 ` Greg KH
2022-05-03 14:24 ` Thadeu Lima de Souza Cascardo
2022-05-03 14:27 ` Greg KH [this message]
2022-05-03 14:42 ` Thadeu Lima de Souza Cascardo
2022-05-10 11:13 ` Greg KH
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=YnE7yBTTsJ/9JSjm@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=cascardo@canonical.com \
--cc=davem@davemloft.net \
--cc=jhs@mojatatu.com \
--cc=jiri@resnulli.us \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=stable@vger.kernel.org \
--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