Skip to content

livepatch/samples/selftest: Clean up show variables handling

Petr Mladek live-patching lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4livepatch/sample: Use the right type for the leaking data pointersamples/livepatch/livepatch-shadow-fix1.c samples/livepatch/livepatch-shadow-fix2.c samples/livepatch/livepatch-shadow-mod.c+10 -100 replies
2/4livepatch/selftest: Clean up shadow variable names and typelib/livepatch/test_klp_shadow_vars.c+52 -410 replies
3/4livepatch/samples/selftest: Use klp_shadow_alloc() API correctlylib/livepatch/test_klp_shadow_vars.c samples/livepatch/livepatch-shadow-fix1.c+36 -250 replies
4/4livepatch: Handle allocation failure in the sample of shadow variable APIsamples/livepatch/livepatch-shadow-fix1.c+16 -60 replies

Reviews trailers per patch

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

PatchJoe LawrenceMiroslav BenesKamalesh Babulal
SeriesR-b A-b R-b
1/4
2/4
3/4
4/4

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v1 thread

Cover letter [PATCH 0/4] livepatch/samples/selftest: Clean up show variables handling

Dan Carpenter reported suspicious allocations of shadow variables in the sample module, see
https://lkml.kernel.org/r/[email protected]

The code did not cause a real problem. But it was indeed misleading and semantically wrong. I got confused several times when cleaning it. So I decided to split the change into few steps. I hope that it will help reviewers and future readers.

The changes of the sample module are basically the same as in the RFC. In addition, there is a clean up of the module used by the selftest.

Petr Mladek (4):
livepatch/sample: Use the right type for the leaking data pointer livepatch/selftest: Clean up shadow variable names and type livepatch/samples/selftest: Use klp_shadow_alloc() API correctly
livepatch: Handle allocation failure in the sample of shadow variable
API

 lib/livepatch/test_klp_shadow_vars.c      | 119 +++++++++++++++++-------------
 samples/livepatch/livepatch-shadow-fix1.c |  39 ++++++----
 samples/livepatch/livepatch-shadow-fix2.c |   4 +-
 samples/livepatch/livepatch-shadow-mod.c  |   4 +-
 4 files changed, 99 insertions(+), 67 deletions(-)
Signature · 1 line
2.16.4