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

Regarding "statically allocated data" again #1373

Closed
zegao96 opened this issue Jan 31, 2024 · 2 comments
Closed

Regarding "statically allocated data" again #1373

zegao96 opened this issue Jan 31, 2024 · 2 comments

Comments

@zegao96
Copy link

zegao96 commented Jan 31, 2024

Hi @jpoimboe ,

I'm studying how kpatch (and the kernel part) works and kinda baffled by "Patches which modify statically allocated data are not directly supported. kpatch-build will detect that and return an error. " , one of the limitations that's posted. By "modify", does this refer to "changing the data layout or just accessing (read/write)?

Regarding KLP and its consistency model, IIUC any patched function with global semantic needs manual inspection for correctness, no matter if it refers to statically allocated or dynamically allocated variables. And here kpatch-build claims that it would detect "statically allocated data" case specially, I wonder how it works? Does it achieve this by just rejecting any relocations against statically global vars in the patched function if i understand "modify" correctly?

Will be much appreciated if you help to clear my doubts. :)

Thanks!

@jpoimboe
Copy link
Member

jpoimboe commented Feb 1, 2024

This refers to data which is allocated and initialized at compile time. For example, if the patch causes any changes to the .data section, kpatch-build will detect that and throw an error.

@zegao96
Copy link
Author

zegao96 commented Feb 1, 2024

This refers to data which is allocated and initialized at compile time. For example, if the patch causes any changes to the .data section, kpatch-build will detect that and throw an error.

Thanks for your elaboration. So it's not about global data references here but rather .data section changes, seems like i overthink a little bit. :)

@zegao96 zegao96 closed this as completed Feb 1, 2024
@zegao96 zegao96 reopened this Feb 1, 2024
@zegao96 zegao96 closed this as completed Feb 1, 2024
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

No branches or pull requests

2 participants