Couldn't find general-purpose registers in core file

Discuss usability issues, general maintenance, and general support issues for a grsecurity-enabled system.

Couldn't find general-purpose registers in core file

Postby KDE » Sun Feb 24, 2013 1:22 pm

Hello,
It seems core dumps are broken if kernel is compiled with grsecurity-2.9.1-3.7.9-201302171808.patch
There is no error if kernel is compiled without grsec patch.

# ulimit -c
unlimited

# gdb /usr/libexec/weston-desktop-shell core
GNU gdb (Gentoo 7.5.1 p1) 7.5.1
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
For bug reporting instructions, please see:
<http://bugs.gentoo.org/>...
Reading symbols from /usr/libexec/weston-desktop-shell...Reading symbols from /usr/lib64/debug/usr/libexec/weston-desktop-shell.debug...done.
done.

warning: core file may not match specified executable file.
[New process 177732]

warning: Could not load shared library symbols for linux-vdso.so.1.
Do you need "set solib-search-path" or "set sysroot"?
[New LWP 177732]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".

warning: Couldn't find general-purpose registers in core file.
Error in re-setting breakpoint -1: PC register is not available

warning: Couldn't find general-purpose registers in core file.
Error in re-setting breakpoint -2: PC register is not available

warning: Couldn't find general-purpose registers in core file.
Error in re-setting breakpoint -3: PC register is not available

warning: Couldn't find general-purpose registers in core file.
Error in re-setting breakpoint -4: PC register is not available

warning: Couldn't find general-purpose registers in core file.
Error in re-setting breakpoint -5: PC register is not available

warning: Couldn't find general-purpose registers in core file.
Error in re-setting breakpoint -6: PC register is not available

warning: Couldn't find general-purpose registers in core file.
Error in re-setting breakpoint -7: PC register is not available

warning: Couldn't find general-purpose registers in core file.
Error in re-setting breakpoint -8: PC register is not available

warning: Couldn't find general-purpose registers in core file.
Error in re-setting breakpoint -9: PC register is not available

warning: Couldn't find general-purpose registers in core file.
Error in re-setting breakpoint -10: PC register is not available

warning: Couldn't find general-purpose registers in core file.
Error in re-setting breakpoint -1: PC register is not available

warning: Couldn't find general-purpose registers in core file.
Error in re-setting breakpoint -2: PC register is not available

warning: Couldn't find general-purpose registers in core file.
Error in re-setting breakpoint -3: PC register is not available

warning: Couldn't find general-purpose registers in core file.
Error in re-setting breakpoint -4: PC register is not available

warning: Couldn't find general-purpose registers in core file.
Error in re-setting breakpoint -5: PC register is not available

warning: Couldn't find general-purpose registers in core file.
Error in re-setting breakpoint -6: PC register is not available

warning: Couldn't find general-purpose registers in core file.
Error in re-setting breakpoint -7: PC register is not available

warning: Couldn't find general-purpose registers in core file.
Error in re-setting breakpoint -8: PC register is not available

warning: Couldn't find general-purpose registers in core file.
Error in re-setting breakpoint -9: PC register is not available

warning: Couldn't find general-purpose registers in core file.
Error in re-setting breakpoint -10: PC register is not available

warning: Couldn't find general-purpose registers in core file.
Error in re-setting breakpoint -11: PC register is not available

warning: Couldn't find general-purpose registers in core file.
Error in re-setting breakpoint -12: PC register is not available

warning: Couldn't find general-purpose registers in core file.
Error in re-setting breakpoint -13: PC register is not available

warning: Couldn't find general-purpose registers in core file.
Error in re-setting breakpoint -14: PC register is not available

warning: Couldn't find general-purpose registers in core file.
Error in re-setting breakpoint -15: PC register is not available

warning: Couldn't find general-purpose registers in core file.
Error in re-setting breakpoint -16: PC register is not available

warning: Couldn't find general-purpose registers in core file.
Error in re-setting breakpoint -17: PC register is not available

warning: Couldn't find general-purpose registers in core file.
Error in re-setting breakpoint -18: PC register is not available

warning: Couldn't find general-purpose registers in core file.
Error in re-setting breakpoint -19: PC register is not available

