All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] connector: send event on write to /proc/[pid]/comm
       [not found] <CGME20210701133458epcms1p68e9eb9bd0eee8903ba26679a37d9d960@epcms1p6>
@ 2021-07-01 13:34 ` 권오훈
  2021-07-01 21:30   ` Eric W. Biederman
       [not found]   ` <CGME20210701133458epcms1p68e9eb9bd0eee8903ba26679a37d9d960@epcms1p2>
  0 siblings, 2 replies; 3+ messages in thread
From: 권오훈 @ 2021-07-01 13:34 UTC (permalink / raw)
  To: mingo, davem, christian.brauner, akpm, ebiederm
  Cc: 권오훈, ohkwon1043, linux-fsdevel, linux-kernel

While comm change event via prctl has been reported to proc connector by
'commit f786ecba4158 ("connector: add comm change event report to proc
connector")', connector listeners were missing comm changes by explicit
writes on /proc/[pid]/comm.

Let explicit writes on /proc/[pid]/comm report to proc connector.

Signed-off-by: Ohhoon Kwon <ohoono.kwon@samsung.com>
---
 fs/proc/base.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/fs/proc/base.c b/fs/proc/base.c
index 9cbd915025ad..3e1e6b56aa96 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -95,6 +95,7 @@
 #include <linux/posix-timers.h>
 #include <linux/time_namespace.h>
 #include <linux/resctrl.h>
+#include <linux/cn_proc.h>
 #include <trace/events/oom.h>
 #include "internal.h"
 #include "fd.h"
@@ -1674,8 +1675,10 @@ static ssize_t comm_write(struct file *file, const char __user *buf,
 	if (!p)
 		return -ESRCH;
 
-	if (same_thread_group(current, p))
+	if (same_thread_group(current, p)) {
 		set_task_comm(p, buffer);
+		proc_comm_connector(p);
+	}
 	else
 		count = -EINVAL;
 
-- 
2.17.1

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

* Re: [PATCH] connector: send event on write to /proc/[pid]/comm
  2021-07-01 13:34 ` [PATCH] connector: send event on write to /proc/[pid]/comm 권오훈
@ 2021-07-01 21:30   ` Eric W. Biederman
       [not found]   ` <CGME20210701133458epcms1p68e9eb9bd0eee8903ba26679a37d9d960@epcms1p2>
  1 sibling, 0 replies; 3+ messages in thread
From: Eric W. Biederman @ 2021-07-01 21:30 UTC (permalink / raw)
  To: 권오훈
  Cc: mingo, davem, christian.brauner, akpm, ohkwon1043, linux-fsdevel,
	linux-kernel

권오훈 <ohoono.kwon@samsung.com> writes:

> While comm change event via prctl has been reported to proc connector by
> 'commit f786ecba4158 ("connector: add comm change event report to proc
> connector")', connector listeners were missing comm changes by explicit
> writes on /proc/[pid]/comm.
>
> Let explicit writes on /proc/[pid]/comm report to proc connector.

Is connector really useful?  I am under the impression that connector
did not get much if any real uptake of users.

I know the impression that connector is not used and that there
are generally better mechanisms for what it provides has led to
connector not getting any namespace support.  Similarly bugs
like the one you just have found persist.

If connector is actually useful then it is worth fixing little things
like this.  But if no one is really using connector I suspect a better
patch direction would be to start figuring out how to deprecate and
remove connector.

Eric


