Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

warning: Error disabling address space randomization: Operation not permitted

Tags:

c

docker

gdb

what have i done wrong (or didn't do) that gdb is not working properly for me?

root@6be3d60ab7c6:/# cat minimal.c  int main() {   int i = 1337;   return 0; } root@6be3d60ab7c6:/# gcc -g minimal.c -o minimal root@6be3d60ab7c6:/# gdb minimal GNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.2) 7.7.1 . . . Reading symbols from minimal...done. (gdb) break main Breakpoint 1 at 0x4004f1: file minimal.c, line 3. (gdb) run Starting program: /minimal  warning: Error disabling address space randomization: Operation not permitted During startup program exited normally. (gdb)  (gdb) print i    No symbol "i" in current context. 
like image 225
Jas Avatar asked Mar 08 '16 06:03

Jas


People also ask

How do I enable address space layout randomization?

Enabling ASLR By default, ASLR is disabled. To enable ASLR, either IPL the system using a DIAGxx member that specifies the ASLR option or issue the SET DIAG=xx command after IPL. If you enable ASLR after IPL, only those jobs that are subsequently started and that are not exempt from ASLR will have ASLR enabled.

What is memory address randomization?

Address space layout randomization (ASLR) is a memory-protection process for operating systems (OSes) that guards against buffer-overflow attacks by randomizing the location where system executables are loaded into memory.


1 Answers

If you're using Docker, you probably need the --security-opt seccomp=unconfined option (as well as enabling ptrace):

docker run --cap-add=SYS_PTRACE --security-opt seccomp=unconfined 
like image 122
wisbucky Avatar answered Oct 03 '22 09:10

wisbucky