warning: Couldn't find general-purpose registers in core file.
Error in re-setting breakpoint -20: PC register is not available
Core was generated by `/usr/libexec/weston-desktop-shell'.
Program terminated with signal 11, Segmentation fault.
#0 0x0000000000000004 in ?? ()
(gdb) bt
#0 0x0000000000000004 in ?? ()
Cannot access memory at address 0x0
(gdb) quit
warning: Couldn't find general-purpose registers in core file.
Quitting: PC register is not available
KDE
 
Posts: 57
Joined: Sat Feb 09, 2008 5:29 am

Re: Couldn't find general-purpose registers in core file

Postby PaX Team » Sun Mar 10, 2013 4:50 pm

can you show me the output of readelf -n core for the working/non-working cases?
PaX Team
 
Posts: 2310
Joined: Mon Mar 18, 2002 4:35 pm

Re: Couldn't find general-purpose registers in core file

Postby KDE » Tue Mar 12, 2013 9:25 am

working
Notes at offset 0x00001c78 with length 0x00002004:
Owner Data size Description
CORE 0x00000150 NT_PRSTATUS (prstatus structure)
CORE 0x00000088 NT_PRPSINFO (prpsinfo structure)
CORE 0x00000080 Unknown note type: (0x53494749)
CORE 0x00000130 NT_AUXV (auxiliary vector)
CORE 0x000017b0 Unknown note type: (0x46494c45)
CORE 0x00000200 NT_FPREGSET (floating point registers)
LINUX 0x00000240 NT_X86_XSTATE (x86 XSAVE extended state)

non-working
Notes at offset 0x00001cb0 with length 0x00001fdc:
Owner Data size Description
CORE 0x00000128 NT_PRSTATUS (prstatus structure)
CORE 0x00000088 NT_PRPSINFO (prpsinfo structure)
CORE 0x00000080 Unknown note type: (0x53494749)
CORE 0x00000130 NT_AUXV (auxiliary vector)
CORE 0x000017b0 Unknown note type: (0x46494c45)
CORE 0x00000200 NT_FPREGSET (floating point registers)
LINUX 0x00000240 NT_X86_XSTATE (x86 XSAVE extended state)
KDE
 
Posts: 57
Joined: Sat Feb 09, 2008 5:29 am

Re: Couldn't find general-purpose registers in core file

Postby KDE » Tue Mar 12, 2013 9:45 am

non-working is from kernel with grsecurity-2.9.1-3.8.2-201303102007.patch
KDE
 
Posts: 57
Joined: Sat Feb 09, 2008 5:29 am

Re: Couldn't find general-purpose registers in core file

Postby PaX Team » Tue Mar 12, 2013 10:23 am

hmm, weird, in the non-working case the NT_PRSTATUS field is that of i386, not amd64, no wonder gdb bailed out. can you send me your .config and the fs/binfmt_elf.o files from both a working and non-working kernel please?
PaX Team
 
Posts: 2310
Joined: Mon Mar 18, 2002 4:35 pm

Re: Couldn't find general-purpose registers in core file

Postby KDE » Wed Mar 13, 2013 10:48 am

sent by private message
KDE
 
Posts: 57
Joined: Sat Feb 09, 2008 5:29 am

Re: Couldn't find general-purpose registers in core file

Postby PaX Team » Sat Mar 16, 2013 9:35 am

interesting, it seems that the non-working binfmt_elf.o is actually more like compat_binfmt_elf.o (which would be used for 32 bit userland). so a few more questions/requests:

1. i'll need fs/compat_binfmt_elf.o, fs/.binfmt_elf.o.cmd, fs/.compat_binfmt_elf.o.cmd (both the working and non-working versions of each)
2. the output of 'file /usr/libexec/weston-desktop-shell'
3. can you try to compile a PaX-only kernel and see if the same behaviour persists?
PaX Team
 
Posts: 2310
Joined: Mon Mar 18, 2002 4:35 pm

Re: Couldn't find general-purpose registers in core file

Postby spender » Sat Mar 16, 2013 11:27 am

Hi,

This will be fixed in the next patch. Thanks for your report.

-Brad
spender
 
Posts: 2185
Joined: Wed Feb 20, 2002 8:00 pm


Return to grsecurity support

cron