From: Kees Cook <kees@kernel.org>
To: Nicolas Ferre <nicolas.ferre@microchip.com>
Cc: Kees Cook <kees@kernel.org>,
Claudiu Beznea <claudiu.beznea@tuxon.dev>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-hardening@vger.kernel.org
Subject: [PATCH] net: macb: Truncate TX1519CNT for trailing NUL
Date: Mon, 10 Mar 2025 15:24:16 -0700 [thread overview]
Message-ID: <20250310222415.work.815-kees@kernel.org> (raw)
GCC 15's -Wunterminated-string-initialization saw that this string was
being truncated. Adjust the initializer so that the needed final NUL
character will be present.
Cc: Nicolas Ferre <nicolas.ferre@microchip.com>
Cc: Claudiu Beznea <claudiu.beznea@tuxon.dev>
Cc: Andrew Lunn <andrew+netdev@lunn.ch>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Paolo Abeni <pabeni@redhat.com>
Cc: netdev@vger.kernel.org
Signed-off-by: Kees Cook <kees@kernel.org>
---
drivers/net/ethernet/cadence/macb.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/cadence/macb.h b/drivers/net/ethernet/cadence/macb.h
index 2847278d9cd4..9a6acb97c82d 100644
--- a/drivers/net/ethernet/cadence/macb.h
+++ b/drivers/net/ethernet/cadence/macb.h
@@ -1067,7 +1067,8 @@ static const struct gem_statistic gem_statistics[] = {
GEM_STAT_TITLE(TX256CNT, "tx_256_511_byte_frames"),
GEM_STAT_TITLE(TX512CNT, "tx_512_1023_byte_frames"),
GEM_STAT_TITLE(TX1024CNT, "tx_1024_1518_byte_frames"),
- GEM_STAT_TITLE(TX1519CNT, "tx_greater_than_1518_byte_frames"),
+ GEM_STAT_TITLE(TX1519CNT, "tx_greater_than_1518_byte_frame"),
+
GEM_STAT_TITLE_BITS(TXURUNCNT, "tx_underrun",
GEM_BIT(NDS_TXERR)|GEM_BIT(NDS_TXFIFOERR)),
GEM_STAT_TITLE_BITS(SNGLCOLLCNT, "tx_single_collision_frames",
--
2.34.1
next reply other threads:[~2025-03-10 22:24 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-10 22:24 Kees Cook [this message]
2025-03-11 7:27 ` [PATCH] net: macb: Truncate TX1519CNT for trailing NUL Michal Swiatkowski
2025-03-11 22:38 ` Kees Cook
2025-03-11 14:12 ` Andrew Lunn
2025-03-11 22:41 ` Kees Cook
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=20250310222415.work.815-kees@kernel.org \
--to=kees@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=claudiu.beznea@tuxon.dev \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=nicolas.ferre@microchip.com \
--cc=pabeni@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.