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
>Organization:
The NetBSD Foundation, Inc.
>Environment:
System: NetBSD night-owl.duskware.de 7.99.32 NetBSD 7.99.32 (NIGHT-OWL) #420: Tue Jun 21 17:31:55 CEST 2016 martin%night-owl.duskware.de@localhost:/usr/src/sys/arch/amd64/compile/NIGHT-OWL amd64
Architecture: x86_64
Machine: amd64
>Description:

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.

>How-To-Repeat:

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

int main(int argc, char **argv)
{
        abort();
        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


>Fix:
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