From: Alexander Lobakin <aleksander.lobakin@intel.com>
To: Nathan Chancellor <nathan@kernel.org>, Kees Cook <kees@kernel.org>
Cc: Masahiro Yamada <masahiroy@kernel.org>,
Nicolas Schier <nicolas.schier@linux.dev>,
<linux-kbuild@vger.kernel.org>,
Nick Desaulniers <nick.desaulniers+lkml@gmail.com>,
Bill Wendling <morbo@google.com>,
"Justin Stitt" <justinstitt@google.com>,
<linux-kernel@vger.kernel.org>, <llvm@lists.linux.dev>,
<linux-hardening@vger.kernel.org>
Subject: Re: [PATCH v2] kbuild: Re-enable -Wunterminated-string-initialization
Date: Tue, 5 Aug 2025 16:50:28 +0200 [thread overview]
Message-ID: <e4d801e3-3004-484b-897d-ed43c25e1576@intel.com> (raw)
In-Reply-To: <20250803173235.GA716998@ax162>
From: Nathan Chancellor <nathan@kernel.org>
Date: Sun, 3 Aug 2025 10:32:35 -0700
> On Sat, Aug 02, 2025 at 11:43:32AM -0700, Kees Cook wrote:
>> With the few remaining fixes now landed, we can re-enable the option
>> -Wunterminated-string-initialization (via -Wextra). Both GCC and Clang
>> have the required multi-dimensional nonstring attribute support.
[...]
> diff --git a/drivers/net/ethernet/ti/netcp_ethss.c b/drivers/net/ethernet/ti/netcp_ethss.c
> index 55a1a96cd834..05d4323c6a13 100644
> --- a/drivers/net/ethernet/ti/netcp_ethss.c
> +++ b/drivers/net/ethernet/ti/netcp_ethss.c
> @@ -771,7 +771,7 @@ static struct netcp_module xgbe_module;
>
> /* Statistic management */
> struct netcp_ethtool_stat {
> - char desc[ETH_GSTRING_LEN];
> + char desc[ETH_GSTRING_LEN] __nonstring;
Hmmm, ETH_GSTRING_LEN is the maximum length of the driver's statistics
name to be reported to Ethtool and this *includes* \0 at the end.
If this compilation flag triggers a warning here, the driver devs need
to fix their code. There should always be \0 at the end, `desc` is a
"proper" C 0-terminated string.
> int type;
> u32 size;
> int offset;
Thanks,
Olek
next prev parent reply other threads:[~2025-08-05 14:52 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-02 18:43 Kees Cook
2025-08-03 17:32 ` Nathan Chancellor
2025-08-05 14:50 ` Alexander Lobakin [this message]
2025-08-05 21:48 ` Nathan Chancellor
2025-08-06 15:29 ` Alexander Lobakin
2025-08-06 19:05 ` Kees Cook
2025-08-07 13:31 ` Alexander Lobakin
2025-08-07 22:00 ` Kees Cook
2025-08-11 14:25 ` Alexander Lobakin
2025-09-05 15:59 ` 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=e4d801e3-3004-484b-897d-ed43c25e1576@intel.com \
--to=aleksander.lobakin@intel.com \
--cc=justinstitt@google.com \
--cc=kees@kernel.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=masahiroy@kernel.org \
--cc=morbo@google.com \
--cc=nathan@kernel.org \
--cc=nick.desaulniers+lkml@gmail.com \
--cc=nicolas.schier@linux.dev \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®