Skip to content

disable KASLR when using GDB #15

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 7, 2020
Merged

disable KASLR when using GDB #15

merged 1 commit into from
May 7, 2020

Conversation

nickdesaulniers
Copy link
Member

I was pulling my hair out trying to debug
ClangBuiltLinux/linux#852 since breakpoints I
set were never hit.

Sami Tolvanen (@samitolvanen) reminded me I need to disable KASLR via
nokaslr kernel command line parameter.

Separate out the -append string from QEMU_ARCH_ARGS, since we need to
change it both for interactive and debug mode.

I was pulling my hair out trying to debug
ClangBuiltLinux/linux#852 since breakpoints I
set were never hit.

Sami Tolvanen (@samitolvanen) reminded me I need to disable KASLR via
nokaslr kernel command line parameter.

Separate out the -append string from QEMU_ARCH_ARGS, since we need to
change it both for interactive and debug mode.
@nickdesaulniers nickdesaulniers merged commit 54aecc5 into master May 7, 2020
@nickdesaulniers nickdesaulniers deleted the nokaslr branch May 7, 2020 18:52
@ojeda
Copy link
Member

ojeda commented May 7, 2020

Perhaps a comment somewhere could be nice as a remainder.

@nickdesaulniers
Copy link
Member Author

I wonder if I can extend vmlinux-gdb.py to warn if the kernel was booted with KASLR that it's basically not going to work for any debugging.

@ojeda
Copy link
Member

ojeda commented May 8, 2020

@nickdesaulniers That would be way better, yeah!

@kees
Copy link
Contributor

kees commented May 14, 2020

There's only so many places the kernel can be in memory. It shouldn't be too hard to search quickly for the correct KASLR base. What is the right way to update gdb's sense of the base address, though, once its has been located?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants