From: Kees Cook <kees@kernel.org>
To: Thorsten Blum <thorsten.blum@linux.dev>
Cc: Richard Henderson <richard.henderson@linaro.org>,
Matt Turner <mattst88@gmail.com>,
linux-hardening@vger.kernel.org, linux-alpha@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [RESEND PATCH] alpha: Replace one-element array with flexible array member
Date: Sun, 22 Dec 2024 21:46:17 -0800 [thread overview]
Message-ID: <202412222144.61622A2@keescook> (raw)
In-Reply-To: <20241220192020.1667-3-thorsten.blum@linux.dev>
On Fri, Dec 20, 2024 at 08:20:20PM +0100, Thorsten Blum wrote:
> Replace the deprecated one-element array with a modern flexible array
> member in the struct crb_struct.
>
> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
> ---
> arch/alpha/include/asm/hwrpb.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/alpha/include/asm/hwrpb.h b/arch/alpha/include/asm/hwrpb.h
> index fc76f36265ad..db831cf8de10 100644
> --- a/arch/alpha/include/asm/hwrpb.h
> +++ b/arch/alpha/include/asm/hwrpb.h
> @@ -135,7 +135,7 @@ struct crb_struct {
> /* virtual->physical map */
> unsigned long map_entries;
> unsigned long map_pages;
> - struct vf_map_struct map[1];
> + struct vf_map_struct map[];
> };
Seems like this could use __counted_by(map_entries) as well?
...
for (i = 0; i < crb->map_entries; ++i) {
unsigned long pfn = crb->map[i].pa >> PAGE_SHIFT;
...
But yes, this appears to be used as a flexible array and should be
adjusted. I see no sizeof() uses that would change. So:
Reviewed-by: Kees Cook <kees@kernel.org>
-Kees
--
Kees Cook
next prev parent reply other threads:[~2024-12-23 5:46 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-20 19:20 [RESEND PATCH] alpha: Replace one-element array with flexible array member Thorsten Blum
2024-12-23 5:46 ` Kees Cook [this message]
2024-12-23 7:40 ` Thorsten Blum
-- strict thread matches above, loose matches on Subject: below --
2025-02-09 8:12 Thorsten Blum
2025-01-16 13:00 Thorsten Blum
2025-01-07 10:43 Thorsten Blum
2024-12-09 16:42 Thorsten Blum
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=202412222144.61622A2@keescook \
--to=kees@kernel.org \
--cc=linux-alpha@vger.kernel.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mattst88@gmail.com \
--cc=richard.henderson@linaro.org \
--cc=thorsten.blum@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 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.