Skip to content

initramfs: test and improve cpio hex header validation

Andy Shevchenko linux-fsdevel lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v3 Latest6 patches 11 repliesIn review

Changes in v3 from the cover letter

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

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6initramfs_test: add fill_cpio() format parameterinit/initramfs_test.c+14 -132 replies
2/6initramfs_test: test header fields with 0x hex prefixinit/initramfs_test.c+60 -00 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 -370 replies
5/6vsprintf: Revert "add simple_strntoul"include/linux/kstrtox.h lib/vsprintf.c+0 -82 replies
6/6kstrtox: Drop extern keyword in the simple_strtox() declarationsinclude/linux/kstrtox.h+4 -42 replies

Reviews trailers per patch

4 of 6 patches have a Reviewed-by or Acked-by.

PatchAndy ShevchenkoDavid DisseldorpPetr Mladek
1/6R-b
2/6
3/6R-b
4/6
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 v3 thread

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

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() format parameter
initramfs_test: test header fields with 0x hex prefix

 include/linux/kstrtox.h |  9 +++---
 init/initramfs.c        | 68 +++++++++++++++++++++-----------------
 init/initramfs_test.c   | 72 +++++++++++++++++++++++++++++++++--------
 lib/vsprintf.c          |  7 ----
 4 files changed, 101 insertions(+), 55 deletions(-)
Signature · 1 line
2.50.1