Re: [PATCH v2] livepatch: clear internal flags at init

From: Petr Mladek

Date: Tue Dec 01 2026 - 04:53:36 EST


On Mon 2026-11-23 10:40:00, Yafang Shao wrote:
> func->nop and obj->dynamic are internal flags. However, a patch module can
> set them in its static initializer and nothing validates that. The release
> path uses them to decide whether kfree() has to be called, so with such a
> patch the kernel ends up calling kfree() on memory it does not own.
>
> Explicitly clear these flags during init to avoid that.
>
> Suggested-by: Miroslav Benes <mbenes@xxxxxxx>
> Signed-off-by: Yafang Shao <laoar.shao@xxxxxxxxx>

JFYI, the patch has been committed into livepatching.git,
branch for-7.5/trivial.

Best Regards,
Petr