From: Denis Efremov <denis.e.efremov@oracle.com>
To: Yanfei Xu <yanfei.xu@windriver.com>,
andrew@lunn.ch, hkallweit1@gmail.com, linux@armlinux.org.uk,
davem@davemloft.net, kuba@kernel.org, p.zabel@pengutronix.de,
syzbot+398e7dc692ddbbb4cfec@syzkaller.appspotmail.com,
Dan Carpenter <dan.carpenter@oracle.com>,
Pavel Skripkin <paskripkin@gmail.com>
Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH] net: mdiobus: Fix memory leak in __mdiobus_register
Date: Thu, 30 Sep 2021 00:31:30 +0300 [thread overview]
Message-ID: <73b75092-a0b9-04b2-64f2-1f28c245b64a@oracle.com> (raw)
In-Reply-To: <20210926045313.2267655-1-yanfei.xu@windriver.com>
Hi,
Just want to note that highly likely this patch reintroduces
CVE-2019-12819 that was fixed in commit
6ff7b060535e ("mdio_bus: Fix use-after-free on device_register fails")
and added by the same patch in commit
0c692d07842a ("drivers/net/phy/mdio_bus.c: call put_device on device_register() failure")
> drivers/net/phy/mdio_bus.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c
> index 53f034fc2ef7..6f4b4e5df639 100644
> --- a/drivers/net/phy/mdio_bus.c
> +++ b/drivers/net/phy/mdio_bus.c
> @@ -537,6 +537,7 @@ int __mdiobus_register(struct mii_bus *bus, struct module *owner)
> err = device_register(&bus->dev);
> if (err) {
> pr_err("mii_bus %s failed to register\n", bus->id);
> + put_device(&bus->dev);
> return -EINVAL;
> }
Thanks,
Denis
prev parent reply other threads:[~2021-09-29 21:34 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-26 4:53 [PATCH] net: mdiobus: Fix memory leak in __mdiobus_register Yanfei Xu
2021-09-26 15:34 ` Andrew Lunn
2021-09-27 12:30 ` patchwork-bot+netdevbpf
2021-09-28 8:55 ` Dan Carpenter
2021-09-28 9:26 ` Dan Carpenter
2021-09-28 9:45 ` Pavel Skripkin
2021-09-28 10:39 ` Dan Carpenter
2021-09-28 10:46 ` Pavel Skripkin
2021-09-28 10:55 ` Dan Carpenter
2021-09-28 11:04 ` Pavel Skripkin
2021-09-28 10:59 ` Dan Carpenter
2021-09-28 11:06 ` Pavel Skripkin
2021-09-28 11:09 ` Pavel Skripkin
2021-09-28 11:30 ` Dan Carpenter
2021-09-28 11:45 ` Pavel Skripkin
2021-09-28 12:23 ` Dan Carpenter
2021-09-28 12:58 ` Russell King (Oracle)
2021-09-28 13:52 ` Dan Carpenter
2021-09-28 15:41 ` Russell King (Oracle)
2021-09-28 15:48 ` Dongliang Mu
2021-09-29 2:05 ` Xu, Yanfei
2021-09-28 13:11 ` Russell King (Oracle)
2021-09-29 21:31 ` Denis Efremov [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=73b75092-a0b9-04b2-64f2-1f28c245b64a@oracle.com \
--to=denis.e.efremov@oracle.com \
--cc=andrew@lunn.ch \
--cc=dan.carpenter@oracle.com \
--cc=davem@davemloft.net \
--cc=hkallweit1@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=netdev@vger.kernel.org \
--cc=p.zabel@pengutronix.de \
--cc=paskripkin@gmail.com \
--cc=syzbot+398e7dc692ddbbb4cfec@syzkaller.appspotmail.com \
--cc=yanfei.xu@windriver.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).