From: Michael Jeanson Date: Tue, 17 Dec 2019 17:11:11 +0000 (-0500) Subject: fix: use user ns wrapper code in new id trackers X-Git-Tag: v2.12.0-pre~2 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=608416e12e18b55329d670d6a02f0b895b6bff4f;p=lttng-modules.git fix: use user ns wrapper code in new id trackers These wrappers are required to translate kuid on kernels prior to v3.5. Signed-off-by: Michael Jeanson Signed-off-by: Mathieu Desnoyers --- diff --git a/probes/lttng-tracepoint-event-impl.h b/probes/lttng-tracepoint-event-impl.h index 39454fb3..321cdfa4 100644 --- a/probes/lttng-tracepoint-event-impl.h +++ b/probes/lttng-tracepoint-event-impl.h @@ -11,7 +11,6 @@ #include #include #include -#include #include #include @@ -20,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -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(<tng_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(<tng_dynamic_len_stack)->offset; \ __dynamic_len_idx = __orig_dynamic_len_offset; \