Re: [PATCH] initramfs_test: exercise the oversized CPIO namesize guard

From: David Disseldorp

Date: Wed Nov 04 2026 - 06:08:36 EST


Hi,

On Tue, 27 Oct 2026 10:51:39 +0200, Avi Weiss wrote:

> initramfs_test_fname_path_max() uses a directory with a nonzero body.

Hmm, indeed, that doesn't make much sense.

> Such entries are skipped even without the namesize > PATH_MAX check,
> so the test does not detect removal of that check.

This is phrased a bit cryptically: the existing test *does* exercise
the name_len > PATH_MAX check, but you're right that removal of that
check would still see the the entry skipped due to the subsequent
if (S_ISREG(mode) || !body_len) filter.

> Use a regular file and terminate the archived pathname early after
> fill_cpio() has encoded the oversized namesize. This allows the test
> to detect a missing parser check without relying on VFS pathname
> length limits.

I don't think adding the early fname termination makes sense in the
context of the test.