Home | History | Annotate | Download | only in kernel
History log of /src/tests/kernel/t_execregs.c
RevisionDateAuthorComments
 1.7  27-Apr-2025  riastradh branches: 1.7.4;
t_execregs: Redo better diagnostics for child.

Accidentally backed out the wrong commit here:

https://mail-index.netbsd.org/source-changes/2025/04/26/msg156620.html

Meant to back out this one:

https://mail-index.netbsd.org/source-changes/2025/04/26/msg156607.html

Instead backed out this one (which I am now restoring):

https://mail-index.netbsd.org/source-changes/2025/04/25/msg156596.html

PR kern/59084: exec/spawn leaks register content
 1.6  26-Apr-2025  riastradh tests/kernel/Makefile: Back out DPSRCS for t_execregs arch helpers.

Doesn't work the way I'd hoped for update builds -- I had tested it
only with a .h file, not with the .S files:

# create kernel//work/src/tests/kernel/arch/arm/execsp.d
CC=/work/tools/bin/arm--netbsdelf-eabi-gcc /work/tools/bin/nbmkdep -f /work/src/tests/kernel/arch/arm/execsp.d.tmp -- --sysroot=/branches/hosts-current/evbearmv5 -D_KERNTYPES -I/work/src/tests/kernel/.. -x assembler-with-cpp /work/src/tests/kernel/arch/arm/execsp.S && mv -f /work/src/tests/kernel/arch/arm/execsp.d.tmp /work/src/tests/kernel/arch/arm/execsp.d
nbmkdep: unable to write to file /work/src/tests/kernel/arch/arm/execsp.d.tmp: Permission denied

PR kern/59084: exec/spawn leaks register content
 1.5  25-Apr-2025  riastradh t_execregs: Make failure of child a little more obvious.

PR kern/59084: exec/spawn leaks register content
 1.4  16-Mar-2025  riastradh Clear trapframe on exec.

Do this for all architectures, even if the trapframe is fully
initialized -- makes it easier to audit and be confident it's
correct, and most likely (with the exception of sh3 which has an
intermediate call to ufetch_int in the middle) the compiler can
eliminate redundant stores in these routines.

PR kern/59084: exec/spawn leaks register content
 1.3  28-Feb-2025  riastradh t_execregs: Make read failure nonfatal.

This way, the test will report when the helper program h_execregs has
crashed, which happens often during development because it's an
assembly routine with the barest possible runtime support in order to
get at registers immediately on startup before anything like libc
constructors have clobbered them.

PR kern/59084: exec/spawn leaks register content
 1.2  28-Feb-2025  riastradh t_execregs: Test some more registers on hppa.

Looks like we're missing zeroing of floating-point registers too, as
well as the carry/borrow and divide step correction bits in the
semi-secret PSW register.

Unfortunately, while investigating this, I discovered that qemu's
hppa implementation doesn't implement fpu traps even if the fpu is
disabled (relevant bits of CR 10 `CCR', Coprocessor Control Register,
are cleared), which breaks fpu switching on NetBSD. So I can't test
properly this myself. We should maybe just change NetBSD from lazy
fpu switching to eager fpu switching anyway to thwart Spectre-class
attacks if there's any hppa hardware out there that does speculative
execution.

PR kern/59084: exec/spawn leaks register content
 1.1  27-Feb-2025  riastradh Test whether exec/spawn will zero registers.

Currently implemented only for a handful of architectures; should
extend this to all the others, and extend as appropriate if we find
more register content is worth testing (like maybe vector registers,
but they are managed differently anyway and less likely to leak).

VAX test contributed (and tested) by Kalvis Duckmanton, with some
tweaks by me; the others written and tested by me. IA64 skipped,
even though I suspect it _would_ leak if the kernel code ran as is,
because I have no way to test it.

PR kern/59084: exec/spawn leaks register content
 1.7.4.2  02-Aug-2025  perseant Sync with HEAD
 1.7.4.1  27-Apr-2025  perseant file t_execregs.c was added on branch perseant-exfatfs on 2025-08-02 05:58:01 +0000

RSS XML Feed