From patchwork Fri Sep 13 10:05:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Chevallier X-Patchwork-Id: 13803224 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 6B3D9FA373B for ; Fri, 13 Sep 2024 10:07:40 +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: MIME-Version:Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=sb8OmTvdd+dIsC9dyf2pocv8PVncITqBRJUMunpw6gw=; b=33HhCO8rFuqZayT+QNxk6skl/6 jIEv+FsaS+3MlFVjGY38Eb0xPzEfEqkFkWxDn2dx9E7NI2vHhNlgteM8IcfWQ0AXN6TIxHjLc/9zk RvX8VFyxUu3p1+q969LV7bmwBMc2uH3Nnlu9yLj35O1E6217rPu+CxD6AMlTJni7VdRAO+q3UMECd kUNLWbXRMuoVdwni/4Vw8sfGMBkMHFw9zSfM1Lt5eqIdTTjioF5wpaxb0qWdL9UhdCd4DxKmn3lH0 c/mRqlbhyFaVJxkWiaZBGXB+z6xioaytyIEJhYe2XKX9S9z3k19BPK738WwFbLTXx/9dtxmjAhsBu Bqe3YEhw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sp3D7-0000000FZG3-1o06; Fri, 13 Sep 2024 10:07:29 +0000 Received: from relay5-d.mail.gandi.net ([2001:4b98:dc4:8::225]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sp3B2-0000000FYwy-2n72 for linux-arm-kernel@lists.infradead.org; Fri, 13 Sep 2024 10:05:22 +0000 Received: by mail.gandi.net (Postfix) with ESMTPSA id D9C8A1C0009; Fri, 13 Sep 2024 10:05:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1726221918; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=sb8OmTvdd+dIsC9dyf2pocv8PVncITqBRJUMunpw6gw=; b=fRqlPiDNyGAeKYA0J99L2csaRyTf9rsykL2gUTFW3WA7eGha7aGdXfTFQ9Drlg4p+4LB+7 YVF9w2pXzk1i1RlAdH566a3RQmcXsH51k/Nh0F3L5DJS/PPEWzln+tamotbPCrO9VgqNsO FQraR/7rSsCXteVM6AntmjxZWXsmQUv5310EFBwOh4+mhS9dAwNP9Xjd8AyiNVn5T9+Chg Wt0hW8q/0XKh+bUUXd/f3jD5dIw3qMM2wla2P7OqwWy57WmQWsy05fByUkPM8/OdulTiTG EDeZFXcasB4slkj8CFPZhL0DWAyDdwhqBOQcu8ta7twYg0tSTymJ3kEpL16VLQ== From: Maxime Chevallier To: davem@davemloft.net Cc: Maxime Chevallier , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, thomas.petazzoni@bootlin.com, Andrew Lunn , Jakub Kicinski , Eric Dumazet , Paolo Abeni , Russell King , linux-arm-kernel@lists.infradead.org, Christophe Leroy , Herve Codina , Florian Fainelli , Heiner Kallweit , Vladimir Oltean , =?utf-8?q?K=C3=B6ry_Maincent?= , =?utf-8?q?Marek?= =?utf-8?q?_Beh=C3=BAn?= , Piergiorgio Beruto , Oleksij Rempel , =?utf-8?q?Nicol=C3=B2_Veronese?= , Simon Horman , mwojtas@chromium.org, Nathan Chancellor , Antoine Tenart , Marc Kleine-Budde , Dan Carpenter , Romain Gantois , syzbot+e9ed4e4368d450c8f9db@syzkaller.appspotmail.com Subject: [PATCH net-next] net: ethtool: phy: Don't set the context dev pointer for unfiltered DUMP Date: Fri, 13 Sep 2024 12:05:14 +0200 Message-ID: <20240913100515.167341-1-maxime.chevallier@bootlin.com> X-Mailer: git-send-email 2.46.0 MIME-Version: 1.0 X-GND-Sasl: maxime.chevallier@bootlin.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240913_030521_351670_99972319 X-CRM114-Status: UNSURE ( 9.72 ) X-CRM114-Notice: Please train this message. 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 The context info allows continuing DUMP requests, shall they fill the netlink buffer. In the case of filtered DUMP requests, a reference on the netdev is grabbed in the .start() callback and release in .done(). Unfiltered DUMP request don't need the dev pointer to be set in the context info, doing so will trigger an unwanted netdev_put() in .done(). Reported-by: syzbot+e9ed4e4368d450c8f9db@syzkaller.appspotmail.com Closes: https://lore.kernel.org/netdev/000000000000d3bf150621d361a7@google.com/ Fixes: 17194be4c8e1 ("net: ethtool: Introduce a command to list PHYs on an interface") Signed-off-by: Maxime Chevallier Reviewed-by: Vadim Fedorenko --- This patch fixes a commit that still lives in net-next. net/ethtool/phy.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/net/ethtool/phy.c b/net/ethtool/phy.c index 4ef7c6e32d10..ed8f690f6bac 100644 --- a/net/ethtool/phy.c +++ b/net/ethtool/phy.c @@ -251,8 +251,6 @@ static int ethnl_phy_dump_one_dev(struct sk_buff *skb, struct net_device *dev, int ret = 0; void *ehdr; - pri->base.dev = dev; - if (!dev->link_topo) return 0;