Re: [PATCH RESEND] selftests/mm: Exit on invalid command-line options

From: Tianyi Chen

Date: Tue Sep 08 2026 - 07:05:01 EST


Thanks for pointing these out.

Unknown categories were not validated, and an explicitly empty -t
argument fell back to the default selection. A missing -t argument is
covered by getopts error handling. I have extended the first patch to
reject empty and unknown selections before setup, while preserving the
default behavior when -t is omitted. Validation uses the existing category
list in usage(), so there is no second category list to keep synchronized.

The ptrace_scope setup was indeed outside the category check. I have added
a separate patch to run it only when memfd_secret is selected and its
executable is present. The behavior when that test is selected is unchanged.

The v2 two-patch series and focused validation details are here:
https://lore.kernel.org/r/178886112560.138404.1278745290043112298.mm-cli-v2-0@xxxxxxxxx

The real mmap and memfd_secret tests passed in the guest. The configuration
write check used a disposable file at the sysctl path because that kernel
does not enable Yama; it verifies the script's gating, not Yama enforcement.

Thanks,
Tianyi