[PATCH] Fix decoding of get[ug]id, gete[ug]id and setfs[ug]id return values
Dmitry V. Levin
ldv at altlinux.org
Wed Jan 19 22:45:05 UTC 2011
On Thu, Jan 20, 2011 at 03:16:49AM +0500, Марк Коренберг wrote:
[...]
> There are more syscalls that never fail. For example, getpid, getppid,
> gettid, getpagesize
> It should be checked, but maybe all syscalls returning pid_t ?
pid_t values returned by getpid et al must be positive integers, otherwise
kill(-pid,sig) would not work. As result, there is no room for potential
collision as in getuid case.
> There are some VERY strange places in kernel. see getpriority / setpriority
> syscall about return value and errno
setpriority return code semantics is the same as in most of syscalls.
According to the comment in kernel/sys.c:getpriority, that syscall
also should not return negative values in case of an error.
So, I see no problem here.
> Also, it is desirable to add flag MAY_FAIL to destinguish between syscalls
> that may fail and syscalls for which we do not have information.
From strace point of view, looks like we need special treatment only
for those syscalls that may return non-error negative values.
--
ldv
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20110120/be6b6595/attachment.bin>
More information about the Strace-devel
mailing list