From: Nick Alcock Date: Thu, 7 May 2015 14:19:07 +0000 (+0100) Subject: dtrace: use the current user namespace for DIF_VAR_[UG]ID lookups X-Git-Tag: v4.1.12-111.0.20170907_2225~3^2~3^2~76 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=2a9ddcd2fabe06bc64a627431ef541946995d27b;p=users%2Fjedix%2Flinux-maple.git dtrace: use the current user namespace for DIF_VAR_[UG]ID lookups These lookups are not used for authentication, but rather are passed back to DTrace itself: it seems reasonable that in this case the user would expect them to be relative to the user namespace of the current process. Signed-off-by: Nick Alcock Acked-by: Kris Van Hees --- diff --git a/dtrace/dtrace_dif.c b/dtrace/dtrace_dif.c index 5d6468e8d9ddd..cb700dcf72e08 100644 --- a/dtrace/dtrace_dif.c +++ b/dtrace/dtrace_dif.c @@ -2286,7 +2286,8 @@ static uint64_t dtrace_dif_variable(dtrace_mstate_t *mstate, * Additionally, it is safe to dereference one's own process * credential, since this is never NULL after process birth. */ - return (uint64_t)from_kuid(NULL, current_real_cred()->uid); + return (uint64_t)from_kuid(current_user_ns(), + current_real_cred()->uid); case DIF_VAR_GID: if (!dtrace_priv_proc(state)) @@ -2299,7 +2300,8 @@ static uint64_t dtrace_dif_variable(dtrace_mstate_t *mstate, * Additionally, it is safe to dereference one's own process * credential, since this is never NULL after process birth. */ - return (uint64_t)from_kgid(NULL, current_real_cred()->gid); + return (uint64_t)from_kgid(current_user_ns(), + current_real_cred()->gid); case DIF_VAR_ERRNO: { int64_t arg0;