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

Andy Shevchenko posted 6 patches 3 hours ago
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(-)
[PATCH v3 0/6] initramfs: test and improve cpio hex header validation
Posted by Andy Shevchenko 3 hours ago
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: 20260121172749.32322-1-ddiss@suse.de
v1: 20260119204151.1447503-1-andriy.shevchenko@linux.intel.com

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(-)

-- 
2.50.1