[PATCH v4 02/10] tests/inject-nf.test: replace getpid with geteuid
Dmitry V. Levin
ldv at altlinux.org
Sun Jun 14 23:37:18 UTC 2020
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.
--
ldv
More information about the Strace-devel
mailing list