Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp741897pxp; Fri, 11 Mar 2022 13:56:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJzR0j8kHh50GCmbgW47mMUZIhsm1xrJRxq6QvCaAr85BrrBAf/VBHjha5eYQHUSpm+Qvh3n X-Received: by 2002:a17:902:cec4:b0:151:a696:149b with SMTP id d4-20020a170902cec400b00151a696149bmr12302819plg.145.1647035780134; Fri, 11 Mar 2022 13:56:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1647035780; cv=none; d=google.com; s=arc-20160816; b=PHTXalZYUnINhnnEz/G8YpJCUENNfAtYUdvAYNzpNLsg4yMQ+G5rmscKrhVYTAiNoY DceHTou9gyMSkfxJgL7xTTEt1+PQ82r2SNA6csYwnnE1OOfFmuGAr5UGWLZrBXQc7uTt 1MZ6mQ4/ljOixBVnl+kmv0iZFo25LfFIXxcjfrTliLKjkTDeXSNKD5uP9Gz8wf2CrRfP UNxTubUfmt7sEi3psM9Qq77UJ9mfcOz4dn3qazlQFUd+wUJjvBc/bPvUPK1G/ngg4CFp J6aEoYihXfMZPMgDMpkpQlg69cpY7PUCYkFjdxHUBr32FGfnWwqhI7CFL78cWBfA/dUr uF7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Qn3mawfTU6zuyXVFnxb7r1Zgbfgfem9YSsefTT+IZGs=; b=eLuctEA2hDchC97I6zWjfft+5Lr9UkgHoKQPRiSBIdcjzujNT0WsXf1c+vz0WN49ha 07wJBcQ23QE8Dli1lrT6L6J6RdUEbs+6GjuqdoFyeHBwMfehsLaTnpaH1ssMCF8whCt2 87N5pi7QDbpNSZ7jBtYOXA7SqSzn09moU8bwck1jD6EHj0CGvkCG0lFFpKr5oa8foxZt FDEYrn74LjhmZkwdagc4BOrEKW/DC2O6daoj0vntgYPRPSkVlWMl5BvDbeImQgSubbBy 69ttkrx1VEK9E/9XesR00ckF9oFOnlY1qBxsLSKksrxdRPaZ9VjafL/FNUoRSFTG2w5Z 881w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@yahoo.com header.s=s2048 header.b=Z0AHUVBX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id e24-20020a17090ac21800b001bd14e01f2asi8713382pjt.24.2022.03.11.13.56.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Mar 2022 13:56:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@yahoo.com header.s=s2048 header.b=Z0AHUVBX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 45998167F7; Fri, 11 Mar 2022 13:14:30 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244493AbiCKAAf (ORCPT + 99 others); Thu, 10 Mar 2022 19:00:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55868 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237103AbiCKAAf (ORCPT ); Thu, 10 Mar 2022 19:00:35 -0500 Received: from sonic308-16.consmr.mail.ne1.yahoo.com (sonic308-16.consmr.mail.ne1.yahoo.com [66.163.187.39]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7C013D555E for ; Thu, 10 Mar 2022 15:59:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1646956773; bh=Qn3mawfTU6zuyXVFnxb7r1Zgbfgfem9YSsefTT+IZGs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From:Subject:Reply-To; b=Z0AHUVBXBh3H5S34h7N0LLFN1Pem17DhmOdsp+HHmKWTaQ0vIVx5ZNpSWsk5E7GXb7jNfKDgKZuWHx0KgTX+EJhT4dwGJqtF8342rVI6K1Gw0Fivv7bHhBlKkg0swYMjFiiCv0wQEKogXk2LZed3f9aiKnvU5F6qWo7/g7FQC+llgd4MG2dQzweUdjPlRCdldvm9yC1LB7m25i+7h0vBLeGspX+1q5AG6j/7OybKvRNZndPpHRQf9rRMVaJG2jgr5QegD0pRtXgRVjxkgupjerZqAgJVyTorYD23qWeMNJOas1ZiW3OA33OBGGKby2JiNDOZzBRPMsSoWEkfCmJxSw== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1646956773; bh=waGFu/15HgY3B1DYoOM2HK81bNtOEyZxEDMwpgApMTH=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=ku/pQIJ0uDBS7isvOPCnh/rqerZcQRrdNpTFv3smyZjxQZIQSDSJICupNsW+EvQDc3wpzpNn8NZLG7WuqOd1lyqOPPs3Foa+vqWB9Pze/mhpUKQqz8g2W1q/xsHG3I5oPvxjNwAEZuPMkpftdKvO8Ywfwuy+UQzPXLmW0zAuzjDoCE9wFU0S18r9C8mgkOR0dNPSzjoryAqsA//2zIuHpCGlhFnlj1kHW+qH5x85h1g4ewDGgBa4T+oOaGiFO9UIWNx+06QW5fY5/n+LDPyFV2Zc7VgqFpQe7tu9Jz4YKjB/1UO3uUejoV2/AbydDrwF62CZNzrcJUcU+zcSTlbRzQ== X-YMail-OSG: pPzVHfEVM1keXy3lV0cqLzq.B1LERk5l4GM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zC4s9v0NH JwZge4XI2RZ4wmOfTsXGDMzSH1bPk4yuUqRrXV3Dpf9lMnh1RLAirEvvCnrn1wmT_qb4Fnd289n4 aziq6A9o08pKPMxMP9cOsFlelbrDiN6oZvA0IP42CJbTPpraQiyfcaq_K2VC_LBJt9SH_IPOBnU3 BVWXUkHQwUAj2QBNUvxtG77YkVIE80w-- X-Sonic-MF: Received: from sonic.gate.mail.ne1.yahoo.com by sonic308.consmr.mail.ne1.yahoo.com with HTTP; Thu, 10 Mar 2022 23:59:33 +0000 Received: by kubenode510.mail-prod1.omega.ne1.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 33032615d5bc216242260d2cf82dc739; Thu, 10 Mar 2022 23:59:32 +0000 (UTC) From: Casey Schaufler To: casey.schaufler@intel.com, jmorris@namei.org, linux-security-module@vger.kernel.org, selinux@vger.kernel.org Cc: casey@schaufler-ca.com, linux-audit@redhat.com, keescook@chromium.org, john.johansen@canonical.com, penguin-kernel@i-love.sakura.ne.jp, paul@paul-moore.com, stephen.smalley.work@gmail.com, linux-kernel@vger.kernel.org Subject: [PATCH v33 24/29] LSM: Add a function to report multiple LSMs Date: Thu, 10 Mar 2022 15:46:27 -0800 Message-Id: <20220310234632.16194-25-casey@schaufler-ca.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220310234632.16194-1-casey@schaufler-ca.com> References: <20220310234632.16194-1-casey@schaufler-ca.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add a new boolean function lsm_multiple_contexts() to identify when multiple security modules provide security context strings. Signed-off-by: Casey Schaufler --- include/linux/security.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/linux/security.h b/include/linux/security.h index 6dbdfd12fd79..13bc38970498 100644 --- a/include/linux/security.h +++ b/include/linux/security.h @@ -232,6 +232,15 @@ static inline bool lsmblob_equal(const struct lsmblob *bloba, extern int lsm_name_to_slot(char *name); extern const char *lsm_slot_to_name(int slot); +static inline bool lsm_multiple_contexts(void) +{ +#ifdef CONFIG_SECURITY + return lsm_slot_to_name(1) != NULL; +#else + return false; +#endif +} + /** * lsmblob_value - find the first non-zero value in an lsmblob structure. * @blob: Pointer to the data -- 2.31.1