Skip to content

disable KASLR when using GDB#15

Merged
nickdesaulniers merged 1 commit into
masterfrom
nokaslr
May 7, 2020
Merged

disable KASLR when using GDB#15
nickdesaulniers merged 1 commit into
masterfrom
nokaslr

Conversation

@nickdesaulniers

Copy link
Copy Markdown
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

ojeda commented May 7, 2020

Copy link
Copy Markdown

Perhaps a comment somewhere could be nice as a remainder.

@nickdesaulniers

Copy link
Copy Markdown
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

ojeda commented May 8, 2020

Copy link
Copy Markdown

@nickdesaulniers That would be way better, yeah!

@kees

kees commented May 14, 2020

Copy link
Copy Markdown
Contributor

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