tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Regarding the debugging through Qemu on Preken



Hi there,

First of all thanks to Maxime Villard and the team for the different approach on KASLR implementation, "prekern".

Out of curiosity, I am learning about the internals of the prekern by reading the source code and also trying to attach the debugger as well to read the code with the flow.
I have tried some setups but none of them is working to put a break point on the functions mentioned in prekern.c file, like init_prekern(), etc.

My setup includes
Debugger machine : NetBSD-9.RC1 amd64
Debuggee machine : NetBSD-9.RC1 amd64

I have compiled the code on debugger machine and copied the netbsd_kaslr and prekern binary (prekern from /usr/mdec/prekern) to the taget debuggee machine.
Then, invoked the target debuggee machine using qemu-system-x86_64 with -S and -s options and attached the gdb from debugger machine to debuggee machine using :1234 port.

I am able to see the code files and able to put the breakpoints on other functions/syscalls but not able to put breakpoint on init_prekern(). It seems that the init_prekern() is not in the debug symbols, not sure why?.

I have also tried by following the instructions given https://wiki.netbsd.org/kernel_debugging_with_qemu/ and also followed https://wiki.netbsd.org/security/kaslr/ but I have tried for i386 because in the first link it is mentioned that there is some qemu bug on amd64 and I think prekern is there only for amd64 not for i386.

Now, I am thinking to put some printfs in the code, but could someone please let me know about the debugging through qemu for prekern.


Regards and Thanks,
Neeraj


Home | Main Index | Thread Index | Old Index