Skip to content
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

[Bug] gef is slow while debugging kernel in qemu #978

Closed
1 of 9 tasks
karzanWang opened this issue Aug 2, 2023 · 1 comment
Closed
1 of 9 tasks

[Bug] gef is slow while debugging kernel in qemu #978

karzanWang opened this issue Aug 2, 2023 · 1 comment
Labels

Comments

@karzanWang
Copy link

GEF+GDB version

gef: 2023.04 release
gdb: GNU gdb (Ubuntu 12.1-0ubuntu1~22.04) 12.1

Operating System

Ubuntu 22.04.2 LTS

Describe the issue you encountered

Gdb with gef is slow when debugging kernel in qemu (with command gef-remote --qemu-user --qemu-binary ./vmlinux localhost 1234).

Do you read the docs and look at previously closed issues/PRs for similar cases?

Yes

Architecture impacted

  • X86
  • X64
  • ARM
  • ARM64
  • MIPS
  • MIPS64
  • PPC
  • PPC64
  • RISCV

Describe your issue. Without a proper reproduction step-by-step, your issue will be ignored.

  1. downlaod the challenge (https:/Crusaders-of-Rust/corCTF-2022-public-challenge-archive/tree/master/pwn/cache-of-castaways)
  2. extract the vmlinux elf from bzImage.
  3. start the kernel with qemu with the run script. (and add -s in qemu args)
  4. start gdb, execute gef-remote --qemu-user --qemu-binary ./vmlinux localhost 1234
  5. normally debug the kernel, execute sth. like si. This is slow.

Minimalist test case

No response

Additional context?

No response

@hugsy
Copy link
Owner

hugsy commented Aug 2, 2023

Not quite sure what you mean by "slow": I tried it and it is as fast as what you can expect from debugging an emulated VM. If you're referring to the slow-down when displaying the context pane, it is indeed slowed down, but that's mostly caused by the multiple pointer dereferencing. So you can speed things by making the context collect less info by editing your view (gef config context.layout). In addition, it is well-known that the gdb remote protocol is old and slow.

So unless you can give us better tracks as to which specific part(s) we can improve (in GEF), there's not a lot we can do.

@hugsy hugsy removed the bug label Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants