fix: use user ns wrapper code in new id trackers
authorMichael Jeanson <mjeanson@efficios.com>
Tue, 17 Dec 2019 17:11:11 +0000 (12:11 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 17 Dec 2019 17:22:10 +0000 (12:22 -0500)
These wrappers are required to translate kuid on kernels prior to v3.5.

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
probes/lttng-tracepoint-event-impl.h

index 39454fb3d9c13d68fc4648aa135a1aacd224bb80..321cdfa44c61afac7d79c857e4655bf47cc98737 100644 (file)
@@ -11,7 +11,6 @@
 #include <linux/rculist.h>
 #include <asm/byteorder.h>
 #include <linux/swab.h>
-#include <linux/uidgid.h>
 
 #include <probes/lttng.h>
 #include <probes/lttng-types.h>
@@ -20,6 +19,7 @@
 #include <wrapper/ringbuffer/frontend_types.h>
 #include <wrapper/ringbuffer/backend.h>
 #include <wrapper/rcu.h>
+#include <wrapper/user_namespace.h>
 #include <lttng-events.h>
 #include <lttng-tracer-core.h>
 #include <lttng-tp-mempool.h>
@@ -1146,19 +1146,19 @@ static void __event_probe__##_name(void *__data, _proto)                      \
                return;                                                       \
        __lf = lttng_rcu_dereference(__session->uid_tracker.p);               \
        if (__lf && likely(!lttng_id_tracker_lookup(__lf,                     \
-                       from_kuid(&init_user_ns, current_uid()))))            \
+                       lttng_current_uid())))                                \
                return;                                                       \
        __lf = lttng_rcu_dereference(__session->vuid_tracker.p);              \
        if (__lf && likely(!lttng_id_tracker_lookup(__lf,                     \
-                       from_kuid(current_user_ns(), current_uid()))))        \
+                       lttng_current_vuid())))                               \
                return;                                                       \
        __lf = lttng_rcu_dereference(__session->gid_tracker.p);               \
        if (__lf && likely(!lttng_id_tracker_lookup(__lf,                     \
-                       from_kgid(&init_user_ns, current_gid()))))            \
+                       lttng_current_gid())))                                \
                return;                                                       \
        __lf = lttng_rcu_dereference(__session->vgid_tracker.p);              \
        if (__lf && likely(!lttng_id_tracker_lookup(__lf,                     \
-                       from_kgid(current_user_ns(), current_gid()))))        \
+                       lttng_current_vgid())))                               \
                return;                                                       \
        __orig_dynamic_len_offset = this_cpu_ptr(&lttng_dynamic_len_stack)->offset; \
        __dynamic_len_idx = __orig_dynamic_len_offset;                        \
@@ -1239,19 +1239,19 @@ static void __event_probe__##_name(void *__data)                              \
                return;                                                       \
        __lf = lttng_rcu_dereference(__session->uid_tracker.p);               \
        if (__lf && likely(!lttng_id_tracker_lookup(__lf,                     \
-                       from_kuid(&init_user_ns, current_uid()))))            \
+                       lttng_current_uid())))                                \
                return;                                                       \
        __lf = lttng_rcu_dereference(__session->vuid_tracker.p);              \
        if (__lf && likely(!lttng_id_tracker_lookup(__lf,                     \
-                       from_kuid(current_user_ns(), current_uid()))))        \
+                       lttng_current_vuid())))                               \
                return;                                                       \
        __lf = lttng_rcu_dereference(__session->gid_tracker.p);               \
        if (__lf && likely(!lttng_id_tracker_lookup(__lf,                     \
-                       from_kgid(&init_user_ns, current_gid()))))            \
+                       lttng_current_gid())))                                \
                return;                                                       \
        __lf = lttng_rcu_dereference(__session->vgid_tracker.p);              \
        if (__lf && likely(!lttng_id_tracker_lookup(__lf,                     \
-                       from_kgid(current_user_ns(), current_gid()))))        \
+                       lttng_current_vgid())))                               \
                return;                                                       \
        __orig_dynamic_len_offset = this_cpu_ptr(&lttng_dynamic_len_stack)->offset; \
        __dynamic_len_idx = __orig_dynamic_len_offset;                        \
This page took 0.028969 seconds and 4 git commands to generate.