Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp1152rwi; Wed, 12 Oct 2022 15:00:47 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4zXWMhU2BzyvKDrdMbicGsnXOmboG5erGJV8yNhFZh6PyoXUpQWau35aJqcaJQauTz1liD X-Received: by 2002:a17:906:cc57:b0:78d:3612:f0e1 with SMTP id mm23-20020a170906cc5700b0078d3612f0e1mr24523037ejb.188.1665612046128; Wed, 12 Oct 2022 15:00:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665612046; cv=none; d=google.com; s=arc-20160816; b=zsoLvXnBz/1zqzaiFiu726BuyUG9zxaM/A/1z0D7EXEvELCP8P4gnrwh53iPzxiUyO berv8MhSHeWqpGR+JG1UVLd7zy8lNh5JIh297ghG+utu0l83Qfq222+Ad7c1IH8oeVG7 W+QM0r03W5pq2GcgP1gG36L1Pt/Zz74f+3juM/WMeK1whVUj6UcA1HkrAxh5Xj+1FR0s V5igvk7pUBdZBsVw50y97ymIkveAPyQXFdwIMMtXX0fk8RIUAeO0zIs2W5s9nHSSaGFy kmO/Q8G466A4bTIf7CJoavy7jHuVm2RKzpsILmtJolhHLywu8KlwdrC3dP2rVm5kxAFk jeSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=+GK0hOdziHCh8qunV/CUeEJucPXO+i0jBjIWlPSIx4o=; b=eRZdLt7V7n4dKSi7gTqco/XGVgn0VnTDipyNqn0GsGhGhdWcUo23znsKEfu1v5W8Dk MftZb+DgfR3LrDYt1swyNRXMRfTxYsqpHKnmcBPIvThLkfs5jg4Hl5zITy4/SVi8Ce2M b7V99mTLhKHKYbJU2T0SgDfBWRIWFN/xcwcw6a2DKB8o9dS8tDA62TopBxB4FNW8nDIz zcR981c9oy2zRYh12XdqW7EAvI2UaBeBCms8+JluHKzximtfZatVKTdHhM7oE4DS4uqI ENvADExGb/Ve0fUsFu8BkBIR96+fSNYlEo8xx7qX+tdCUA1jcz3BMFH2DXNowJqtyyPV IDrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@digikod.net header.s=20191114 header.b=sa2FGycx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hb37-20020a170907162500b0078de83a052csi5109853ejc.483.2022.10.12.15.00.12; Wed, 12 Oct 2022 15:00:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@digikod.net header.s=20191114 header.b=sa2FGycx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230111AbiJLVSl (ORCPT + 99 others); Wed, 12 Oct 2022 17:18:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36176 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230097AbiJLVSh (ORCPT ); Wed, 12 Oct 2022 17:18:37 -0400 Received: from smtp-42ae.mail.infomaniak.ch (smtp-42ae.mail.infomaniak.ch [IPv6:2001:1600:4:17::42ae]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6D02511877B; Wed, 12 Oct 2022 14:18:36 -0700 (PDT) Received: from smtp-3-0001.mail.infomaniak.ch (unknown [10.4.36.108]) by smtp-3-3000.mail.infomaniak.ch (Postfix) with ESMTPS id 4MnlrB4xJZzMpyjd; Wed, 12 Oct 2022 23:18:34 +0200 (CEST) Received: from ns3096276.ip-94-23-54.eu (unknown [23.97.221.149]) by smtp-3-0001.mail.infomaniak.ch (Postfix) with ESMTPA id 4Mnlr96dLbzMpqBK; Wed, 12 Oct 2022 23:18:33 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=digikod.net; s=20191114; t=1665609514; bh=DMhwYjWL6d1PAGaMxTIgGylIFY9xHl+u4l11I3u63VU=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=sa2FGycxEG4zDO/NzLxkCWr8Zd4RR4v/UZS6ki/Scg5cKVyrdvvqc6mfXxotNYa3U yRh3FgH0VVeTCm0m+FJNyjTzdx0qqwQnqRUkwZ9oJiHHx7utMCpJ+E8I+6FpS5KbqF 9OSeOhewRXQ21B1NVcA6GfGtKGtEWDI568Ih6LLc= Message-ID: <58adb9d6-3199-00b9-5883-804d5934b024@digikod.net> Date: Wed, 12 Oct 2022 23:18:33 +0200 MIME-Version: 1.0 User-Agent: Subject: Re: [PATCH v38 09/39] LSM: Add the lsmblob data structure. Content-Language: en-US To: Casey Schaufler , casey.schaufler@intel.com, paul@paul-moore.com, linux-security-module@vger.kernel.org Cc: linux-audit@redhat.com, jmorris@namei.org, selinux@vger.kernel.org, keescook@chromium.org, john.johansen@canonical.com, penguin-kernel@i-love.sakura.ne.jp, stephen.smalley.work@gmail.com, linux-kernel@vger.kernel.org References: <20220927195421.14713-1-casey@schaufler-ca.com> <20220927195421.14713-10-casey@schaufler-ca.com> From: =?UTF-8?Q?Micka=c3=abl_Sala=c3=bcn?= In-Reply-To: <20220927195421.14713-10-casey@schaufler-ca.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 On 27/09/2022 21:53, Casey Schaufler wrote: > When more than one security module is exporting data to > audit and networking sub-systems a single 32 bit integer > is no longer sufficient to represent the data. Add a > structure to be used instead. > > The lsmblob structure is currently an array of > u32 "secids". There is an entry for each of the security > modules built into the system that would use secids if > active. The system assigns the module a "slot" when it > registers hooks. If modules are compiled in but not > registered there will be unused slots. The slot number > is added to the lsm_id structure. > > The audit rules data is expanded to use an array of > security module data rather than a single instance. > A new structure audit_lsm_rules is defined to avoid the > confusion which commonly accompanies the use of > void ** parameters. > > Signed-off-by: Casey Schaufler > --- [...] > diff --git a/security/landlock/setup.c b/security/landlock/setup.c > index 1242c61c9de4..adbe941370f3 100644 > --- a/security/landlock/setup.c > +++ b/security/landlock/setup.c > @@ -27,6 +27,7 @@ struct lsm_blob_sizes landlock_blob_sizes __lsm_ro_after_init = { > struct lsm_id landlock_lsmid __lsm_ro_after_init = { > .lsm = LANDLOCK_NAME, > .id = LSM_ID_LANDLOCK, > + .slot = LSMBLOB_NOT_NEEDED, Please only use one space after ".slot"