From: Guenter Roeck <linux@roeck-us.net>
To: Kees Cook <kees@kernel.org>, Wim Van Sebroeck <wim@linux-watchdog.org>
Cc: linux-watchdog@vger.kernel.org,
"David Müller" <d.mueller@elsoft.ch>,
linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org
Subject: Re: [PATCH] watchdog: exar: Shorten identity name to fit correctly
Date: Tue, 15 Apr 2025 16:19:15 -0700 [thread overview]
Message-ID: <e0976e69-1643-4b0b-a7a8-0495fb4e5dc6@roeck-us.net> (raw)
In-Reply-To: <20250415225246.work.458-kees@kernel.org>
On 4/15/25 15:52, Kees Cook wrote:
> The static initializer for struct watchdog_info::identity is too long
> and gets initialized without a trailing NUL byte. Since the length
> of "identity" is part of UAPI and tied to ioctls, just shorten
> the name of the device. Avoids the warning seen with GCC 15's
> -Wunterminated-string-initialization option:
>
> drivers/watchdog/exar_wdt.c:224:27: warning: initializer-string for array of 'unsigned char' truncates NUL terminator but destination lacks 'nonstring' attribute (33 chars into 32 available) [-Wunterminated-string-initialization]
> 224 | .identity = "Exar/MaxLinear XR28V38x Watchdog",
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> Fixes: 81126222bd3a ("watchdog: Exar/MaxLinear XR28V38x driver")
> Signed-off-by: Kees Cook <kees@kernel.org>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
> ---
> Cc: Wim Van Sebroeck <wim@linux-watchdog.org>
> Cc: Guenter Roeck <linux@roeck-us.net>
> Cc: linux-watchdog@vger.kernel.org
> ---
> drivers/watchdog/exar_wdt.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/watchdog/exar_wdt.c b/drivers/watchdog/exar_wdt.c
> index 7c61ff343271..c2e3bb08df89 100644
> --- a/drivers/watchdog/exar_wdt.c
> +++ b/drivers/watchdog/exar_wdt.c
> @@ -221,7 +221,7 @@ static const struct watchdog_info exar_wdt_info = {
> .options = WDIOF_KEEPALIVEPING |
> WDIOF_SETTIMEOUT |
> WDIOF_MAGICCLOSE,
> - .identity = "Exar/MaxLinear XR28V38x Watchdog",
> + .identity = "Exar XR28V38x Watchdog",
> };
>
> static const struct watchdog_ops exar_wdt_ops = {
prev parent reply other threads:[~2025-04-15 23:19 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-15 22:52 [PATCH] watchdog: exar: Shorten identity name to fit correctly Kees Cook
2025-04-15 23:19 ` Guenter Roeck [this message]
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=e0976e69-1643-4b0b-a7a8-0495fb4e5dc6@roeck-us.net \
--to=linux@roeck-us.net \
--cc=d.mueller@elsoft.ch \
--cc=kees@kernel.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-watchdog@vger.kernel.org \
--cc=wim@linux-watchdog.org \
/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;
as well as URLs for NNTP newsgroup(s).