[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Yeise7Fs/PCxONId@lunn.ch>
Date: Thu, 20 Jan 2022 01:27:39 +0100
From: Andrew Lunn <andrew@...n.ch>
To: Marek Behún <kabel@...nel.org>
Cc: "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
Russell King <rmk+kernel@...linux.org.uk>,
Sergei Shtylyov <sergei.shtylyov@...entembedded.com>,
"David S . Miller" <davem@...emloft.net>
Subject: Re: [PATCH net] phylib: fix potential use-after-free
On Wed, Jan 19, 2022 at 05:27:48PM +0100, Marek Behún wrote:
> Commit bafbdd527d56 ("phylib: Add device reset GPIO support") added call
> to phy_device_reset(phydev) after the put_device() call in phy_detach().
>
> The comment before the put_device() call says that the phydev might go
> away with put_device().
>
> Fix potential use-after-free by calling phy_device_reset() before
> put_device().
>
> Fixes: bafbdd527d56 ("phylib: Add device reset GPIO support")
> Signed-off-by: Marek Behún <kabel@...nel.org>
Reviewed-by: Andrew Lunn <andrew@...n.ch>
Andrew
Powered by blists - more mailing lists