NetBSD-Bugs archive

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

kern/51277: compat32 core dumps stopped working

>Number:         51277
>Category:       kern
>Synopsis:       compat32 core dumps stopped working
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Jun 26 12:30:00 +0000 2016
>Originator:     Martin Husemann
>Release:        NetBSD 7.99.32
The NetBSD Foundation, Inc.
System: NetBSD 7.99.32 NetBSD 7.99.32 (NIGHT-OWL) #420: Tue Jun 21 17:31:55 CEST 2016 amd64
Architecture: x86_64
Machine: amd64

The addition auf the auxv ELF_NOTE_NETBSD_CORE_AUXV note broke dumping core
files for 32bit compat processes.

See the usage of the native struct ps_strings pss to calculate length
and user address of the auxv, and compare to the similar code in
copyin_psstrings where a struct ps_strings32 is used and converted
after copyin. However, this is bogus as well, as it assumes all 32bit
processes would be compat_netbsd32 processes w/o further testing.

Not sure, however, how important dumping proper cores in other emulated
environments is.


$ cat test.c 
#include <stdlib.h>

int main(int argc, char **argv)
        return 0;
$ cc -Wall -O2 -m32 test.c
$ ./a.out
$ ls -l a.out.core 
-rw-------  1 martin  wheel  0 Jun 26 14:19 a.out.core

Move copy-in of the auxv into copyin_psstrings(), where a hack deals with
PK_32 processes - however, the correct fix would be to make this copyin a
per-emulation operation and move it from sys/kern to sys/compat/*

Home | Main Index | Thread Index | Old Index