lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8fbb8fed-e8d4-475c-8093-373d0afb62cc@csgroup.eu>
Date: Wed, 4 Sep 2024 19:18:30 +0200
From: Christophe Leroy <christophe.leroy@...roup.eu>
To: Vincenzo Frascino <vincenzo.frascino@....com>,
 linux-kernel@...r.kernel.org, linux-arch@...r.kernel.org, linux-mm@...ck.org
Cc: Andy Lutomirski <luto@...nel.org>, Thomas Gleixner <tglx@...utronix.de>,
 "Jason A . Donenfeld" <Jason@...c4.com>,
 Michael Ellerman <mpe@...erman.id.au>, Nicholas Piggin <npiggin@...il.com>,
 Naveen N Rao <naveen@...nel.org>, Ingo Molnar <mingo@...hat.com>,
 Borislav Petkov <bp@...en8.de>, Dave Hansen <dave.hansen@...ux.intel.com>,
 "H . Peter Anvin" <hpa@...or.com>, Theodore Ts'o <tytso@....edu>,
 Arnd Bergmann <arnd@...db.de>, Andrew Morton <akpm@...ux-foundation.org>,
 Steven Rostedt <rostedt@...dmis.org>, Masami Hiramatsu
 <mhiramat@...nel.org>, Mathieu Desnoyers <mathieu.desnoyers@...icios.com>
Subject: Re: [PATCH 6/9] vdso: Split linux/array_size.h



Le 03/09/2024 à 17:14, Vincenzo Frascino a écrit :
> The VDSO implementation includes headers from outside of the
> vdso/ namespace.
> 
> Split linux/array_size.h to make sure that the generic library
> uses only the allowed namespace.

There is only one place using ARRAY_SIZE(x), can be open coded as 
sizeof(x)/sizeof(*x) instead.

Christophe

> 
> Cc: Andy Lutomirski <luto@...nel.org>
> Cc: Thomas Gleixner <tglx@...utronix.de>
> Cc: Jason A. Donenfeld <Jason@...c4.com>
> Signed-off-by: Vincenzo Frascino <vincenzo.frascino@....com>
> ---
>   include/linux/array_size.h |  8 +-------
>   include/vdso/array_size.h  | 13 +++++++++++++
>   2 files changed, 14 insertions(+), 7 deletions(-)
>   create mode 100644 include/vdso/array_size.h
> 
> diff --git a/include/linux/array_size.h b/include/linux/array_size.h
> index 06d7d83196ca..ca9e63b419c4 100644
> --- a/include/linux/array_size.h
> +++ b/include/linux/array_size.h
> @@ -2,12 +2,6 @@
>   #ifndef _LINUX_ARRAY_SIZE_H
>   #define _LINUX_ARRAY_SIZE_H
>   
> -#include <linux/compiler.h>
> -
> -/**
> - * ARRAY_SIZE - get the number of elements in array @arr
> - * @arr: array to be sized
> - */
> -#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
> +#include <vdso/array_size.h>
>   
>   #endif  /* _LINUX_ARRAY_SIZE_H */
> diff --git a/include/vdso/array_size.h b/include/vdso/array_size.h
> new file mode 100644
> index 000000000000..4079f7a5f86e
> --- /dev/null
> +++ b/include/vdso/array_size.h
> @@ -0,0 +1,13 @@
> +/* SPDX-License-Identifier: GPL-2.0 */
> +#ifndef _VDSO_ARRAY_SIZE_H
> +#define _VDSO_ARRAY_SIZE_H
> +
> +#include <linux/compiler.h>
> +
> +/**
> + * ARRAY_SIZE - get the number of elements in array @arr
> + * @arr: array to be sized
> + */
> +#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
> +
> +#endif  /* _VDSO_ARRAY_SIZE_H */

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