Received: by 2002:a19:f614:0:0:0:0:0 with SMTP id x20csp22350lfe; Fri, 15 Apr 2022 17:35:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyv5B/Dm4KDuXVq+PjDXSr0Cw2lNUv5ZkuDDHATJIKuwOWMKIBNNXeEj3kH4zFwqfB3SWYQ X-Received: by 2002:a05:6a00:2402:b0:4e1:46ca:68bd with SMTP id z2-20020a056a00240200b004e146ca68bdmr1342899pfh.70.1650069355095; Fri, 15 Apr 2022 17:35:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650069355; cv=none; d=google.com; s=arc-20160816; b=bKeJJ224aC43rGTWNj3ICr3za77HcB5Q26Z9Qy/31sBeXIVwxFguDFJMbtKwQ0nkYl 1eRQ7hLCKnB8qnXx5kUub0zOoN/kB8Qd7RYtuAN+7dYsfas77iMSe/9CHsX+LE3ByrHa qgxTYnCCAW5M4oirjEw1npNgi1e/s956kvFELayhV/2Yy2PN1ddOwieY828d5Is4Egq/ xd+RurLzYp+Ehn2kExWC2HjcTJdnOXLsJ0R+fSlkZoW9YfgHxt3ReKwB5GSnPloOUlzE f9SLXfxlIRfxL7cg62rVKZQOyefnNXdCI9rqFojKMyJw0QDh8Y+v3prtmidqUdRgyL6i +w2Q== 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=s1tbTejuxOu/lam7b4cMnSGO5wWBpi4ZK3vddXbJyRI=; b=USX6vQiU5UerkFXWH5D8jWe4Bw19ToW/RL6bhRf/RLvyTDxejDUcRchw0189Rm4djn y1T4w3HyT9V+1mX39f5o3xf7L2fvEpoAQ0bCL/0yyG4Do2rMVS6mGwkee+ql3QuZcgV2 1HeceeS2n+evKsQqZQilmC9l6XmrQ9LI8rOv7roxaIruvPlOVwKBH2uVBsd701bAECzd MzkN9Ia0e1dgiJoS7MtS4cZa/1giWT+skXsT7D4wClJ8MQ9YoubbzpjzlXE8EAlOeNOs Ql/2z9dT5qBL4/+yBH5uC0jRC5shT+7ToGe6BOb9bK/2VUdEsEyKfUI6rJY1W3+rtvLT YHbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@yahoo.com header.s=s2048 header.b=TGbVMIoZ; 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 i9-20020a63d449000000b0039d40eb5ca9si2758142pgj.644.2022.04.15.17.35.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Apr 2022 17:35:55 -0700 (PDT) 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=TGbVMIoZ; 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 3AFA4F7F66; Fri, 15 Apr 2022 17:31:48 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1355417AbiDOVdw (ORCPT + 99 others); Fri, 15 Apr 2022 17:33:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42786 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354306AbiDOVdv (ORCPT ); Fri, 15 Apr 2022 17:33:51 -0400 Received: from sonic305-28.consmr.mail.ne1.yahoo.com (sonic305-28.consmr.mail.ne1.yahoo.com [66.163.185.154]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 302F4D9E90 for ; Fri, 15 Apr 2022 14:31:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1650058280; bh=s1tbTejuxOu/lam7b4cMnSGO5wWBpi4ZK3vddXbJyRI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From:Subject:Reply-To; b=TGbVMIoZ70jeHb/ftmhMWxdk2si7mjUhEMhduiCBPQ/TEiqN8kcTWdWAUxJcxtye2ckkDaElBVgkbTQkpIVUe0fIm7uqHOa/ISmLitW54iAZ7N8gMyggXuReurzc1z4AJFqb8kTGYLY0qiLWq+GD1Me3x5ODPHfHiD7cH24GvaXVMfLEnFdZRXM04arb0yvIGpuotpR1zXQlZwKT8eobOQvjcXAjgL1tuP94ME9A6sKC4nfu0ZscvCCVx9N77H3GF2xbRquIgCbF6QY0zG9RJngl27QPAXMFL8l7d0io2ts3aQULhZ6UTK+SN6ukqS/cQ8qZ3GZtGBySyz7iEs4FLw== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1650058280; bh=NBPxB3QGX+t1fIt8ZXWiboiuDtVGS3TPb79aVJPmwE6=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=IL9TlMVzsFiaLP2nXQH88UgXWQGu+KekeT7I0IT9p19gyzaRwlwFYIoybV5n5l+REl6zJb3SA/TtRgiIeq/bc76pf4hs8sArCtjic26dPDV9klagic+addDDCnxzSlpX2s/2Fp46O4vcLcX4tMF7+3qvXwiHrVUa4z27YcNKG0GJxiu1SOv8E7GX9u9i6Umw17NTHo6cda6SuIxNRNrjgPTKjJ+GfIPnHMyZIcPzVymQq8Znfd0BvCm7WeKQgknHTSglijfi7qk/5cYAhhPDvWxq189+CttrcvBkYEOwP5k1+aU++Ff2isYm59L37kiA+NmkESxuxL/48ecsXZ7Mew== X-YMail-OSG: VsJf0lUVM1mvaon6rkMzVpQ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hwS4mT.XdlndpzWUF6Cq9RJ8etwHgJw39bd6yC .zrORMLhlD_g6zaXBKPtR1r4_Ji5vlXzZoISJ_.2fWtD4uBre.6OCWvnkCWUCmYvjsvu9OMJHrls wesl1m3JLWP7k7m.1A1KVZKrwUOvx3bjOz97n2VBYoQgr8RUGXU.VltpJd2F5yT_Lpf3kX_B3PRv OXS8C3.yc2kmS.bS8j3keONFat6a5OGVtxOOBQjj3hmf7Sf.baLMrNg-- X-Sonic-MF: Received: from sonic.gate.mail.ne1.yahoo.com by sonic305.consmr.mail.ne1.yahoo.com with HTTP; Fri, 15 Apr 2022 21:31:20 +0000 Received: by hermes--canary-production-bf1-5f49dbcd6-hf9hx (VZM Hermes SMTP Server) with ESMTPA ID 13670bbd638f1f6033ad5ba33b62894a; Fri, 15 Apr 2022 21:31:15 +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 v34 24/29] LSM: Add a function to report multiple LSMs Date: Fri, 15 Apr 2022 14:17:56 -0700 Message-Id: <20220415211801.12667-25-casey@schaufler-ca.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220415211801.12667-1-casey@schaufler-ca.com> References: <20220415211801.12667-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 0d3931723361..52b5046c0956 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.35.1