[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <202503131042.F6C9F4CA06@keescook>
Date: Thu, 13 Mar 2025 10:44:09 -0700
From: Kees Cook <kees@...nel.org>
To: Andrew Lunn <andrew@...n.ch>
Cc: Nicolas Ferre <nicolas.ferre@...rochip.com>,
Claudiu Beznea <claudiu.beznea@...on.dev>,
Andrew Lunn <andrew+netdev@...n.ch>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-hardening@...r.kernel.org
Subject: Re: [PATCH v3] net: macb: Add __nonstring annotations for
unterminated strings
On Thu, Mar 13, 2025 at 02:25:09PM +0100, Andrew Lunn wrote:
> > struct gem_statistic {
> > - char stat_string[ETH_GSTRING_LEN];
> > + char stat_string[ETH_GSTRING_LEN] __nonstring;
>
> This general pattern of a char foo[ETH_GSTRING_LEN]' will appear
> throughout drivers/net/ethernet. Maybe Coccinelle can find them all
> and add the __nonstring ?
I had that same thought but then rediscovered ethtool_puts() and
ethtool_sprintf(), which operate on C Strings and write out C Strings...
so _some_ ethtool stats are being constructed in a way that we can't
just universally apply __nonstring to all ETH_GSTRING_LEN strings. :(
--
Kees Cook
Powered by blists - more mailing lists