Page 1 of 1

GDB and grsecurity

PostPosted: Fri Dec 20, 2002 4:37 am
by cmouse
Hmm.. I would love to use GDB in the grsecurity kernel to debug my own programs. It seems though that this is made impossible. Could you be so kind and tell me if it's even possible to use GDB?

(gdb) run
Starting program: /www/htdocs/cgi-bin/com.cgi
Warning:
Cannot insert breakpoint -2.
Error accessing memory address 0x276e7190: Input/output error.
The same program may be running in another process.
(gdb)

Re: GDB and grsecurity

PostPosted: Fri Dec 20, 2002 5:32 am
by PaX Team
cmouse wrote:Hmm.. I would love to use GDB in the grsecurity kernel to debug my own programs. It seems though that this is made impossible. Could you be so kind and tell me if it's even possible to use GDB?
the error message you see is due to PaX, in particular the MPROTECT restrictions: executable regions are forced to be non-writable, even through the ptrace() interface (that could normally get around it), hence the gdb failure. the solution is to turn it off of course (on the target, not gdb), via chpax (or if you're using the later grsec patches, the ACL system).

PostPosted: Fri Dec 20, 2002 7:59 am
by cmouse
thanks... gotta try that =)