diff options
| author | David Disseldorp <ddiss@suse.de> | 2026-03-31 09:57:32 +0300 |
|---|---|---|
| committer | Christian Brauner <brauner@kernel.org> | 2026-05-21 10:32:46 +0300 |
| commit | 19868f7034a1c5a548d70f20a35ad3562ac69e2c (patch) | |
| tree | b9e159d47e2456228d9f4f41d0f028c22aadceae /scripts/stackusage | |
| parent | 8d14fe78cb5ac5b7ac85f5fbf0be9afb3a3dba0e (diff) | |
| download | linux-19868f7034a1c5a548d70f20a35ad3562ac69e2c.tar.xz | |
initramfs_test: test header fields with 0x hex prefix
cpio header fields are 8-byte hex strings, but one "interesting"
side-effect of our historic simple_str[n]toul() use means that a "0x"
(or "0X") prefixed header field will be successfully processed when
coupled alongside a 6-byte hex remainder string.
"0x" prefix support is contrary to the initramfs specification at
Documentation/driver-api/early-userspace/buffer-format.rst which states:
The structure of the cpio_header is as follows (all fields contain
hexadecimal ASCII numbers fully padded with '0' on the left to the
full width of the field, for example, the integer 4780 is represented
by the ASCII string "000012ac"):
Test for this corner case by injecting "0x" prefixes into the uid, gid
and namesize cpio header fields. Confirm that init_stat() returns
matching uid and gid values.
This test can be modified in future to expect unpack_to_rootfs() failure
when header validation is changed to properly follow the specification.
Add some missing struct kstat initializations to account for possible
init_stat() failures.
Signed-off-by: David Disseldorp <ddiss@suse.de>
Link: https://patch.msgid.link/20260331070519.5974-3-ddiss@suse.de
Reviewed-by: Petr Mladek <pmladek@suse.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'scripts/stackusage')
0 files changed, 0 insertions, 0 deletions
