]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
dtrace: no longer expose kuid_t in the userspace dtrace API
authorNick Alcock <nick.alcock@oracle.com>
Fri, 10 Apr 2015 23:00:04 +0000 (00:00 +0100)
committerKris Van Hees <kris.van.hees@oracle.com>
Mon, 20 Apr 2015 08:11:23 +0000 (04:11 -0400)
The public header installed as <linux/dtrace/stability.h> exposed
<linux/uidgid.h> to userspace as part of the dtrace_ppriv_t.dtpp_uid member.
This member (used for unprivileged tracing) is part of a facility that is not
yet ported, but using a kuid_t for this is clearly wrong, and as of kernel 4.0
won't compile when used in userspace either.

Fix by migrating to a uid_t and converting it to a kuid at the point of use.

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

index 7efd7f48abaddc810793dc2b3dc65c1cf3c5ea11..b9dccfcce1002560275e80bbed8145420e4f5928 100644 (file)
@@ -46,7 +46,7 @@ int dtrace_match_priv(const dtrace_probe_t *prp, uint32_t priv, kuid_t uid)
                        return 0;
 
                if (((ppriv & ~match) & DTRACE_PRIV_OWNER) != 0 &&
-                   !uid_eq(uid, prp->dtpr_provider->dtpv_priv.dtpp_uid))
+                   !uid_eq(uid, make_kuid(NULL, prp->dtpr_provider->dtpv_priv.dtpp_uid)))
                        return 0;
        }
 
index 53721b8ecbb5a6d1847bc97874d519da1d697cc5..cf19589c88f4412d1b8b6ef0cef79bd2d77ff9a1 100644 (file)
@@ -204,7 +204,7 @@ int dtrace_register(const char *name, const dtrace_pattr_t *pap, uint32_t priv,
 
        if (cr != NULL) {
                provider->dtpv_priv.dtpp_uid =
-                       make_kuid(NULL, from_kuid(NULL, get_cred(cr)->uid));
+                       from_kuid(NULL, get_cred(cr)->uid);
                put_cred(cr);
        }
 
index 7427f1ee3e5a3e767c5a591f4f01f0d56f62c81b..9b9eb142dcc8ec0c1fddb9920b8135f9eb8bf2d7 100644 (file)
@@ -32,7 +32,6 @@
  * Use is subject to license terms.
  */
 
-#include <linux/uidgid.h>
 #include <linux/dtrace/universal.h>
 #include <linux/dtrace/stability_defines.h>
 
@@ -45,7 +44,7 @@
 
 typedef struct dtrace_ppriv {
        uint32_t dtpp_flags;                    /* privilege flags */
-       kuid_t dtpp_uid;                        /* user ID */
+       uid_t dtpp_uid;                         /* user ID */
 } dtrace_ppriv_t;
 
 typedef struct dtrace_attribute {