pwndbg/pwndbg
在 GitHub 查看Setting variables in a Linux kernel instance does not work with `pwndbg`
Open
#2,518 建立於 2024年11月12日
bughelp wantedkernel
倉庫指標
- Star
- (5,820 star)
- PR 合併指標
- (平均合併 3天 12小時) (30 天內合併 32 個 PR)
描述
Description
Setting variables on a running Linux kernel (6.5.7) that is being debugged with kgdb, pwndbg and QEMU doesn't work, even if it does on common gdb.
Steps to reproduce
- Download the source to the Linux kernel: https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-6.5.7.tar.xz
- Note: I used the virtual machine image provided here as part of a university course: https://teaching.os.rwth-aachen.de/LKP/data/lkp-arch.img
- Download the config provided here: https://teaching.os.rwth-aachen.de/LKP/data/config-lkp, enable all relevant debugging-related options
- Compile the kernel and boot it using QEMU with the kernel options
rw console=ttyS0 kgdboc=ttyS1 kgdbwait nokaslr(and the QEMU option-serial mon:stdio -serial tcp::1234,server,nowait) - On the root folder of the kernel sources, run
gdb ./vmlinux - On Linux (running on QEMU), run
continue, let the machine boot, then runecho g > /proc/sysrq-triggerto invoke the debugger again - Try running
set variable nit_uts_ns.name.sysname = "Test"
pwndbg> set variable init_uts_ns.name.release = "dskasd"
Cannot access memory at address 0xffffffff82c66b42
- This should not happen, as it works on GDB.
My setup
pwndbg> version
Gdb: 15.0.50.20240403-git
Python: 3.12.3 (main, Sep 11 2024, 14:17:37) [GCC 13.2.0]
Pwndbg: 2024.08.29 build: 88c363a6
Capstone: 5.0.1280