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

From: Miroslav Benes

Date: Mon Nov 23 2026 - 07:53:54 EST


On Mon, 23 Nov 2026, 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>

Reviewed-by: Miroslav Benes <mbenes@xxxxxxx>

Thank you
M