Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1736053ybv; Thu, 6 Feb 2020 08:56:55 -0800 (PST) X-Google-Smtp-Source: APXvYqxO7MbcRbczz7q47xWdyJPOU0igU2mQr1l+ZyDnoZ/54Qd5+aDYglAv375pCfGw80lje4S7 X-Received: by 2002:a9d:f26:: with SMTP id 35mr30020726ott.31.1581008214975; Thu, 06 Feb 2020 08:56:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581008214; cv=none; d=google.com; s=arc-20160816; b=kTTOQHV5oQV/u1eSRj4y6IWHxfr7jx4llcJIrDWmsB+sc5HidpWx27FqgFUpnfiy2k SzhLV1wxY9P3da+LyD+FbX9gcG5WnvAy+hyYLtBYFu32tle/DqEZYH1gaQ3CKHvHkRcZ ipnqXdxkp7vHxQghxDJjaxN1vW9UTGTj3zUHF4mPexs7MoEzGEHW6pzW69ZT+pHgDHmK rbNZLr8vy0+ZhAHGHHnPjoU2O4BEsSTxTZkJsNb3ju7laurrr4LraHgpICgeCqvtO4TN PpaUO0MY1K74pHSM+sGtUjFQBq/mKPEsH7Xat6ezoRTDqIP7pEMfjBRO53u24u5vQSoU XznA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:from:subject:mime-version :message-id:date:dkim-signature; bh=c8SLYwNN21iArK53Veq5gkGT51jTwqTXEnO7G5w7whE=; b=BkLnyYgF9qFWRdTzMmZ+n6L7cRmr55Ec5y+vPRQqiO14SSdviWb1N0ICXpH0XZnHZ4 OVW4HjvGwK7plWrRv9kphA4BR23VaGxt7a/1aw+hq49kXHHoNufgGTFiH0Z+b4IQR2Nr i+2k/zRqHR6EeWs17jBE2PyDJu0qNOd4cAPH8HsRVjjWmUKmsbZ460QLo60JjOMV9i3D A1GQI5mXatLqMx7HwNoA9bzh5IC6Gqygh2m97ZIB5kE5V4GHmMZRqPdZ6L3ddc1gk6xt L5/V45i9XfqPXkRbp4tv1Ghf8PXbg/RG56pbqYp3yGLMuv5rLnmp9O7YhnMHBCOGuWhv 9YBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=tyuD9ZeM; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d8si42970oti.306.2020.02.06.08.56.41; Thu, 06 Feb 2020 08:56:54 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=tyuD9ZeM; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727685AbgBFQzf (ORCPT + 99 others); Thu, 6 Feb 2020 11:55:35 -0500 Received: from mail-pf1-f202.google.com ([209.85.210.202]:40065 "EHLO mail-pf1-f202.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727390AbgBFQzf (ORCPT ); Thu, 6 Feb 2020 11:55:35 -0500 Received: by mail-pf1-f202.google.com with SMTP id d127so4210197pfa.7 for ; Thu, 06 Feb 2020 08:55:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:message-id:mime-version:subject:from:to:cc; bh=c8SLYwNN21iArK53Veq5gkGT51jTwqTXEnO7G5w7whE=; b=tyuD9ZeMbgadQgpQK0RzWWuMzIWdE4+SLbg1hGyrL8AfJx/KN5gUSIAx6bfGQdJ7jN BAaUbzZ6e0vCdULGSjGGHtl+0dFj3fGsfKFu6rwa9P3mBUR5QhmtcNnK9B8cu4XdADLb NhRAEntU1RCmd4desA/YqzSbh0dIFNuuEOwUf71c7KmnrRexJtqx1aI6Dp3SM6TZNbiQ SOi+jXpX9jVICA1lea4p6WO6EalU/2sOgjUMZF6TglIZrDKw154wJjGzBqNmK4fDrsCM os6Hf5fFCAkt3KYs9ltaKfI925eqbGvv6y8t6HBTUCRd2GEcH8wxQiMuUBSe1jQkMDWa v+zA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=c8SLYwNN21iArK53Veq5gkGT51jTwqTXEnO7G5w7whE=; b=WNeGUi6Fxmlwe1/k0jguJmgTUWPKJwzIxfweXvYVL9iTkqFoMGiXuYXKrPV9MeXXOX RriWJSsLHjVxZHtgBoXljBHaivPN5zCYYj5K+yEJY5oqb7RpSTWCSEp6LZYscAfdJpJG VvbS3y5eQ9ooQ827IcMYby46jADRXtGf5hcbxejlMrtzt6cdUWyEqgIKpa8uQVgkfDOR VRf0UwS2gOGZQMO6byL2lUVdCanS3cdrjBl3AcjqjSJYDwCFtVMpltH/rjc3K6EAcz9B 9Xfz7tuSjK60u3ZgLRx3TxKHT1wGJTF5sBin/EnKEszbu9u4zVz5HaQO27FG7/sGZ4VT 7PYA== X-Gm-Message-State: APjAAAUx83nbQLtcwQY09Gdj3+5sdCnMmfQHzi1kd82iHwdbWVkO8Z1H D3e40DnlFf2rxcicN1mrNWbS0ebNG2pS5rU= X-Received: by 2002:a63:e042:: with SMTP id n2mr4883228pgj.308.1581008132761; Thu, 06 Feb 2020 08:55:32 -0800 (PST) Date: Thu, 6 Feb 2020 08:55:27 -0800 Message-Id: <20200206165527.211350-1-smoreland@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.25.0.341.g760bfbb309-goog Subject: [PATCH] security: selinux: allow per-file labeling for bpffs From: Steven Moreland To: paul@paul-moore.com, sds@tycho.nsa.gov, eparis@parisplace.org, keescook@chromium.org, anton@enomsg.org, ccross@android.com, tony.luck@intel.com, selinux@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@android.com Cc: "Connor O'Brien" , Steven Moreland Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Connor O'Brien Add support for genfscon per-file labeling of bpffs files. This allows for separate permissions for different pinned bpf objects, which may be completely unrelated to each other. Change-Id: I03ae28d3afea70acd6dc53ebf810b34b357b6eb5 Signed-off-by: Connor O'Brien Signed-off-by: Steven Moreland --- security/selinux/hooks.c | 1 + 1 file changed, 1 insertion(+) diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c index de4887742d7c..4f9396e6ce8c 100644 --- a/security/selinux/hooks.c +++ b/security/selinux/hooks.c @@ -872,6 +872,7 @@ static int selinux_set_mnt_opts(struct super_block *sb, !strcmp(sb->s_type->name, "sysfs") || !strcmp(sb->s_type->name, "pstore") || !strcmp(sb->s_type->name, "binder") || + !strcmp(sb->s_type->name, "bpf") || !strcmp(sb->s_type->name, "cgroup") || !strcmp(sb->s_type->name, "cgroup2")) sbsec->flags |= SE_SBGENFS; -- 2.25.0.341.g760bfbb309-goog