From: Bradley Morgan <bradley.morgan@linux.dev>
To: Catalin Marinas <catalin.marinas@arm.com>, Will Deacon <will@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>,
Mark Brown <broonie@kernel.org>,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, bradley.morgan@linux.dev
Subject: [PATCH 2/2] arm64: signal: drop redundant bounds check in parse_user_sigframe()
Date: Tue, 10 Nov 2026 22:18:36 +0000 [thread overview]
Message-ID: <20261110221836.3265929-3-bradley.morgan@linux.dev> (raw)
In-Reply-To: <20261110221836.3265929-1-bradley.morgan@linux.dev>
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@linux.dev>
---
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
prev parent reply other threads:[~2026-11-10 22:18 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-10 22:18 [PATCH 0/2] arm64: signal: Fix ZT restore without ZA and clean up bounds check Bradley Morgan
2026-11-10 22:18 ` [PATCH 1/2] arm64/fpsimd: signal: Require ZA context when restoring ZT context Bradley Morgan
2026-11-10 22:18 ` Bradley Morgan [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261110221836.3265929-3-bradley.morgan@linux.dev \
--to=bradley.morgan@linux.dev \
--cc=broonie@kernel.org \
--cc=catalin.marinas@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®