[LTP] [PATCH v5 12/14] fchroot11: test failfs entry with no_new_privs

Cyril Hrubis chrubis@suse.cz
Tue Oct 20 17:41:06 CEST 2026


Hi!
> +static void run(void)
> +{
> +	int status;
> +	pid_t pid;
> +
> +	if (SAFE_FORK())
> +		return;
> +
> +	SAFE_SETRESUID(ltpuser->pw_uid, ltpuser->pw_uid,
> +		ltpuser->pw_uid);
> +
> +	SAFE_PRCTL(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0);
> +
> +	pid = SAFE_FORK();
> +	if (!pid) {
> +		if (unshare(CLONE_NEWUSER) == -1)
> +			exit(1);
> +		return;

It would be a bit cleaner to do the unpriviledged user namespace
support probe in setup. But that is minor.

Reviewed-by: Cyril Hrubis <chrubis@suse.cz>

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list