> Signed-off-by: Ohhoon Kwon <ohoono.kwon@samsung.com>
> ---
>  fs/proc/base.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/fs/proc/base.c b/fs/proc/base.c
> index 9cbd915025ad..3e1e6b56aa96 100644
> --- a/fs/proc/base.c
> +++ b/fs/proc/base.c
> @@ -95,6 +95,7 @@
>  #include <linux/posix-timers.h>
>  #include <linux/time_namespace.h>
>  #include <linux/resctrl.h>
> +#include <linux/cn_proc.h>
>  #include <trace/events/oom.h>
>  #include "internal.h"
>  #include "fd.h"
> @@ -1674,8 +1675,10 @@ static ssize_t comm_write(struct file *file, const char __user *buf,
>  	if (!p)
>  		return -ESRCH;
>  
> -	if (same_thread_group(current, p))
> +	if (same_thread_group(current, p)) {
>  		set_task_comm(p, buffer);
> +		proc_comm_connector(p);
> +	}
>  	else
>  		count = -EINVAL;

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

* RE: [PATCH] connector: send event on write to /proc/[pid]/comm
       [not found]   ` <CGME20210701133458epcms1p68e9eb9bd0eee8903ba26679a37d9d960@epcms1p2>
@ 2021-07-08 12:23     ` 권오훈
  0 siblings, 0 replies; 3+ messages in thread
From: 권오훈 @ 2021-07-08 12:23 UTC (permalink / raw)
  To: Eric W. Biederman, 권오훈
  Cc: mingo, davem, christian.brauner, akpm, ohkwon1043, linux-fsdevel,
	linux-kernel

Eric W. Biederman <ebiederm@xmission.com> writes: 
> 권오훈 <ohoono.kwon@samsung.com> writes:
> > 
> > > While comm change event via prctl has been reported to proc connector by
> > 'commit f786ecba4158 ("connector: add comm change event report to proc
> > connector")', connector listeners were missing comm changes by explicit
> > writes on /proc/[pid]/comm.
> >
> > Let explicit writes on /proc/[pid]/comm report to proc connector.
> 
> Is connector really useful?  I am under the impression that connector
> did not get much if any real uptake of users.
> 
> I know the impression that connector is not used and that there
> are generally better mechanisms for what it provides has led to
> connector not getting any namespace support.  Similarly bugs
> like the one you just have found persist.
> 
> If connector is actually useful then it is worth fixing little things
> like this.  But if no one is really using connector I suspect a better
> patch direction would be to start figuring out how to deprecate and
> remove connector.
> 
> Eric

Dear Eric.

I get your point, and I can also see that /drivers/connector directory has
not been modified since last December, which might imply that not so many
users are actively paying attention to the connector.

However in Samsung, we are currently using connector feature for our
proprietary solution, which uses it to receive kernel events such as fork,
exec, and comm changes at userspace daemon.

Since I am new to patching linux kernel, I cannot say much about whether
connector should be deprecated or not. I guess it is up to all of you guys
who have contributed to the connector driver to discuss and decide.

Meanwhile, I still think bugfixes should be applied until the feature is
actually decided to be deprecated.

Thanks,
Ohhoon Kwon.

> 
> 
> > Signed-off-by: Ohhoon Kwon <ohoono.kwon@samsung.com>
> > ---
> >  fs/proc/base.c | 5 ++++-
> >  1 file changed, 4 insertions(+), 1 deletion(-)
> >
> > diff --git a/fs/proc/base.c b/fs/proc/base.c
> > index 9cbd915025ad..3e1e6b56aa96 100644
> > --- a/fs/proc/base.c
> > +++ b/fs/proc/base.c
> > @@ -95,6 +95,7 @@
> >  #include <linux/posix-timers.h>
> >  #include <linux/time_namespace.h>
> >  #include <linux/resctrl.h>
> > +#include <linux/cn_proc.h>
> >  #include <trace/events/oom.h>
> >  #include "internal.h"
> >  #include "fd.h"
> > @@ -1674,8 +1675,10 @@ static ssize_t comm_write(struct file *file, const char __user *buf,
> >  	if (!p)
> >  		return -ESRCH;
> >  
> > -	if (same_thread_group(current, p))
> > +	if (same_thread_group(current, p)) {
> >  		set_task_comm(p, buffer);
> > +		proc_comm_connector(p);
> > +	}
> >  	else
> >  		count = -EINVAL;



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

end of thread, other threads:[~2021-07-08 12:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20210701133458epcms1p68e9eb9bd0eee8903ba26679a37d9d960@epcms1p6>
2021-07-01 13:34 ` [PATCH] connector: send event on write to /proc/[pid]/comm 권오훈
2021-07-01 21:30   ` Eric W. Biederman
     [not found]   ` <CGME20210701133458epcms1p68e9eb9bd0eee8903ba26679a37d9d960@epcms1p2>
2021-07-08 12:23     ` 권오훈

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.