linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: 권오훈 <ohoono.kwon@samsung.com>
Cc: "mingo\@kernel.org" <mingo@kernel.org>,
	"davem\@davemloft.net" <davem@davemloft.net>,
	"christian.brauner\@ubuntu.com" <christian.brauner@ubuntu.com>,
	"akpm\@linux-foundation.org" <akpm@linux-foundation.org>,
	"ohkwon1043\@gmail.com" <ohkwon1043@gmail.com>,
	"linux-fsdevel\@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
	"linux-kernel\@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] connector: send event on write to /proc/[pid]/comm
Date: Thu, 01 Jul 2021 16:30:08 -0500	[thread overview]
Message-ID: <8735sxoh7j.fsf@disp2133> (raw)
In-Reply-To: <20210701133458epcms1p68e9eb9bd0eee8903ba26679a37d9d960@epcms1p6> (=?utf-8?B?Iuq2jOyYpO2biCIncw==?= message of "Thu, 01 Jul 2021 22:34:58 +0900")

권오훈 <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;

  reply	other threads:[~2021-07-01 21:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [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 [this message]
     [not found]   ` <CGME20210701133458epcms1p68e9eb9bd0eee8903ba26679a37d9d960@epcms1p2>
2021-07-08 12:23     ` 권오훈

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8735sxoh7j.fsf@disp2133 \
    --to=ebiederm@xmission.com \
    --cc=akpm@linux-foundation.org \
    --cc=christian.brauner@ubuntu.com \
    --cc=davem@davemloft.net \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=ohkwon1043@gmail.com \
    --cc=ohoono.kwon@samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).