public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] arm64: Don't call NULL in do_compat_alignment_fixup
@ 2025-03-26 13:35 Angelos Oikonomopoulos
  2025-03-28 19:06 ` Catalin Marinas
  0 siblings, 1 reply; 11+ messages in thread
From: Angelos Oikonomopoulos @ 2025-03-26 13:35 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: catalin.marinas, will, linux-kernel, kernel-dev,
	Angelos Oikonomopoulos

do_alignment_t32_to_handler only fixes up alignment faults for specific
instructions; it returns NULL otherwise. When that's the case, signal to
the caller that it needs to proceed with the regular alignment fault
handling (i.e. SIGBUS).

Signed-off-by: Angelos Oikonomopoulos <angelos@igalia.com>
---
 arch/arm64/kernel/compat_alignment.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/kernel/compat_alignment.c b/arch/arm64/kernel/compat_alignment.c
index deff21bfa680..76cf1c1b5bc6 100644
--- a/arch/arm64/kernel/compat_alignment.c
+++ b/arch/arm64/kernel/compat_alignment.c
@@ -34,7 +34,7 @@
 
 #define REGMASK_BITS(i)	(i & 0xffff)
 
-#define BAD_INSTR 	0xdeadc0de
+#define BAD_INSTR	0xdeadc0de
 
 /* Thumb-2 32 bit format per ARMv7 DDI0406A A6.3, either f800h,e800h,f800h */
 #define IS_T32(hi16) \
@@ -368,6 +368,8 @@ int do_compat_alignment_fixup(unsigned long addr, struct pt_regs *regs)
 		return 1;
 	}
 
+	if (!handler)
+		return 1;
 	type = handler(addr, instr, regs);
 
 	if (type == TYPE_ERROR || type == TYPE_FAULT)
-- 
2.49.0


^ permalink raw reply related	[flat|nested] 11+ messages in thread
* [PATCH] arm64: Don't call NULL in do_compat_alignment_fixup
@ 2025-03-31  8:54 Angelos Oikonomopoulos
  2025-04-01  6:05 ` Anshuman Khandual
  0 siblings, 1 reply; 11+ messages in thread
From: Angelos Oikonomopoulos @ 2025-03-31  8:54 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: catalin.marinas, will, linux-kernel, kernel-dev,
	Angelos Oikonomopoulos

do_alignment_t32_to_handler only fixes up alignment faults for specific
instructions; it returns NULL otherwise. When that's the case, signal to
the caller that it needs to proceed with the regular alignment fault
handling (i.e. SIGBUS).

Signed-off-by: Angelos Oikonomopoulos <angelos@igalia.com>
---
 arch/arm64/kernel/compat_alignment.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm64/kernel/compat_alignment.c b/arch/arm64/kernel/compat_alignment.c
index deff21bfa680..b68e1d328d4c 100644
--- a/arch/arm64/kernel/compat_alignment.c
+++ b/arch/arm64/kernel/compat_alignment.c
@@ -368,6 +368,8 @@ int do_compat_alignment_fixup(unsigned long addr, struct pt_regs *regs)
 		return 1;
 	}
 
+	if (!handler)
+		return 1;
 	type = handler(addr, instr, regs);
 
 	if (type == TYPE_ERROR || type == TYPE_FAULT)
-- 
2.49.0


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

end of thread, other threads:[~2025-04-04 13:58 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-26 13:35 [PATCH] arm64: Don't call NULL in do_compat_alignment_fixup Angelos Oikonomopoulos
2025-03-28 19:06 ` Catalin Marinas
2025-03-31  7:57   ` Angelos Oikonomopoulos
  -- strict thread matches above, loose matches on Subject: below --
2025-03-31  8:54 Angelos Oikonomopoulos
2025-04-01  6:05 ` Anshuman Khandual
2025-04-01  6:58   ` Angelos Oikonomopoulos
2025-04-01  7:47     ` Anshuman Khandual
2025-04-01  8:09       ` Angelos Oikonomopoulos
2025-04-01  8:22         ` Anshuman Khandual
2025-04-01  8:58           ` Angelos Oikonomopoulos
2025-04-04 13:58             ` Will Deacon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox