Skip to content

feat: BTF struct/offset support for KernelPatch and KPMs - #284

Open
MhmRdd wants to merge 5 commits into
bmax121:mainfrom
MhmRdd:feat/kpm-btf
Open

feat: BTF struct/offset support for KernelPatch and KPMs#284
MhmRdd wants to merge 5 commits into
bmax121:mainfrom
MhmRdd:feat/kpm-btf

Conversation

@MhmRdd

@MhmRdd MhmRdd commented Jul 23, 2026

Copy link
Copy Markdown

No description provided.

@niqiuqiux

Copy link
Copy Markdown
Contributor

I implemented this feature quite some time ago; BTF support is only enabled on kernels A13 and later (so I don't think it's suitable for the mainline, though it could serve as a feature branch). Additionally, BTF parsing can be performed during the kernel_init phase; for details, you can refer to my branch: https://github.com/niqiuqiux/KernelPatchUltra

@MhmRdd

MhmRdd commented Jul 27, 2026

Copy link
Copy Markdown
Author

Looks good but i don't prefer using symbols to recognize position of the btf blob, since i know some kernels to strip rodata, it's preferable to let kptools search for it, similarly to how ikconfig works.

@niqiuqiux

Copy link
Copy Markdown
Contributor

The kernel's own BTF parsing also relies on symbols; additionally, since the BTF data is embedded in the boot image, it can be scanned during the kernel_init phase. I believe my branch offers the most convenient approach; you can check the relevant commit changes for details.

@MhmRdd

MhmRdd commented Jul 28, 2026

Copy link
Copy Markdown
Author

well, as long as it works that's what's needed : D

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.

2 participants