I've read this Does Linux kernel use DEP for kernel memory?
but I'm debugging linux kernel (x86_64) on Vmware using vmware stub. I've attached gdb to my linux kernel. the kernel version is 3.x
and I changed executable memory of linux kernel in one place
(gdb) x/i $rip
=> 0xffffffff81190930 <sys_getdents>: push rbp
(gdb) set{long}0xffffffff81190930=0
(gdb) x/x 0xffffffff81190930
0xffffffff81190930 <sys_getdents>: 0x00000000
(gdb) x/i $rip
=> 0xffffffff81190930 <sys_getdents>: add BYTE PTR [rax],al
why is that? is this because I'n in virtual machine?
second question. I know that I can list pages using this command
(gdb) info files
Symbols from "/home/a/vmlinux".
Remote serial target in gdb-specific protocol:
Debugging a target over a serial line.
While running this, GDB does not access memory from...
Local exec file:
`/home/a/vmlinux', file type elf64-x86-64.
warning: Cannot find section for the entry point of /home/a/vmlinux.
Entry point: 0x1000000
0xffffffff81000000 - 0xffffffff815f795f is .text
0xffffffff815f7960 - 0xffffffff815f7adc is .notes
0xffffffff815f7ae0 - 0xffffffff815fbb00 is __ex_table
0xffffffff81600000 - 0xffffffff818427ce is .rodata
0xffffffff818427d0 - 0xffffffff81849ed4 is __bug_table
but how to list permissions to these pages - rwx ?