Re: [PATCH v3 4/9] objtool/klp: Explicitly disallow patching or referencing init code/data

From: Song Liu

Date: Tue Aug 11 2026 - 18:33:11 EST


On Fri, Aug 7, 2026 at 2:38 PM Josh Poimboeuf <jpoimboe@xxxxxxxxxx> wrote:
>
> Explicitly disallow the patching and referencing of init code/data.
> Otherwise it could potentially introduce some odd edge cases depending
> on whether the target object's init section has been freed yet (note
> that the init code still exists in the target module when doing late
> module patching).
>
> Such edge cases include sympos calculation and the patching and/or
> referencing of non-existent (init-freed) code/data. Not to mention the
> inherent differences in behavior that occur when the init code is only
> patched *some* of the time depending on module loading order or kernel
> config.
>
> Signed-off-by: Josh Poimboeuf <jpoimboe@xxxxxxxxxx>

Acked-by: Song Liu <song@xxxxxxxxxx>