From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAD_ENC_HEADER,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7248EC11F6A for ; Thu, 1 Jul 2021 21:30:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 507C66140E for ; Thu, 1 Jul 2021 21:30:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234342AbhGAVcu convert rfc822-to-8bit (ORCPT ); Thu, 1 Jul 2021 17:32:50 -0400 Received: from out02.mta.xmission.com ([166.70.13.232]:56374 "EHLO out02.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229934AbhGAVct (ORCPT ); Thu, 1 Jul 2021 17:32:49 -0400 Received: from in02.mta.xmission.com ([166.70.13.52]) by out02.mta.xmission.com with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1lz4GH-00CpMw-6s; Thu, 01 Jul 2021 15:30:17 -0600 Received: from ip68-227-160-95.om.om.cox.net ([68.227.160.95]:51248 helo=email.xmission.com) by in02.mta.xmission.com with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1lz4GG-00BSx2-16; Thu, 01 Jul 2021 15:30:16 -0600 From: ebiederm@xmission.com (Eric W. Biederman) To: =?utf-8?B?6raM7Jik7ZuI?= Cc: "mingo\@kernel.org" , "davem\@davemloft.net" , "christian.brauner\@ubuntu.com" , "akpm\@linux-foundation.org" , "ohkwon1043\@gmail.com" , "linux-fsdevel\@vger.kernel.org" , "linux-kernel\@vger.kernel.org" References: <20210701133458epcms1p68e9eb9bd0eee8903ba26679a37d9d960@epcms1p6> Date: Thu, 01 Jul 2021 16:30:08 -0500 In-Reply-To: <20210701133458epcms1p68e9eb9bd0eee8903ba26679a37d9d960@epcms1p6> (=?utf-8?B?Iuq2jOyYpO2biCIncw==?= message of "Thu, 01 Jul 2021 22:34:58 +0900") Message-ID: <8735sxoh7j.fsf@disp2133> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT X-XM-SPF: eid=1lz4GG-00BSx2-16;;;mid=<8735sxoh7j.fsf@disp2133>;;;hst=in02.mta.xmission.com;;;ip=68.227.160.95;;;frm=ebiederm@xmission.com;;;spf=neutral X-XM-AID: U2FsdGVkX1+smKkMX3KmnngliXe32SDrbemFpTMFVKU= X-SA-Exim-Connect-IP: 68.227.160.95 X-SA-Exim-Mail-From: ebiederm@xmission.com Subject: Re: [PATCH] connector: send event on write to /proc/[pid]/comm X-SA-Exim-Version: 4.2.1 (built Sat, 08 Feb 2020 21:53:50 +0000) X-SA-Exim-Scanned: Yes (on in02.mta.xmission.com) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 권오훈 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 > --- > 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 > #include > #include > +#include > #include > #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;