Article View: linux.kernel.netdev
Article #23097Re: [PATCH v2] net: ethtool: do not call get_regs() for zero-length dumps
From: Andrew Lunn
Date: Thu, 26 Nov 2026 14:11
Date: Thu, 26 Nov 2026 14:11
37 lines
9931 bytes
9931 bytes
> > Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
> >
> > Who does this bother?
>
> The zero-length request itself is harmless, but it now trips the
> direction check in the USB core and, in setups with panic_on_warn, turns
> a privileged ETHTOOL_GREGS call into a kernel panic. That is the same
> class of issue as the plusb fix (CVE-2023-52742), which also carried a
> Fixes tag and a stable Cc, so I kept both.
Maybe. But how long has it been like this? Nobody has reported it, so
nobody is bothered by it.
Linus has been pushing back on the number of Fixes: which get
submitted. So we have to push back.
> > Some of the kAPIs consider passing 0 as being special. It is user
> > space asking the kernel how big a buffer is needed to hold the full
> > dump. The kernel sets the value in the structure and returns. User
> > space then allocates a buffer of that size, and makes the request
> > again.
> >
> > I don't know if this API actually does this. You need to look at the
> > logic and decide. But by returning this early, if it did, you have
> > broken that.
>
> I checked. ETHTOOL_GREGS has no zero-length size query: the uAPI tells
> users to get the dump size from ETHTOOL_GDRVINFO.regdump_len, ethtool(8)
> does exactly that, and ethtool_get_regs() only clamps a too-large
> regs.len down to get_regs_len(); with regs.len == 0 it does not fill in
> a size. So the early return does not remove a size query; it only stops
> asking the driver for a dump that cannot return any data.
Thanks for checking.
Andrew
Technical Details
Message-ID:
<5e76388e-e88a-4256-9324-aff0c9625aba@lunn.ch>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-372134-linux-kernel-netdev=dewy.ruReferences:
<20261126015239.6038-1-25031212351@stu.xidian.edu.cn> <366216bc-ccc3-4547-8587-87cdf35f552f@lunn.ch> <20261126082144.3295-1-25031212351@stu.xidian.edu.cn>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-372134-linux-kernel-netdev=dewy.ru From: andrew@lunn.ch (Andrew Lunn) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH v2] net: ethtool: do not call get_regs() for zero-length dumps Date: Thu, 26 Nov 2026 15:11:55 +0100 Organization: Usenet Network Message-ID: <5e76388e-e88a-4256-9324-aff0c9625aba@lunn.ch> References: <20261126015239.6038-1-25031212351@stu.xidian.edu.cn> <366216bc-ccc3-4547-8587-87cdf35f552f@lunn.ch> <20261126082144.3295-1-25031212351@stu.xidian.edu.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: usenet.network; logging-data="481761"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:jESzGJXEQYk+o4KjFZ7AJiBQ3pM= sha256:apkwM8LWyG/66ZMN5aZspbGzii5UF5iRjwqItR52ivA= sha1:E+jUZyt38hsndvij23ws7wpKyLA= sha256:ekVKDgZjNqdqFOZ/ZpiY1xvJZfV3uAbwSTOnWebCI5g= Content-Disposition: inline List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id A878F125EDA; Thu, 26 Nov 2026 17:12:24 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.05 X-Spam-Status: No, score=-3.05 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (1024-bit key) header.d=lunn.ch X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id kJJpgabgs_Ye; Thu, 26 Nov 2026 17:12:21 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-372134-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=lunn.ch X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id 6D695125ED5; Thu, 26 Nov 2026 17:12:13 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id CD479458C5; Thu, 26 Nov 2026 14:12:08 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1795702328; b=UY6qUNYn/DlBZ/MxhKchuugpiqG5B5bSN5FoyFKm10KRdpFCH3o/zBfG4muX+x9uIb1C beOJR/itFzNJD2b7Yq0K7j9dtGvCKooqRDaIOr2GY6fXM6KHltxMMytWT/kpNTv/ridv1 Vbh/nzNMhbjr8ARXwJQYbelXr6JshPsWyJp42XN3P9MtWwXyfc1dA+wdD2sE8tReJVWDb RlMzhLKgVpvG7Hm2JOmxS8m9xCnSpkPysnPdLm8kDzeTfQAhKU/ztNYetcYbHOF8Vc+rr LmksMPzO8zoBTHlMz3dZzd2OCs2sZEVkiONs1FgfVVUeba1LHB3y9YWTZaATNNqUdiQ== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795702328; h=X-Original-To:Received:DMARC-Filter:DKIM-Signature:Received:Date: From:To:Cc:Subject:Message-ID:References:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=FwaNABeY5k88QflT1EgsvAh17X27gm7f0HrYMY1bXw8=; b=uMgEr0atm8uPFr+wUzGje7Kb6akP+uBJ0tPn8R3YS1wC04PbFQZOJKweerjWhQdpokAi Hwvae+8sIOXwVuJ6ya+g7rKjPD1FiTAFt9NT+XXPwnyrJ8wh4WZ1Bo7DA/NvqiVCAMkV4 84pXFMklaFR8EfySrAefwAWa5Xgdk6sWltTLDfYDAE33tOLXVt3kVUQKbAbIu+elaelH1 u7YZL4YLNq+23roXwTBJ8a9uGPltJggXRSh/KCnuGwAN0h+ucQme/dsQfkspmZRjzzDuJ 1vbzT6GmALbvZIc1RbiwkOt4WRkzIEkvMjH2LpInnOADZBC0gu/ACKvrsJd/2grJeNg== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=lunn.ch header.i=@lunn.ch header.a=rsa-sha256 header.s=20171124 header.b=U7Vtblm0; dmarc=pass header.from=lunn.ch; spf=pass smtp.mailfrom=lunn.ch; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7E0E7606A32A; Thu, 26 Nov 2026 14:12:08 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.a=rsa-sha256 header.s=20171124 header.b=U7Vtblm0 X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=156.67.10.101 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795702322; b=HSBsfYbyvDoBpi5yMtB9eu0qyo7zXCi75dbuQzZl5WjWVSwWBCq7dgHnCGeEjoowPhm6 D4Atf7gx30wzdTgMsmPngkl1idMmwTL6/utvaue59Q2sPvnG4+KzpP6t5xIGpzKBWT7vo WVtSKxF7IMGZT5snEgjO1PuktfDkQVAyGBFGpQJKlychyaz5ancltfS8wO1GOOYwNj68E vQVmiJ83qesroxM5zWAhOMQLdwXY9MC7gLiQTqsvmdBv4Hsq/7ihJeK2lsbo0yGlyOrpI XH0z/xfAT8GhBP75y0Kd8Ju0r5xed5ZLFNUI1pNQldQs/849ymNLgm/0kh8YnWf7w8Q== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795702322; h=DMARC-Filter:DKIM-Signature:Received:Date:From:To:Cc:Subject: Message-ID:References:MIME-Version:Content-Type:Content-Disposition: In-Reply-To; bh=FwaNABeY5k88QflT1EgsvAh17X27gm7f0HrYMY1bXw8=; b=iulEi3Ppq4XFw9xuegR+xoY+O4UYtp2UHq/b5x04b8HpVi8j3dF3e27RJtBi9EttyyPX GqvRf70nE5rQHkvGxeTxqMdsq1bQtgUqDdSKQqof8XTf3upx5FBgYkIzsNKhp1pIDaBo9 /vmV7U4xuJWaoeuYBY7yVRXqi4SxCkYf0MCMrxZR5w9wpnWIj5CrdD9i2Ys/Eji/xRKoR +1dczp5oxuD5jorQ3aJD14RCtqsh6/i6sxpkgKXN728s1K1GXJ/J2wU6dYH0rWui5Km9V 5Ym7z7babtRep8IzowaU6bAfeSKCE/m2WhqVG0MyMVKiGDqTNzoYUF6Uyee60EN6Ntg== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=lunn.ch; spf=pass smtp.mailfrom=lunn.ch; dkim=pass header.d=lunn.ch header.i=@lunn.ch header.a=rsa-sha256 header.s=20171124 header.b=U7Vtblm0; arc=none smtp.remote-ip=156.67.10.101 X-Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5775C606A31C; Thu, 26 Nov 2026 14:12:02 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 5775C606A31C X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lunn.ch X-DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=FwaNABeY5k88QflT1EgsvAh17X27gm7f0HrYMY1bXw8=; b=U7Vtblm0t+0b+NPy/BG+0q+YNu 5kYYxbx16TC9X/Yy0NTvZZH+4NFRQTx44CRXxOAE4/r8vriKQmDmPSVQ55FdecPGUIwFudzm3hmQg eBxGxbC5qhzi75zLJGM2EezVmPKdJENNpSNNGRY43U7WbgC1YIWjkOCLHdMXJRw52qlA=; X-Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from <andrew@lunn.ch>) id 1xWaCZ-001a50-6F; Thu, 26 Nov 2026 15:11:55 +0100 X-Cc: Jakub Kicinski <kuba@kernel.org>, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@kernel.org>, Paolo Abeni <pabeni@redhat.com>, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, Simon Horman <horms@kernel.org>, Bin Yu <byu@xidian.edu.cn>, Cheng Wen <wencheng@xidian.edu.cn> X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list X-In-Reply-To: <20261126082144.3295-1-25031212351@stu.xidian.edu.cn>