Skip to content

livepatch: Fail object initialization on duplicate patched function

Harry Hsu linux-kselftest live-patching lkml sashiko-reviews 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v3 Latest3 patches 2 repliesIn review

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3livepatch: Fail object initialization on duplicate patched functionkernel/livepatch/core.c+16 -11 reply
2/3livepatch: Move code for updating livepatch object relocationskernel/livepatch/core.c+36 -360 replies
3/3livepatch: Clean up klp_init_object_loaded() when failskernel/livepatch/core.c+20 -101 reply

Reviews trailers per patch

1 of 3 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchPetr MladekSong Liu
SeriesR-b T-b A-b
1/3R-b T-b
2/3
3/3

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH v3 0/3] livepatch: Fail object initialization on duplicate patched function

This is v3 of the patch failing object initialization when it patches the same underlying function twice through two aliased symbols (functions sharing one address) in the same object [1].

Per Miroslav's review, the changelog and title have been reworded to avoid implying this is livepatch-specific validation: the check runs during object initialization, which klp_module_coming() also triggers for a module still being loaded.

Petr found that the error path in klp_init_object_loaded() -- taken by this new check, among others -- leaves stale object state behind on failure. His two patches (2/3, 3/3) fix that by routing all of klp_init_object_loaded()'s error returns through proper cleanup, and are included in this series since they touch the same code and would otherwise conflict with patch 1/3.

[1] https://lore.kernel.org/all/[email protected]/

Harry Hsu (1):
livepatch: Fail object initialization on duplicate patched function

Petr Mladek (2):
livepatch: Move code for updating livepatch object relocations
livepatch: Clean up klp_init_object_loaded() when fails

 kernel/livepatch/core.c | 117 ++++++++++++++++++++++++----------------
 1 file changed, 71 insertions(+), 46 deletions(-)
Signature · 1 line
2.43.0