[PATCH 2/2] arm64: signal: drop redundant bounds check in parse_user_sigframe()

From: Bradley Morgan

Date: Tue Nov 10 2026 - 17:19:55 EST


We already check limit - offset < size right after reading head->size
before the magic switch. Then once the switch finishes, we turn around
and check the exact same thing again.

None of the switch cases touch offset, limit, or size before reaching
the bottom, and extra context branches off with continue anyway. So the
second check is completely dead. It has been sitting here since the 2017
frame layout rework.

Drop the duplicate check.

Signed-off-by: Bradley Morgan <bradley.morgan@xxxxxxxxx>
---
arch/arm64/kernel/signal.c | 3 ---
1 file changed, 3 deletions(-)

diff --git a/arch/arm64/kernel/signal.c b/arch/arm64/kernel/signal.c
index 20d5f19921e0d..d152735d632e5 100644
--- a/arch/arm64/kernel/signal.c
+++ b/arch/arm64/kernel/signal.c
@@ -1003,9 +1003,6 @@ static int parse_user_sigframe(struct user_ctxs *user,
if (size < sizeof(*head))
goto invalid;

- if (limit - offset < size)
- goto invalid;
-
offset += size;
}

--
2.53.0