[PATCH v2 2/5] selftests/mm: Fix resv_sz when parsing arm64 signal frame
Mark Brown
broonie at kernel.org
Mon Apr 27 15:46:39 PDT 2026
On Mon, Apr 27, 2026 at 01:03:34PM +0100, Kevin Brodsky wrote:
> get_header() wants the size of the reserved area in struct
> sigcontext, but instead we pass it the size of the entire struct.
> This could in theory result in an out-of-bounds read (if the signal
> frame is malformed).
> Fix this using one of the existing macros from
> tools/testing/selftests/arm64/signal/testcases/testcases.h.
Oh, good to know this is peering inside the arm64 selftests - it'd be
good to document that on the arm64 side to avoid unpleasant suprirses.
> {
> struct _aarch64_ctx *ctx = GET_UC_RESV_HEAD(uctxt);
> + size_t resv_size = GET_UCP_RESV_SIZE(uctxt);
> struct poe_context *poe_ctx =
> (struct poe_context *) get_header(ctx, POE_MAGIC,
> - sizeof(uctxt->uc_mcontext), NULL);
> + resv_size, NULL);
Reviewed-by: Mark Brown <broonie at kernel.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20260428/68d219e0/attachment.sig>
More information about the linux-arm-kernel
mailing list