From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D5844EDE9AB for ; Tue, 10 Sep 2024 17:22:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Subject:Cc:To: From:Date:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=0Ch6z1tjobzI++fJXbYA525eKQI+H40wH6oOlBG7IOc=; b=shfzz90DDjKQqVvppaY5rZAe9H F9fKJ6bghFQEojMNH8BkxoCiqunDSjdqDbITTfcvZhVh9hr7B59gEKOHJgUfLjrycqf+4Tk5Afkd6 GQVgqeg0/XqwGC71VBCIE5lU8A/u3d6hjPoXhGBwAxUBSZE71RgIc6G7HcDlbG8yUamwL8rQeypGb uRiMdHrg+UqUQJiieZ8grOniYtRScpb7FhacloYrh6u4qAAwOfufp73tpcfZaJxnWAIkATskcEdZO zWiaJUBiUCMWN0n6Nwi7Qw9wuK+zA5x5nyStM7BTqNXBe/uxEWmIwcwFNeu+oF5wAgkv+IF/UFtlz p959teog==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1so4Zd-00000006Wwq-375B; Tue, 10 Sep 2024 17:22:41 +0000 Received: from relay6-d.mail.gandi.net ([217.70.183.198]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1so4XU-00000006WFt-35su for linux-arm-kernel@lists.infradead.org; Tue, 10 Sep 2024 17:20:32 +0000 Received: by mail.gandi.net (Postfix) with ESMTPSA id 58A31C0006; Tue, 10 Sep 2024 17:20:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1725988824; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0Ch6z1tjobzI++fJXbYA525eKQI+H40wH6oOlBG7IOc=; b=lUKkbX3rbHq1e4tO1l0fOwoRZXIt/PkRz0pR5KPautsjwVgzUwmxgKIhykoNZVTg4GCGkf uvBZZ/E2vfQNih9denOi5GN3XL/bHcdUjK9k5QVUscTl/t3G7IyrT++rvxZh092ZsYAaa+ SVnjd/MynHtbdqNhXn9IXRWfM/zNuLg2vOWpipNXKT23Pfy32l4by+xIyYCI4GLncHhVkR rjrR5LwOBUsTJ7iq/nCOCRMkby3uVUQVITJ7zCdpYeP/r6X6o92aciYBzOClvnoNFuiwJm zDmy4WZ7nw9NSI/sx9m5TuAlvJJvVx7lcdKQ8XC8aVuLJyvhO/v7o8yOGaN5Mg== Date: Tue, 10 Sep 2024 19:20:20 +0200 From: Maxime Chevallier To: Eric Dumazet Cc: davem@davemloft.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, thomas.petazzoni@bootlin.com, Andrew Lunn , Jakub Kicinski , Paolo Abeni , Russell King , linux-arm-kernel@lists.infradead.org, Christophe Leroy , Herve Codina , Florian Fainelli , Heiner Kallweit , Vladimir Oltean , =?UTF-8?B?S8O2cnk=?= Maincent , Jesse Brandeburg , Marek =?UTF-8?B?QmVow7pu?= , Piergiorgio Beruto , Oleksij Rempel , =?UTF-8?B?Tmljb2zDsg==?= Veronese , Simon Horman , mwojtas@chromium.org, Nathan Chancellor , Antoine Tenart , Marc Kleine-Budde , Dan Carpenter , Romain Gantois Subject: Re: [PATCH net-next v18 07/13] net: ethtool: Introduce a command to list PHYs on an interface Message-ID: <20240910192020.5ab9cd16@fedora.home> In-Reply-To: References: <20240821151009.1681151-1-maxime.chevallier@bootlin.com> <20240821151009.1681151-8-maxime.chevallier@bootlin.com> Organization: Bootlin X-Mailer: Claws Mail 4.3.0 (GTK 3.24.43; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-GND-Sasl: maxime.chevallier@bootlin.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240910_102029_374976_1FA5CE51 X-CRM114-Status: GOOD ( 15.40 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hello Eric, On Tue, 10 Sep 2024 18:41:03 +0200 Eric Dumazet wrote: > > +int ethnl_phy_doit(struct sk_buff *skb, struct genl_info *info) > > +{ > > + struct phy_req_info req_info = {}; > > + struct nlattr **tb = info->attrs; > > + struct sk_buff *rskb; > > + void *reply_payload; > > + int reply_len; > > + int ret; > > + > > + ret = ethnl_parse_header_dev_get(&req_info.base, > > + tb[ETHTOOL_A_PHY_HEADER], > > + genl_info_net(info), info->extack, > > + true); > > + if (ret < 0) > > + return ret; > > + > > + rtnl_lock(); > > + > > + ret = ethnl_phy_parse_request(&req_info.base, tb, info->extack); > > + if (ret < 0) > > + goto err_unlock_rtnl; > > + > > + /* No PHY, return early */ > > I got a syzbot report here. I seem to have missed the report, sorry about that. > > Should we fix this with : > > diff --git a/net/ethtool/phy.c b/net/ethtool/phy.c > index 560dd039c6625ac0925a0f28c14ce77cf768b6a5..4ef7c6e32d1087dc71acb467f9cd2ab8faf4dc39 > 100644 > --- a/net/ethtool/phy.c > +++ b/net/ethtool/phy.c > @@ -164,7 +164,7 @@ int ethnl_phy_doit(struct sk_buff *skb, struct > genl_info *info) > goto err_unlock_rtnl; > > /* No PHY, return early */ > - if (!req_info.pdn->phy) > + if (!req_info.pdn) > goto err_unlock_rtnl; > > ret = ethnl_phy_reply_size(&req_info.base, info->extack); > > Indeed that's the correct fix. Should I send it ? ( including suggested-by/reported-by ) Thanks, Maxime