linux-hardening.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] lkdtm/bugs: Switch from 1-element array to flexible array
@ 2023-05-22 21:29 Kees Cook
  2023-05-22 22:38 ` Bill Wendling
  0 siblings, 1 reply; 2+ messages in thread
From: Kees Cook @ 2023-05-22 21:29 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Kees Cook, Greg Kroah-Hartman, linux-kernel, linux-hardening

The testing for ARRAY_BOUNDS just wants an uninstrumented array,
and the proper flexible array definition is fine for that.

Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kees Cook <keescook@chromium.org>
---
 drivers/misc/lkdtm/bugs.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/misc/lkdtm/bugs.c b/drivers/misc/lkdtm/bugs.c
index 48821f4c2b21..224f42cdddf2 100644
--- a/drivers/misc/lkdtm/bugs.c
+++ b/drivers/misc/lkdtm/bugs.c
@@ -305,11 +305,10 @@ static void lkdtm_OVERFLOW_UNSIGNED(void)
 	ignored = value;
 }
 
-/* Intentionally using old-style flex array definition of 1 byte. */
 struct array_bounds_flex_array {
 	int one;
 	int two;
-	char data[1];
+	char data[];
 };
 
 struct array_bounds {
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] lkdtm/bugs: Switch from 1-element array to flexible array
  2023-05-22 21:29 [PATCH] lkdtm/bugs: Switch from 1-element array to flexible array Kees Cook
@ 2023-05-22 22:38 ` Bill Wendling
  0 siblings, 0 replies; 2+ messages in thread
From: Bill Wendling @ 2023-05-22 22:38 UTC (permalink / raw)
  To: Kees Cook
  Cc: Arnd Bergmann, Greg Kroah-Hartman, linux-kernel, linux-hardening

On Mon, May 22, 2023 at 2:30 PM Kees Cook <keescook@chromium.org> wrote:
>
> The testing for ARRAY_BOUNDS just wants an uninstrumented array,
> and the proper flexible array definition is fine for that.
>
> Cc: Arnd Bergmann <arnd@arndb.de>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Signed-off-by: Kees Cook <keescook@chromium.org>

Reviewed-by: Bill Wendling <morbo@google.com>

> ---
>  drivers/misc/lkdtm/bugs.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/misc/lkdtm/bugs.c b/drivers/misc/lkdtm/bugs.c
> index 48821f4c2b21..224f42cdddf2 100644
> --- a/drivers/misc/lkdtm/bugs.c
> +++ b/drivers/misc/lkdtm/bugs.c
> @@ -305,11 +305,10 @@ static void lkdtm_OVERFLOW_UNSIGNED(void)
>         ignored = value;
>  }
>
> -/* Intentionally using old-style flex array definition of 1 byte. */
>  struct array_bounds_flex_array {
>         int one;
>         int two;
> -       char data[1];
> +       char data[];
>  };
>
>  struct array_bounds {
> --
> 2.34.1
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-05-22 22:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-22 21:29 [PATCH] lkdtm/bugs: Switch from 1-element array to flexible array Kees Cook
2023-05-22 22:38 ` Bill Wendling

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).