Le 09/11/2024 à 22:03, Daniel Gomez a écrit :
On Sat Nov 9, 2024 at 11:35 AM CET, Christophe Leroy wrote:
To be on the safe side, try to set ro_after_init data section readonly
at the same time as rodata. If it fails it will likely fail again
later so let's cancel module loading while we still can do it.
If it doesn't fail, put it back to read-only, continue module loading
I think you mean put it back to rw?
Indeed
and cross fingers so that it still works after module init. Then it
should in principle never fail so add a WARN_ON_ONCE() to get a big
fat warning in case it happens anyway.
I agree this is the best we can do. But I don't think there's any
guarantee that we won't fail on the second try?
I think if it works once it will always work, see my response to patch
2/3. But I added that WARN_ON_ONCE() so that if it doesn't at least we
know it.