From: Vivien Didelot <vivien.didelot@gmail.com>
To: Florian Fainelli <f.fainelli@gmail.com>
Cc: netdev@vger.kernel.org, rmk+kernel@armlinux.org.uk,
hkallweit1@gmail.com, Florian Fainelli <f.fainelli@gmail.com>,
Andrew Lunn <andrew@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH net-next] net: dsa: Fix use after free in dsa_switch_remove()
Date: Sat, 2 Nov 2019 23:53:50 -0400 [thread overview]
Message-ID: <20191102235350.GB417753@t480s.localdomain> (raw)
In-Reply-To: <20191103031326.26873-1-f.fainelli@gmail.com>
On Sat, 2 Nov 2019 20:13:26 -0700, Florian Fainelli <f.fainelli@gmail.com> wrote:
> The order in which the ports are deleted from the list and freed and the
> call to dsa_tree_remove_switch() is done is reversed, which leads to an
s/dsa_tree_remove_switch/dsa_switch_remove/
> use after free condition. Reverse the two: first tear down the ports and
> switch from the fabric, then free the ports associated with that switch
> fabric.
>
> Fixes: 05f294a85235 ("net: dsa: allocate ports on touch")
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Thanks for reporting and fixing this!
Reviewed-by: Vivien Didelot <vivien.didelot@gmail.com>
next prev parent reply other threads:[~2019-11-03 3:53 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-03 3:13 [PATCH net-next] net: dsa: Fix use after free in dsa_switch_remove() Florian Fainelli
2019-11-03 3:53 ` Vivien Didelot [this message]
2019-11-06 1:55 ` David Miller
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=20191102235350.GB417753@t480s.localdomain \
--to=vivien.didelot@gmail.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=hkallweit1@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=rmk+kernel@armlinux.org.uk \
/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