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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 940B2C4332F for ; Wed, 9 Nov 2022 23:34:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231607AbiKIXei (ORCPT ); Wed, 9 Nov 2022 18:34:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40488 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231544AbiKIXe0 (ORCPT ); Wed, 9 Nov 2022 18:34:26 -0500 Received: from mail-ot1-x330.google.com (mail-ot1-x330.google.com [IPv6:2607:f8b0:4864:20::330]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6DC1D13FBE for ; Wed, 9 Nov 2022 15:34:25 -0800 (PST) Received: by mail-ot1-x330.google.com with SMTP id br15-20020a056830390f00b0061c9d73b8bdso262936otb.6 for ; Wed, 09 Nov 2022 15:34:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paul-moore-com.20210112.gappssmtp.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=sWbjRDR7oEfTFipQemNFQRb8BL0viMnAylQw4SRSH5I=; b=7ojs9K9EuWYPxw5quIjTs4on2c9ylenKWtN6r/s2Wqkx56dsAnmF/LCwOGLhEfwstN xuPtTSyT2rfM8/e+MDbe+b/dJi63f8QjxBwI5w5ILMeztHqSkBs34zEvBJcXRFVMVpYZ EgoS8RV6bZ715KKBRo2zWawX5eUx9/ONXst7eXricfQLP4KXGb1NA201bRXlYGAJw//u n+NQeQ3LRgjIezLRvfdS22j9ofAlVhtckEM5uKulw2L4z+eEhC5Srf5sz143Lzfs7zZQ jttqTEZecftkrvGEnGxBhE/CABkq9OEYjsnecgH6TfnRIZn47WJMPEjxCZv/4GxMQwiq ttSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=sWbjRDR7oEfTFipQemNFQRb8BL0viMnAylQw4SRSH5I=; b=M07rWMeqdrOS3/Y63pNU5SoqCakp4SS6rCgp+M8yjN9ww+WB0iPp3tBuu1AH1tpfgP 91txMWMyAM/j2xdtNDakUvUeIs2+vzmCl8xeh1wkO9zUK7yaByyQXQIhlfXIO3HWsBzt WZtT9tLW/StYGcl2UVVXFTZkcGuFvTwN+x7ajXr5BkeYoJ3NvE7/vS8HjANR/qSPmCI0 d/9JJiG6Hq7D8tcJbtWd7EkscYMYEuXq3AKK8ODBUEzFPMYOpQTBk6/4h4j2PfG3pbbQ +og16e7qgNoq5+nHCumfXcGIW6NhnBhlXRLbyS2A258i0TW3mV9vYiAvgVS9XH0VC6tB vvDA== X-Gm-Message-State: ACrzQf2V9Xfz1Cj++v9ju8jod7hGAG3CKxzomGcIcg0LRXGCmSZnkcxu nYmOcbb51SJTSQrl6JA1rFxzFQqVCcOP5x/TvE2qcXnNxg== X-Google-Smtp-Source: AMsMyM6EYxXXLjYag46U/qRTjGODzHhgNYuenbATBWMFT4HBwhpOqAzYqwjgoyxzBTRIst+9dQ4yGQPsJ1j8jnyqcT4= X-Received: by 2002:a9d:7f84:0:b0:66c:53ef:e555 with SMTP id t4-20020a9d7f84000000b0066c53efe555mr25368433otp.34.1668036864745; Wed, 09 Nov 2022 15:34:24 -0800 (PST) MIME-Version: 1.0 References: <20221025184519.13231-1-casey@schaufler-ca.com> <20221025184519.13231-5-casey@schaufler-ca.com> In-Reply-To: From: Paul Moore Date: Wed, 9 Nov 2022 18:34:14 -0500 Message-ID: Subject: Re: [PATCH v1 4/8] LSM: Maintain a table of LSM attribute data To: Linus Torvalds Cc: linux-kernel@vger.kernel.org, linux-audit@redhat.com Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 26, 2022 at 8:38 PM Casey Schaufler wrote: > On 10/25/2022 11:00 PM, Greg KH wrote: > > On Tue, Oct 25, 2022 at 11:45:15AM -0700, Casey Schaufler wrote: > >> As LSMs are registered add their lsm_id pointers to a table. > >> This will be used later for attribute reporting. > >> > >> Signed-off-by: Casey Schaufler > >> --- > >> include/linux/security.h | 17 +++++++++++++++++ > >> security/security.c | 18 ++++++++++++++++++ > >> 2 files changed, 35 insertions(+) > >> > >> diff --git a/include/linux/security.h b/include/linux/security.h > >> index ca1b7109c0db..e1678594d983 100644 > >> --- a/include/linux/security.h > >> +++ b/include/linux/security.h > >> @@ -138,6 +138,23 @@ enum lockdown_reason { > >> > >> extern const char *const lockdown_reasons[LOCKDOWN_CONFIDENTIALITY_MAX+1]; > >> > >> +#define LSMID_ENTRIES ( \ > >> + 1 + /* capabilities */ \ > > No #define for capabilities? > > Nope. There isn't one. CONFIG_SECURITY takes care of it. I guess we might as well use the existing pattern just in case this header ever gets pulled into somewhere unexpected. (IS_ENABLED(CONFIG_SECURITY) ? 1 : 0) + ... -- paul-moore.com 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 us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (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 EB260C4332F for ; Wed, 9 Nov 2022 23:34:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1668036874; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=m0bcTuNu0RaE5g1SPmoG3EbQxVpHTbkKGI0FlpZcDEI=; b=Jdjid1ZZVfi4fjaCC5Hn3tJvBVYwyP1B7okVTWL5Gf9DKF/UXMsYIhhoYf5KU65g9Fi6z4 vebeXIw6/Y1eh4fCn9VaDiQqXIXnKiFjLhE/OMOU+6HjizA1rPw6O+lSMlVvkx1+rYroT7 u8uC1P15MYDqaNOmY+MGstPlTILabMI= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-486-JxkVpzVpNqeMmAGFov7x-w-1; Wed, 09 Nov 2022 18:34:31 -0500 X-MC-Unique: JxkVpzVpNqeMmAGFov7x-w-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5D2B9811E67; Wed, 9 Nov 2022 23:34:30 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id DB13D4A9256; Wed, 9 Nov 2022 23:34:28 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 9EBA11946594; Wed, 9 Nov 2022 23:34:28 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 03E831946588 for ; Wed, 9 Nov 2022 23:34:28 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id DB880140EBF5; Wed, 9 Nov 2022 23:34:27 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast01.extmail.prod.ext.rdu2.redhat.com [10.11.55.17]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D44B91402BDA for ; Wed, 9 Nov 2022 23:34:27 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B8E6585A5A6 for ; Wed, 9 Nov 2022 23:34:27 +0000 (UTC) Received: from mail-ot1-f43.google.com (mail-ot1-f43.google.com [209.85.210.43]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-500-h2gXRquhObqvaX0MGmeS_g-1; Wed, 09 Nov 2022 18:34:25 -0500 X-MC-Unique: h2gXRquhObqvaX0MGmeS_g-1 Received: by mail-ot1-f43.google.com with SMTP id cb2-20020a056830618200b00661b6e5dcd8so257912otb.8 for ; Wed, 09 Nov 2022 15:34:25 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=sWbjRDR7oEfTFipQemNFQRb8BL0viMnAylQw4SRSH5I=; b=3yBZ74UV8OS2KXDrGMsm8y3JFfGNexWVWShFD+tjfLE+7cE2+qfHFpwVyhV1ZFr7qn mWuY3RL3f1G5TnRsTvgjWODK79qkzTRLf+olNNsol3IWlYDkJJo2VoDvmBNGkA/pG8Na 7dk2/96xKB++LBElSvnjB8szKSrtdOeDuImjf0qo6cuO7nrIMzmZCHpWVcRLn4bDFVoD oKm9vZVcoZQyW+zZxNJjjArr44qvmA2vknQVcVgV1H4LxE2nQccl1F/xJcilkt66W1eG XF9D7dqXRNVF2+/cupXms75K9y88DXG3b07fqBevBKuSN46jXNipr4KtK6bJvFOB28Q+ A9iQ== X-Gm-Message-State: ACrzQf2xaDK8R1hyTaB/yUjEpLtvMjZQKgGPZwlTUnuyVQfUXodTc/Sp sp8Cqb0tIcvcw7nDEwvN/e1jDbkCxaKTAavH2mLv X-Google-Smtp-Source: AMsMyM6EYxXXLjYag46U/qRTjGODzHhgNYuenbATBWMFT4HBwhpOqAzYqwjgoyxzBTRIst+9dQ4yGQPsJ1j8jnyqcT4= X-Received: by 2002:a9d:7f84:0:b0:66c:53ef:e555 with SMTP id t4-20020a9d7f84000000b0066c53efe555mr25368433otp.34.1668036864745; Wed, 09 Nov 2022 15:34:24 -0800 (PST) MIME-Version: 1.0 References: <20221025184519.13231-1-casey@schaufler-ca.com> <20221025184519.13231-5-casey@schaufler-ca.com> In-Reply-To: From: Paul Moore Date: Wed, 9 Nov 2022 18:34:14 -0500 Message-ID: Subject: Re: [PATCH v1 4/8] LSM: Maintain a table of LSM attribute data To: Linus Torvalds X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-BeenThere: linux-audit@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux Audit Discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-audit@redhat.com, linux-kernel@vger.kernel.org Errors-To: linux-audit-bounces@redhat.com Sender: "Linux-audit" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit On Wed, Oct 26, 2022 at 8:38 PM Casey Schaufler wrote: > On 10/25/2022 11:00 PM, Greg KH wrote: > > On Tue, Oct 25, 2022 at 11:45:15AM -0700, Casey Schaufler wrote: > >> As LSMs are registered add their lsm_id pointers to a table. > >> This will be used later for attribute reporting. > >> > >> Signed-off-by: Casey Schaufler > >> --- > >> include/linux/security.h | 17 +++++++++++++++++ > >> security/security.c | 18 ++++++++++++++++++ > >> 2 files changed, 35 insertions(+) > >> > >> diff --git a/include/linux/security.h b/include/linux/security.h > >> index ca1b7109c0db..e1678594d983 100644 > >> --- a/include/linux/security.h > >> +++ b/include/linux/security.h > >> @@ -138,6 +138,23 @@ enum lockdown_reason { > >> > >> extern const char *const lockdown_reasons[LOCKDOWN_CONFIDENTIALITY_MAX+1]; > >> > >> +#define LSMID_ENTRIES ( \ > >> + 1 + /* capabilities */ \ > > No #define for capabilities? > > Nope. There isn't one. CONFIG_SECURITY takes care of it. I guess we might as well use the existing pattern just in case this header ever gets pulled into somewhere unexpected. (IS_ENABLED(CONFIG_SECURITY) ? 1 : 0) + ... -- paul-moore.com -- Linux-audit mailing list Linux-audit@redhat.com https://listman.redhat.com/mailman/listinfo/linux-audit