lttng-dev.lists.lttng.org archive mirror
 help / color / mirror / Atom feed
* [PATCH lttng-modules] fix: use user ns wrapper code in new id trackers
       [not found] <20191217171111.6782-1-mjeanson@efficios.com>
@ 2019-12-17 17:11 ` Michael Jeanson
  2019-12-17 17:23 ` [PATCH lttng-modules] fix: function prototype in wrapper/mm.h Mathieu Desnoyers
       [not found] ` <20191217171111.6782-2-mjeanson@efficios.com>
  2 siblings, 0 replies; 3+ messages in thread
From: Michael Jeanson @ 2019-12-17 17:11 UTC (permalink / raw)
  To: lttng-dev

These wrappers are required to translate kuid on kernels prior to v3.5.

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
---
 probes/lttng-tracepoint-event-impl.h | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/probes/lttng-tracepoint-event-impl.h b/probes/lttng-tracepoint-event-impl.h
index 39454fb..321cdfa 100644
--- a/probes/lttng-tracepoint-event-impl.h
+++ b/probes/lttng-tracepoint-event-impl.h
@@ -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;			      \
-- 
2.17.1

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH lttng-modules] fix: function prototype in wrapper/mm.h
       [not found] <20191217171111.6782-1-mjeanson@efficios.com>
  2019-12-17 17:11 ` [PATCH lttng-modules] fix: use user ns wrapper code in new id trackers Michael Jeanson
@ 2019-12-17 17:23 ` Mathieu Desnoyers
       [not found] ` <20191217171111.6782-2-mjeanson@efficios.com>
  2 siblings, 0 replies; 3+ messages in thread
From: Mathieu Desnoyers @ 2019-12-17 17:23 UTC (permalink / raw)
  To: Michael Jeanson; +Cc: lttng-dev

Merged into master, 2.11, 2.10, thanks!

Mathieu

----- On Dec 17, 2019, at 12:11 PM, Michael Jeanson mjeanson@efficios.com wrote:

> Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
> ---
> wrapper/mm.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/wrapper/mm.h b/wrapper/mm.h
> index 672855b..405248a 100644
> --- a/wrapper/mm.h
> +++ b/wrapper/mm.h
> @@ -62,7 +62,7 @@ void wrapper_set_current_oom_origin(void)
> }
> 
> static inline
> -void wrapper_clear_current_oom_origin()
> +void wrapper_clear_current_oom_origin(void)
> {
> 	return;
> }
> --
> 2.17.1

-- 
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH lttng-modules] fix: use user ns wrapper code in new id trackers
       [not found] ` <20191217171111.6782-2-mjeanson@efficios.com>
@ 2019-12-17 17:23   ` Mathieu Desnoyers
  0 siblings, 0 replies; 3+ messages in thread
From: Mathieu Desnoyers @ 2019-12-17 17:23 UTC (permalink / raw)
  To: Michael Jeanson; +Cc: lttng-dev

Merged into master, thanks!

Mathieu

----- On Dec 17, 2019, at 12:11 PM, Michael Jeanson mjeanson@efficios.com wrote:

> These wrappers are required to translate kuid on kernels prior to v3.5.
> 
> Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
> ---
> probes/lttng-tracepoint-event-impl.h | 18 +++++++++---------
> 1 file changed, 9 insertions(+), 9 deletions(-)
> 
> diff --git a/probes/lttng-tracepoint-event-impl.h
> b/probes/lttng-tracepoint-event-impl.h
> index 39454fb..321cdfa 100644
> --- a/probes/lttng-tracepoint-event-impl.h
> +++ b/probes/lttng-tracepoint-event-impl.h
> @@ -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;			      \
> --
> 2.17.1

-- 
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-12-17 17:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20191217171111.6782-1-mjeanson@efficios.com>
2019-12-17 17:11 ` [PATCH lttng-modules] fix: use user ns wrapper code in new id trackers Michael Jeanson
2019-12-17 17:23 ` [PATCH lttng-modules] fix: function prototype in wrapper/mm.h Mathieu Desnoyers
     [not found] ` <20191217171111.6782-2-mjeanson@efficios.com>
2019-12-17 17:23   ` [PATCH lttng-modules] fix: use user ns wrapper code in new id trackers Mathieu Desnoyers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).