[PATCH v4 17/19] selftests/liveupdate: Test the targets of retrieved tmpfs files

sashiko-bot at kernel.org sashiko-bot at kernel.org
Wed Nov 11 16:31:30 PST 2026


Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] selftests/liveupdate: fd leak in start_exe() if second pipe2()
  fails
--

commit 98f191f06f9c7f70ee35d49607af5263f3c0db2b
Author: David Matlack <dmatlack at google.com>

selftests/liveupdate: Test the targets of retrieved tmpfs files

This commit adds test cases to luo_tmpfs verifying the requirements on the
target file into which a preserved tmpfs file is retrieved, including open
modes, file emptiness, filesystem type, immutability, unprivileged access,
and running binaries.

> diff --git a/tools/testing/selftests/liveupdate/luo_tmpfs.c b/tools/testing/selftests/liveupdate/luo_tmpfs.c
> index 91a607752ee28..2d6dd8f0e138a 100644
> --- a/tools/testing/selftests/liveupdate/luo_tmpfs.c
> +++ b/tools/testing/selftests/liveupdate/luo_tmpfs.c

[ ... ]

> +static int start_exe(const char *path, pid_t *pid)
> +{
> +	char *const argv[] = { (char *)path, EXEC_ARG, NULL };
> +	char *const envp[] = { NULL };
> +	unsigned char err = EIO;
> +	int in[2], out[2], status;
> +
> +	if (pipe2(in, O_CLOEXEC) || pipe2(out, O_CLOEXEC))
> +		return -errno;

[Severity: Low]
Does start_exe() leak in[0] and in[1] if pipe2(in, O_CLOEXEC) succeeds and
pipe2(out, O_CLOEXEC) fails?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261111002358.1842967-1-dmatlack@google.com?part=17



More information about the kexec mailing list