Skip to content

initramfs: test and improve cpio hex header validation

David Disseldorp linux-fsdevel lkml 4 versions – Applied

Status from this message: Applied to the vfs-7.2.misc branch of the vfs/vfs.git tree.

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest6 patches 9 repliesApplied
  2. v46 patches 6 repliesSuperseded
  3. v28 patches 2 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v12 patches6 repliesSuperseded

Changes in v5 from the cover letter

- rework 2/6 and 4/6 test comment, as suggested by Andy
- 2/6: initialize struct kstat in tests to account for possible init_stat() failure
+ drop Andy's review tag due to this minor change

Patches in v5 Applied

#Subject and filesSizeRepliesApplied
1/6initramfs_test: add fill_cpio() inject_ox parameterinit/initramfs_test.c+23 -131 reply
2/6initramfs_test: test header fields with 0x hex prefixinit/initramfs_test.c+58 -22 replies
3/6initramfs: Sort headers alphabeticallyinit/initramfs.c+12 -121 reply
4/6initramfs: Refactor to use hex2bin() instead of custom approachinit/initramfs.c init/initramfs_test.c+30 -381 reply
5/6vsprintf: Revert "add simple_strntoul"include/linux/kstrtox.h lib/vsprintf.c+0 -80 replies
6/6kstrtox: Drop extern keyword in the simple_strtox() declarationsinclude/linux/kstrtox.h+4 -40 replies

Reviews trailers per patch

All 6 patches have a Reviewed-by or Acked-by.

PatchAndy ShevchenkoDavid DisseldorpPetr Mladek
1/6R-b R-b
2/6R-b R-b
3/6R-b R-b
4/6R-b
5/6R-b A-b
6/6R-b R-b

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 v5 thread

Cover letter [PATCH v5 0/6] initramfs: test and improve cpio hex header validation

v5 changes:
- rework 2/6 and 4/6 test comment, as suggested by Andy
- 2/6: initialize struct kstat in tests to account for possible init_stat() failure
+ drop Andy's review tag due to this minor change

----------------------------------------------------------------
v4: [email protected]
- rework initramfs_test changes to use an inject_ox parameter instead of having tests pass through an unvalidated format string.
+ drop Andy's reviewed-by from 1/6 and 2/6 to account for changed test
+ 4/6 minor changes for test context and comment
- add review tags for 3/6, 5/6 and 6/6 following list feedback

----------------------------------------------------------------
v3: [email protected]

The series that introduced simple_strntoul() had passed into kernel without proper review and hence reinvented a wheel that's not needed. Here is the refactoring to show that. It can go via PRINTK or VFS tree.

I have tested this on x86, but I believe the same result will be on big-endian CPUs (I deduced that from how strtox() works).

I also run KUnit tests.

Changelog v3:
- rebased on top of latest kernel
- squashed patches proposed by David

v2: [email protected]
v1: [email protected]

----------------------------------------------------------------
Andy Shevchenko (4):
initramfs: Sort headers alphabetically
initramfs: Refactor to use hex2bin() instead of custom approach
vsprintf: Revert "add simple_strntoul"
kstrtox: Drop extern keyword in the simple_strtox() declarations

David Disseldorp (2):
initramfs_test: add fill_cpio() inject_ox parameter
initramfs_test: test header fields with 0x hex prefix

 include/linux/kstrtox.h |  9 +++--
 init/initramfs.c        | 68 +++++++++++++++++++----------------
 init/initramfs_test.c   | 80 +++++++++++++++++++++++++++++++++--------
 lib/vsprintf.c          |  7 ----
 4 files changed, 107 insertions(+), 57 deletions(-)