[PATCH v4 02/10] tests/inject-nf.test: replace getpid with geteuid

Dmitry V. Levin ldv at altlinux.org
Mon Jun 15 15:45:18 UTC 2020


On Mon, Jun 15, 2020 at 03:01:43PM +0200, Ákos Uzonyi wrote:
> On Mon, 15 Jun 2020 at 01:37, Dmitry V. Levin <ldv at altlinux.org> wrote:
> > On Sat, Jun 13, 2020 at 06:18:29PM +0200, Ákos Uzonyi wrote:
> > > Since we treat PIDs as signed integers, large values (>=2^31) will
> > > cause overflow when we use printpid.
> > > UIDs are treated as unsigned integers, so geteuid is a good alternative.
> > > (getuid would be problematic, as it does not exists on alpha).
> >
> > No, this approach doesn't work because
> > $ cat /proc/sys/kernel/overflowuid
> > 65534
> > $ ./inject-nf
> > expected 0x25bd0, got rval=0xfffe err=0
> >
> > See also tests/overflowuid.c file.
> 
> Sorry, I don't understand why overflowuid is significant here.

geteuid syscall is affected by overflowuid on such architectures
as x86 where geteuid32 syscall exists.


-- 
ldv


More information about the Strace-devel mailing list