Now
netbsd-10 commitmail json YAML
src/sys/arch/aarch64/aarch64/cpu_machdep.c@1.13.4.1
/
diff
/
nxr@1.13.4.1
src/sys/arch/aarch64/aarch64/sig_machdep.c@1.8.4.1 / diff / nxr@1.8.4.1
src/sys/arch/aarch64/aarch64/sig_machdep.c@1.8.4.1 / diff / nxr@1.8.4.1
Pull up following revision(s) (requested by skrll in ticket #667):
sys/arch/aarch64/aarch64/sig_machdep.c: revision 1.9
sys/arch/aarch64/aarch64/cpu_machdep.c: revision 1.15
kern/58149: aarch64: Cannot return from a signal handler if SP was
misaligned when the signal arrived
Apply the kernel diff from the PR
1. sendsig_siginfo() previously assumed that user SP was always aligned to
16 bytes and could call signal handlers with SP misaligned. This is a
wrong assumption because aarch64 demands that SP is aligned *only while*
it's being used to access memory. Now it properly aligns it before
pusing anything on the stack.
2. cpu_mcontext_validate() used to check if _REG_SP was aligned and
considered the ucontext invalid otherwise. This meant if a signal was
sent to a process whose SP was misaligned, the signal handler would fail
to return because the ucontext passed from the kernel was an invalid
one. Now setcontext(2) doesn't complain about misaligned SP.
sys/arch/aarch64/aarch64/sig_machdep.c: revision 1.9
sys/arch/aarch64/aarch64/cpu_machdep.c: revision 1.15
kern/58149: aarch64: Cannot return from a signal handler if SP was
misaligned when the signal arrived
Apply the kernel diff from the PR
1. sendsig_siginfo() previously assumed that user SP was always aligned to
16 bytes and could call signal handlers with SP misaligned. This is a
wrong assumption because aarch64 demands that SP is aligned *only while*
it's being used to access memory. Now it properly aligns it before
pusing anything on the stack.
2. cpu_mcontext_validate() used to check if _REG_SP was aligned and
considered the ucontext invalid otherwise. This meant if a signal was
sent to a process whose SP was misaligned, the signal handler would fail
to return because the ucontext passed from the kernel was an invalid
one. Now setcontext(2) doesn't complain about misaligned SP.