running sysctl -a --pattern "randomize"
=2
, so the data segemnt is supposed to be randomized also but cat maps
always seems to randomize vdso
stack
and other kernal provided mappings only. These are first 2 entries of process maps file refering for .text
and .data
cat maps
00400000-00402000 r-xp 00000000 08:07 14569655
00402000-00403000 rwxp 00002000 08:07 14569655
I halted application so i can read maps file by running it in gdb with set disable-randomization off
.The source code i use is:
section .data
name: db "k"
section .text
global _start
_start:
end: mov rax, 60
mov rdi, 0
syscall
built and linked as:
ld sand.o -o sand
nasm -g -F DWARF -f elf64 -o sand.o sand.asm
another side question, I guess that .text
cant be randomized since there is no need for it as it's read, right or wrong ?