Message ID | 20211205145105.57824-7-leo.yan@linaro.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org> 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 5D5A0C433EF for <linux-arm-kernel@archiver.kernel.org>; Sun, 5 Dec 2021 14:53:50 +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:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=L8mxMNDMMkP9czxTO0O+qCyaf8a89GRSynIbNpOE3IA=; b=UUC5/bTUEzkbEM Z9LcnVur5zEQtSOGl5er63ds2L3v0BMc3OFIzKpcyUPJ5HqtHII2D8aM4LRdVPMN6HAQ1FaHBpl++ AAznM/m8+X4Ep3Vv8o+mtGqMQmKzRjkbFaabG1KQnJEv6ffpwKTw6aoJsw6BtaVWUoUdIGZ5d18ie pI7JWTBwRFZ4bctJ7uky83mQEbL/PI5rAI8cE8xPlzuBDTiiVmrbi0135G8Pi/H6t0pLBC5u8+zhz 5dh6JrHa0uAI7Ju9SkctsDKHZDLEnKIEIVXQ+7R5vF7Su76coVikeW1IUAZT2ImOAiJiPfSKkBvMv H1G7jRyAWPq0kMTmfTmQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mtssO-001YQX-SV; Sun, 05 Dec 2021 14:52:29 +0000 Received: from mail-pf1-x432.google.com ([2607:f8b0:4864:20::432]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mtsrd-001YBg-1M for linux-arm-kernel@lists.infradead.org; Sun, 05 Dec 2021 14:51:42 +0000 Received: by mail-pf1-x432.google.com with SMTP id 8so7754916pfo.4 for <linux-arm-kernel@lists.infradead.org>; Sun, 05 Dec 2021 06:51:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=h3YljNelpLYurDb9qdET1+BdmKMP449z9py0Gh1sNcI=; b=KlyrDEascSedjmQ6m/eg0D7PY7G612B3EmrP1NscQ4eGbJj037PV8M1Zqtheb9+iwj AviQ0zImdyacEmnQoGcfHQmj9rgspgyCDSljp3SbLn0a0kITqDiFzACuqlNquyDB/aUq khC6D78Hlm54RUCVwrvYwn0QGePXwTgubI6CFc0WGrFzMvEUKJkXe6sgWprCQRTyf1KQ 2g1KWGPY0eLViCDSUZQkV901Iumk+ZRnoCmGC/XEgkCxoLsB/3eeoAxIw0d2HY2OvASB SNScQOEdxWI1dMoWQRQcwl68nHAENfYelEVYRK/JoIVvYToujYdjoYkhfPFsXxisz391 heFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=h3YljNelpLYurDb9qdET1+BdmKMP449z9py0Gh1sNcI=; b=Cv9cdaOnkqySzTDzcwaCv0pxe14KkBk9+wWppJviJ2pBue/g1xaBG6F1RzpxYURvGY 95w1fyTSjFod4NNY0pF6HK7kfh+uLQsss0CJZ0FpwcL2yEV6lJNtEjHNnz8/AF/AYIME hOWaZwn9z8bIplxzMIlF5bykV5zPZpfE0r62fGjgJUCc03QVPkDhGZj6b6Ox5yM2MZkZ KYK5stDjzMXHtG8sB0h8YgPSdVpjAz8XmJyT+fM6nDycvQIUO6BpYX0zHOUtPpbUGvC+ apNbYwGlirixzWpgrZx7PSki7J2WD4vg0HH95hkTbOvP6cgeelvGHG7EiJQbvGOfV4bD /m+w== X-Gm-Message-State: AOAM5323Zl766KMIOpihfbivEd+h8WGMtwEvoAzmKM/JLjqf5wHfzhHM YL7wUKJ47WQ1s1IpJibcuRwVyw== X-Google-Smtp-Source: ABdhPJw/kut7WA2CgtIMvPTxsWYwUnt4uJMZW1REaKKpU+Wjg8UkgeddhtYG0nXWVQme7QOqSE/rLg== X-Received: by 2002:a05:6a00:1248:b0:4a2:5cba:89cb with SMTP id u8-20020a056a00124800b004a25cba89cbmr31642944pfi.12.1638715900203; Sun, 05 Dec 2021 06:51:40 -0800 (PST) Received: from localhost ([2602:feda:dd6:6166:ad52:d50b:8700:3c60]) by smtp.gmail.com with ESMTPSA id y130sm8967440pfg.202.2021.12.05.06.51.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Dec 2021 06:51:39 -0800 (PST) From: Leo Yan <leo.yan@linaro.org> To: "David S. Miller" <davem@davemloft.net>, Jakub Kicinski <kuba@kernel.org>, Mathieu Poirier <mathieu.poirier@linaro.org>, Suzuki K Poulose <suzuki.poulose@arm.com>, Mike Leach <mike.leach@linaro.org>, Alexander Shishkin <alexander.shishkin@linux.intel.com>, Jan Harkes <jaharkes@cs.cmu.edu>, coda@cs.cmu.edu, Paul Moore <paul@paul-moore.com>, Eric Paris <eparis@redhat.com>, Balbir Singh <bsingharora@gmail.com>, 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 Cc: Leo Yan <leo.yan@linaro.org> Subject: [PATCH v1 6/7] audit: Use task_is_in_root_ns() Date: Sun, 5 Dec 2021 22:51:04 +0800 Message-Id: <20211205145105.57824-7-leo.yan@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211205145105.57824-1-leo.yan@linaro.org> References: <20211205145105.57824-1-leo.yan@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211205_065141_101499_C4CD7962 X-CRM114-Status: GOOD ( 11.70 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org |
Series |
pid: Introduce helper task_is_in_root_ns()
|
expand
|
diff --git a/kernel/audit.c b/kernel/audit.c index 121d37e700a6..c71d4182c05d 100644 --- a/kernel/audit.c +++ b/kernel/audit.c @@ -1034,7 +1034,7 @@ static int audit_netlink_ok(struct sk_buff *skb, u16 msg_type) case AUDIT_MAKE_EQUIV: /* Only support auditd and auditctl in initial pid namespace * for now. */ - if (task_active_pid_ns(current) != &init_pid_ns) + if (!task_is_in_root_ns(current)) return -EPERM; if (!netlink_capable(skb, CAP_AUDIT_CONTROL))
Replace open coded checking root PID namespace with task_is_in_root_ns(). Signed-off-by: Leo Yan <leo.yan@linaro.org> --- kernel/audit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)