]> www.infradead.org Git - users/jedix/linux-maple.git/commit
dtrace: use the initial user namespace in suitable {from,make}_kuid() calls
authorNick Alcock <nick.alcock@oracle.com>
Fri, 8 May 2015 13:20:37 +0000 (14:20 +0100)
committerKris Van Hees <kris.van.hees@oracle.com>
Tue, 21 Jul 2015 06:51:24 +0000 (02:51 -0400)
commit429593d67da5ad978317cbb340a7fab0b4c8c5d8
tree63136b20e43cb89aa6ce9c7e190aafbf6618591d
parent2a9ddcd2fabe06bc64a627431ef541946995d27b
dtrace: use the initial user namespace in suitable {from,make}_kuid() calls

There are several places in DTrace (mostly related to privileged or destructive
operations or unprivileged tracing) where we try to compare uids for equality,
thus need to convert them from or to kuid_ts so we can do that.  We want to look
in the initial user namespace for this (since it is only in that namespace that
all uids on the system are unambiguous).  We were doing this by passing a NULL
to from_kuid() / make_kuid(), but in the presence of CONFIG_USER_NS this results
in dereferencing a null pointer.

So acquire the initial user namespace from a temporary kernel-thread creds
structure, and use it in all such places.

Signed-off-by: Nick Alcock <nick.alcock@oracle.com>
Acked-by: Kris Van Hees <kris.van.hees@oracle.com>
dtrace/dtrace_dev.c
dtrace/dtrace_match.c
dtrace/dtrace_probe.c
dtrace/dtrace_ptofapi.c
dtrace/include/dtrace/dtrace_impl.h