Source-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: src



Module Name:    src
Committed By:   riastradh
Date:           Fri Apr 25 00:26:59 UTC 2025

Modified Files:
        src/sys/arch/mips/include: frame.h mips_param.h
        src/sys/arch/mips/mips: compat_16_machdep.c netbsd32_machdep.c
            sig_machdep.c
        src/tests/kernel: t_signal_and_sp.c

Log Message:
mips: Align stack pointer on entry to signal handler.

Based on a patch by rin@.  The variant approach I took puts the stack
frame allocation and alignment logic in one place (getframe, used by
sendsig_siginfo for native (n64, on mips), netbsd32_sendsig_siginfo
for compat32 (n32/o32, on mips), and sendsig_sigcontext (compat 1.6))
and reduces the chance of provoking compiler exploitation of
undefined behaviour by doing arithmetic in uintptr_t rather than in
pointers to large aligned structs.  This also ensures the resulting
pointer is aligned for the object (struct siginfo_sigframe, struct
siginfo_sigframe32, struct sigcontext), not just for the ABI stack
alignment.

PR kern/59327: user stack pointer is not aligned properly


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/mips/include/frame.h
cvs rdiff -u -r1.53 -r1.54 src/sys/arch/mips/include/mips_param.h
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/mips/mips/compat_16_machdep.c \
    src/sys/arch/mips/mips/netbsd32_machdep.c
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/mips/mips/sig_machdep.c
cvs rdiff -u -r1.14 -r1.15 src/tests/kernel/t_signal_and_sp.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.




Home | Main Index | Thread Index | Old Index