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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D51F1C433F5 for ; Tue, 14 Dec 2021 05:59:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=gARlweltusU/ZvzbkTk8VdZvMwMXrdhWT76Zk7AjEpQ=; b=dpRZeMuefTN1gA s5XwKTbDI0vpzMA/U5G+r1wHQ2b0pmf+zQNF3OkQA+3h/Wu9e8jlwdnVCwrbKaMdWAIsAC4XIIbMy rLkhqxWc5TcPTKI0M+VO7XxtjcWJt6qF1T2RiKO9TYmeUC2TSlAaTnlBnI0+mqExLuEgbABCu35b4 D+UCqgH13X0qurboGhFB02NjBj0OjHpNRoEKcIL72c440fPCp2pqvULYBLezlvQ7lQg963TfB37Hu Zu5h75tIHNu0G4nqWy2ETZiAqT6DDnmXVc+akKyeBArd0l8g7ryJle/1ByvVJyYTMq2mvyyV/V5j6 jM/C3YHmG6VSY9eD1btg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mx0pl-00CguZ-I9; Tue, 14 Dec 2021 05:58:41 +0000 Received: from mail-pj1-x1031.google.com ([2607:f8b0:4864:20::1031]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mx0pg-00Cgta-UQ for linux-arm-kernel@lists.infradead.org; Tue, 14 Dec 2021 05:58:38 +0000 Received: by mail-pj1-x1031.google.com with SMTP id k6-20020a17090a7f0600b001ad9d73b20bso15217463pjl.3 for ; Mon, 13 Dec 2021 21:58:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=uE8tm7fba5U6NBtNlVs+75ZMG9iOEUJb31FfCod84+w=; b=dCYD2p897oCg0sRe1lmek/4jFC+FOSIkEee2sTpRc6SP1ff9GiS90q8sDeKKlPfIdv 3QCeDPSWw+94OEan2cXREv4sAw+6KQQz931C9FZU1TDUN3fNL9eescfMg58gPsE217zK SFYD1ivheYnLXTjnTNXlKrSq29uEJc+EA9wDeokdKudFDT6fIPEHq4OlFtz+9Y2jvlEQ N0l4XWVXK8kMADWcFI+67iuusPs4K+GMdgMDyDA+HHm4zm3iuMqKzGhhY5xDDBxW9gpX kASBhlhS2jwJdgNex7uDYnU3gMeonWhCIATBNE6ICyaxGAsD5hqZyfUsqwV+s32wo0Rx ZHEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=uE8tm7fba5U6NBtNlVs+75ZMG9iOEUJb31FfCod84+w=; b=T8e2J0UTbOpzriBltfDai3VV75D+c32Kuxb6jA8bRXWs+k6dX10TIRyDcZke8+EEe8 StWcrLpN1sT4aBWMKsYb7b4h+XVlSNSE0H+OtjHZIzlcegUnif2XAXfVoZ1hJd6/eAN0 Gn+WxEdX3C4mPT5u1N+5FVYs2d3VRyVXDcqGZ2D3CtN6x2mJHEQ4zo68J89y2zZwRgp6 4aETEA4DaVREN8n7klQ6PmJM0dwoYWDg4RjKnIySt1/uJGm5P199DNek/oz3eKgCGSoG nPI6kVSdkH22YoGKZgV+OsJFbqDFQcSDeqFL/Z+5ZeqA+dsVigcxojO4ma7RFucrKyQc Mucw== X-Gm-Message-State: AOAM531/nZCk0j5REz+HbnEHy6bTy2piR4l3cVkl9evqb7BSQAzx/Khw YulQ3CWdcVpA8tl3pGE9mks= X-Google-Smtp-Source: ABdhPJw6AuSqH/TZUjqfvsk1KhigqT3WeS/B3avdSl+QZpNNsPQ1+e71qbUYWXziTJBd0aPeGSopHA== X-Received: by 2002:a17:90b:230c:: with SMTP id mt12mr3398651pjb.63.1639461516315; Mon, 13 Dec 2021 21:58:36 -0800 (PST) Received: from localhost ([110.141.142.237]) by smtp.gmail.com with ESMTPSA id nn4sm1071069pjb.38.2021.12.13.21.58.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Dec 2021 21:58:35 -0800 (PST) Date: Tue, 14 Dec 2021 16:58:32 +1100 From: Balbir Singh To: Leo Yan Cc: "David S. Miller" , Jakub Kicinski , Leon Romanovsky , Mathieu Poirier , Suzuki K Poulose , Mike Leach , Alexander Shishkin , Jan Harkes , coda@cs.cmu.edu, Paul Moore , Eric Paris , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, codalist@coda.cs.cmu.edu, linux-audit@redhat.com Subject: Re: [PATCH v2 4/7] connector/cn_proc: Use task_is_in_init_pid_ns() Message-ID: References: <20211208083320.472503-1-leo.yan@linaro.org> <20211208083320.472503-5-leo.yan@linaro.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20211208083320.472503-5-leo.yan@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211213_215837_023141_7B45429F X-CRM114-Status: GOOD ( 16.99 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Dec 08, 2021 at 04:33:17PM +0800, Leo Yan wrote: > This patch replaces open code with task_is_in_init_pid_ns() to check if > a task is in root PID namespace. > > Signed-off-by: Leo Yan > --- > drivers/connector/cn_proc.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/connector/cn_proc.c b/drivers/connector/cn_proc.c > index 646ad385e490..ccac1c453080 100644 > --- a/drivers/connector/cn_proc.c > +++ b/drivers/connector/cn_proc.c > @@ -358,7 +358,7 @@ static void cn_proc_mcast_ctl(struct cn_msg *msg, > * other namespaces. > */ > if ((current_user_ns() != &init_user_ns) || > - (task_active_pid_ns(current) != &init_pid_ns)) > + !task_is_in_init_pid_ns(current)) > return; > Sounds like there might scope for other wrappers - is_current_in_user_init_ns() Acked-by: Balbir Singh _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel