summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorKevin Brodsky <kevin.brodsky@arm.com>2026-04-27 13:03:33 +0100
committerCatalin Marinas <catalin.marinas@arm.com>2026-05-01 17:44:25 +0100
commit030e8a40fff65ca6ac1c04a4d3c08afe72438922 (patch)
tree0db4c2dbb9c334e55cee3670ebced4adac0932d7 /include/linux
parent4d8e74ad4585672489da6145b3328d415f50db82 (diff)
arm64: signal: Preserve POR_EL0 if poe_context is missing
Commit 2e8a1acea859 ("arm64: signal: Improve POR_EL0 handling to avoid uaccess failures") delayed the write to POR_EL0 in rt_sigreturn to avoid spurious uaccess failures. This change however relies on the poe_context frame record being present: on a system supporting POE, calling sigreturn without a poe_context record now results in writing arbitrary data from the kernel stack into POR_EL0. Fix this by adding a __valid_fields member to struct user_access_state, and zeroing the struct on allocation. restore_poe_context() then indicates that the por_el0 field is valid by setting the corresponding bit in __valid_fields, and restore_user_access_state() only touches POR_EL0 if there is a valid value to set it to. This is in line with how POR_EL0 was originally handled; all frame records are currently optional, except fpsimd_context. To ensure that __valid_fields is kept in sync, fields (currently just por_el0) are now accessed via accessors and prefixed with __ to discourage direct access. Fixes: 2e8a1acea859 ("arm64: signal: Improve POR_EL0 handling to avoid uaccess failures") Cc: <stable@vger.kernel.org> Reported-by: Will Deacon <will@kernel.org> Signed-off-by: Kevin Brodsky <kevin.brodsky@arm.com> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to 'include/linux')
0 files changed, 0 insertions, 0 deletions