diff options
author | Xin Li <[email protected]> | 2023-12-05 02:50:18 -0800 |
---|---|---|
committer | Borislav Petkov (AMD) <[email protected]> | 2024-01-31 22:03:04 +0100 |
commit | 5105e7687ad3dffde77f6e4393b5530e83d672dc (patch) | |
tree | bc3f17dae2474cf5e4b411b6e249e2c52ceef121 /lib/test_fortify/write_overflow-strncpy-src.c | |
parent | 51ef2a4da7ec347e3315af69a426ac36fab98a6c (diff) |
x86/fred: Fixup fault on ERETU by jumping to fred_entrypoint_user
If the stack frame contains an invalid user context (e.g. due to invalid SS,
a non-canonical RIP, etc.) the ERETU instruction will trap (#SS or #GP).
From a Linux point of view, this really should be considered a user space
failure, so use the standard fault fixup mechanism to intercept the fault,
fix up the exception frame, and redirect execution to fred_entrypoint_user.
The end result is that it appears just as if the hardware had taken the
exception immediately after completing the transition to user space.
Suggested-by: H. Peter Anvin (Intel) <[email protected]>
Signed-off-by: Xin Li <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Signed-off-by: Borislav Petkov (AMD) <[email protected]>
Tested-by: Shan Kang <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Diffstat (limited to 'lib/test_fortify/write_overflow-strncpy-src.c')
0 files changed, 0 insertions, 0 deletions