Skip to content

Commit abfa939

Browse files
committed
Do not truncate return value of get{,e}[ug]id and setfs[ug]id syscalls
This should not be a user visible change unless the kernel does something completely unexpected. In the latter case, let user see what is going on. * uid.c (SYS_FUNC(getuid), SYS_FUNC(setfsuid)): Do not truncate tcp->u_rval to uid_t on exiting syscall, return RVAL_DECODED.
1 parent 727508b commit abfa939

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

uid.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,18 +70,15 @@
7070

7171
SYS_FUNC(getuid)
7272
{
73-
if (exiting(tcp))
74-
tcp->u_rval = (uid_t) tcp->u_rval;
75-
return RVAL_UDECIMAL;
73+
return RVAL_UDECIMAL | RVAL_DECODED;
7674
}
7775

7876
SYS_FUNC(setfsuid)
7977
{
8078
if (entering(tcp))
8179
tprintf("%u", (uid_t) tcp->u_arg[0]);
82-
else
83-
tcp->u_rval = (uid_t) tcp->u_rval;
84-
return RVAL_UDECIMAL;
80+
81+
return RVAL_UDECIMAL | RVAL_DECODED;
8582
}
8683

8784
SYS_FUNC(setuid)

0 commit comments

Comments
 (0)