[LTP] [PATCH 4/7] syscalls/kill05: Use any two unprivileged users

Cyril Hrubis chrubis@suse.cz
Mon Sep 6 15:02:04 CEST 2021


Hi!
> > We could just use UID 1 and 2 for this test but I'd rather not assume
> > that set*uid() functions allow setting unused UIDs. Even if it works
> > now, it could easily break in the future or on some special system auth
> > backends.
> 
> Don't we already depend on being able to use unused GID? How is this
> different?

Hmm we pass the unused GID mostly to chown(), but still.

The Linux manual page specify that setuid() may fail to change if
the UID is not valid inside a namespace, that means that either there is
no UID map or particular UID is missing from the UID map. So reading
/etc/passwd hypotetically help if we are inside of a thight container
and /etc/passwd matches the UID map, but I'm not sure if this is worth
of the effort.

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list