From patchwork Wed Sep 8 02:57:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 12479951 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=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 91041C4332F for ; Wed, 8 Sep 2021 02:57:38 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 43B9061152 for ; Wed, 8 Sep 2021 02:57:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 43B9061152 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id E2581940027; Tue, 7 Sep 2021 22:57:37 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id DD4FB900003; Tue, 7 Sep 2021 22:57:37 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CC458940027; Tue, 7 Sep 2021 22:57:37 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0103.hostedemail.com [216.40.44.103]) by kanga.kvack.org (Postfix) with ESMTP id B8A95900003 for ; Tue, 7 Sep 2021 22:57:37 -0400 (EDT) Received: from smtpin31.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 7C9F78249980 for ; Wed, 8 Sep 2021 02:57:37 +0000 (UTC) X-FDA: 78562895754.31.C406D2A Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf21.hostedemail.com (Postfix) with ESMTP id 38A64D02CD7B for ; Wed, 8 Sep 2021 02:57:37 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 430816113E; Wed, 8 Sep 2021 02:57:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1631069856; bh=tfpICs5z0lEvKDDCvoI+pAkQHw0+Ct8uwD4TFQiDhcI=; h=Date:From:To:Subject:In-Reply-To:From; b=yr7CXeHlH7xG0UDo4kE2IqafZjMthXlZyXDQyeW3dLT8BZhOBrdbmeH1WRNwwCiop YWBJMhyRLVwhrC8jEOrPnw6gr+Wje7Wxd1B8lVR72h/HUG6ZXz3yJ1VFsox0OqmMmY 8IDoSY+T97P+Q7vZ+822EBHP09uCIhbbMnZ6fzDo= Date: Tue, 07 Sep 2021 19:57:35 -0700 From: Andrew Morton To: adobriyan@gmail.com, akpm@linux-foundation.org, christian.brauner@ubuntu.com, davem@davemloft.net, ebiederm@xmission.com, linux-mm@kvack.org, mingo@kernel.org, mm-commits@vger.kernel.org, ohoono.kwon@samsung.com, torvalds@linux-foundation.org Subject: [patch 081/147] connector: send event on write to /proc/[pid]/comm Message-ID: <20210908025735.Cl8y9_Q3C%akpm@linux-foundation.org> In-Reply-To: <20210907195226.14b1d22a07c085b22968b933@linux-foundation.org> User-Agent: s-nail v14.8.16 Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=yr7CXeHl; spf=pass (imf21.hostedemail.com: domain of akpm@linux-foundation.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none X-Stat-Signature: kj6ectxbu464gxy58r1bcdry91tcjosf X-Rspamd-Queue-Id: 38A64D02CD7B X-Rspamd-Server: rspam04 X-HE-Tag: 1631069857-159261 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Ohhoon Kwon Subject: connector: send event on write to /proc/[pid]/comm 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. Link: https://lkml.kernel.org/r/20210701133458epcms1p68e9eb9bd0eee8903ba26679a37d9d960@epcms1p6 Signed-off-by: Ohhoon Kwon Cc: Ingo Molnar Cc: David S. Miller Cc: Christian Brauner Cc: Eric W. Biederman Cc: Alexey Dobriyan Signed-off-by: Andrew Morton --- fs/proc/base.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) --- a/fs/proc/base.c~connector-send-event-on-write-to-proc-comm +++ a/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 *f 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;