All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RESEND] powerpc/rtas: Replace one-element array with flexible array member
@ 2025-08-13 10:30 Thorsten Blum
  2026-06-19 22:00 ` Madhavan Srinivasan
  0 siblings, 1 reply; 2+ messages in thread
From: Thorsten Blum @ 2025-08-13 10:30 UTC (permalink / raw)
  To: Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin,
	Christophe Leroy, Kees Cook, Gustavo A. R. Silva
  Cc: linux-hardening, Thorsten Blum, linuxppc-dev, linux-kernel

Replace the deprecated one-element array with a modern flexible array
member in the struct rtas_error_log and add the __counted_by_be()
compiler attribute to improve access bounds-checking via
CONFIG_UBSAN_BOUNDS and CONFIG_FORTIFY_SOURCE.

Link: https://github.com/KSPP/linux/issues/79
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
 arch/powerpc/include/asm/rtas-types.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/include/asm/rtas-types.h b/arch/powerpc/include/asm/rtas-types.h
index 9d5b16803cbb..5d40d187b965 100644
--- a/arch/powerpc/include/asm/rtas-types.h
+++ b/arch/powerpc/include/asm/rtas-types.h
@@ -42,8 +42,9 @@ struct rtas_error_log {
 	 */
 	u8		byte3;			/* General event or error*/
 	__be32		extended_log_length;	/* length in bytes */
-	unsigned char	buffer[1];		/* Start of extended log */
-						/* Variable length.      */
+
+	/* Start of extended log, variable length */
+	unsigned char	buffer[] __counted_by_be(extended_log_length);
 };
 
 /* RTAS general extended event log, Version 6. The extended log starts
-- 
2.50.1


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

* Re: [PATCH RESEND] powerpc/rtas: Replace one-element array with flexible array member
  2025-08-13 10:30 [PATCH RESEND] powerpc/rtas: Replace one-element array with flexible array member Thorsten Blum
@ 2026-06-19 22:00 ` Madhavan Srinivasan
  0 siblings, 0 replies; 2+ messages in thread
From: Madhavan Srinivasan @ 2026-06-19 22:00 UTC (permalink / raw)
  To: Michael Ellerman, Nicholas Piggin, Kees Cook, Gustavo A. R. Silva,
	Christophe Leroy, Thorsten Blum
  Cc: linux-hardening, linuxppc-dev, linux-kernel

On Wed, 13 Aug 2025 12:30:59 +0200, Thorsten Blum wrote:
> Replace the deprecated one-element array with a modern flexible array
> member in the struct rtas_error_log and add the __counted_by_be()
> compiler attribute to improve access bounds-checking via
> CONFIG_UBSAN_BOUNDS and CONFIG_FORTIFY_SOURCE.
> 
> 

Applied to powerpc/next.

[1/1] powerpc/rtas: Replace one-element array with flexible array member
      https://git.kernel.org/powerpc/c/ab8bbf8024b7434e2b630965fd373fba5b89f29f

cheers

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

end of thread, other threads:[~2026-06-19 22:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-13 10:30 [PATCH RESEND] powerpc/rtas: Replace one-element array with flexible array member Thorsten Blum
2026-06-19 22:00 ` Madhavan Srinivasan

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.