From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ua1-f44.google.com (mail-ua1-f44.google.com [209.85.222.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 901993ACF05 for ; Wed, 13 May 2026 18:36:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778697372; cv=none; b=KJeCJU2T+aIGLhhA63jCUuiEYQ6+v3yZbP9a9kLlLjSn4/VaE//X/kwCSGc74Fo48IeSrpBT7SVsThVMzcnaLBGz3kzBc7fRlAMd9z+5nvYa072TWIql0ZkKc9ms5iYbtVOdjumzju22O4oA510eCFlP1YBEGG4flbFBkB2U+EI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778697372; c=relaxed/simple; bh=fKOKJEKCQB7cRMjjud6VYUpU43WsP6hzTEL1c0Fjrok=; h=Date:Message-ID:MIME-Version:Content-Type:From:To:Subject: References:In-Reply-To; b=b8H11sghEBEVI+JXi3+Sx2wnyMoEw91XbYmUnQyDWCwshsYoPvg1tdoUj/qbof8rJn6H74QEEfgROydNIG5XvCUOTpopcmez7x1dDN4avCUxqdqq8J0aWxcNqpGPDf6p/mZ1herrzitcQDMN7941S3JWjprDgG33elmbVrBJ4qw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=paul-moore.com; spf=pass smtp.mailfrom=paul-moore.com; dkim=pass (2048-bit key) header.d=paul-moore.com header.i=@paul-moore.com header.b=A7MxMrbj; arc=none smtp.client-ip=209.85.222.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=paul-moore.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=paul-moore.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=paul-moore.com header.i=@paul-moore.com header.b="A7MxMrbj" Received: by mail-ua1-f44.google.com with SMTP id a1e0cc1a2514c-95d3492fb1eso4619628241.3 for ; Wed, 13 May 2026 11:36:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paul-moore.com; s=google; t=1778697369; x=1779302169; darn=vger.kernel.org; h=in-reply-to:references:subject:to:from:content-transfer-encoding :mime-version:message-id:date:from:to:cc:subject:date:message-id :reply-to; bh=Rnl9nddGqHsoJCblcDMeoQmT9vKG6sC23FZyxNkSplI=; b=A7MxMrbjSeVVFbeXNiNPJdI78vdz2rTwTyC5hL/rLuWxlOgb/ocUKXMFHPCIcJt2Xj FJzPw4sIPjyQrKUAtKPrkk1eiskLuK5mjxX21fVq6yM9zrt4rKqwNFAqS2W5xNWX2Wsu ZGPYuY6xNB0QZniXskfL7MZmHQPbOw5qEOPE4s9m2uH0kU6WPOyLlqlWRoZ46pdJaQeZ /mY1Dfx7m0kg3teBSECwDHM5kNukzof8+ESeA641G96q8LPqz8fgX171wmkz5IJmgQtU 6JP7GW/WQQ/DEJw2JMZ7AWeXb3++SculGj729qIsqp44QL096yH9Sjwttw4fTFELZQVX VAGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778697369; x=1779302169; h=in-reply-to:references:subject:to:from:content-transfer-encoding :mime-version:message-id:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Rnl9nddGqHsoJCblcDMeoQmT9vKG6sC23FZyxNkSplI=; b=oYjNyu7qk1/PBhs6T5q8q2YQ7NRJMlflXArU6l9TuDCHhYhUN7KfxsLZS8q8Gk9v/i I/0GPAhhzF/wdVZqhr2p+2btemez7Sqkfjh7DmHiqT+khkjjy+xXMhvav1j0wOKVTnEg +fZG+6uWvHNuzN5Ukl+wamNa9oA4LUdHsvpUPJmZ729mdRVG/N2j8v/Apzm+Y12L9ABL kDt5mNy40/9Tig2TAi34x2B4rP/sa/8FkC53gG0Ym0y2PrBNi0rMKmZRqkCYpZbxzmqx wVMOd5Hf9tMbYdqPYPOBWQwoQtwjeAQTl2elknsbHRDSCNCXobln7at2HEevB1qCb5+8 6NyQ== X-Forwarded-Encrypted: i=1; AFNElJ+8mJ6o63QB41MJDRDkYek7ArRWLPx3LCKTuUfVydc7PvkyjAKbvNn0LJsDlHLvAmp0PZ0WhY22pZhwUdU=@vger.kernel.org X-Gm-Message-State: AOJu0Yx/CgGvfDbSfPrYtQ5fMOC+FaBFxDa6iB5rgIKJPeQ7vlqNaKS6 1n4VTdl/VAoquUFFQrG/3Jea2jUBOIvduqxUA0CXJFaWoUrAhuydDI3IACWmDuXkCR1KsE+C2OH XW6g= X-Gm-Gg: Acq92OH62TxOVoRI3PFkTqtq+LVyyenFigDkhmev+p0xNqisoja46eFy8pIjA/xBGi9 zyCt2KDtImGAkfLsWD33j4CaBexzH6CyusQ4FnEJ+FTV5wc/lNXrALGqlfD1W+BQGR+DHmGrJVZ 2cYYdBITUFB9MB6mux7RvL9reXT2iGk9hkmODBih1IW/WE+guqEQZzjYLEyzNnmAwLuKFgjWyBa afaKPM9m0pceU4bYQjXA3K+Pp1mCQRrP2JRpinc7Crp8RgoH7o9cXm2G/H9ZI12b7tKvSBUhdvh 905DK8mFP3wqyF45j+J39J+2aUnL+tLEDldDotWGjIkx0wjWBBmfi+A5Nidon3XV0CpOj4b/1y6 BZuOFX5Cjrq/3FpsXFZ43c3zoobAOeg9a/aDLONcyYIzCYcyXcdFDYQ41v2y4keJDyUiTfuly7r E8JAChO3Sq6659lGsPIfTbchaCTBYkkmSJnzrOU5fXogbRF/82TP4AsJO8nAINCz8qCB8X X-Received: by 2002:a05:6102:6f06:b0:631:b834:e055 with SMTP id ada2fe7eead31-63773d10a25mr2918465137.10.1778697369491; Wed, 13 May 2026 11:36:09 -0700 (PDT) Received: from localhost (pool-71-126-255-178.bstnma.fios.verizon.net. [71.126.255.178]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-8c90b4c50afsm2995736d6.27.2026.05.13.11.36.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 May 2026 11:36:07 -0700 (PDT) Date: Wed, 13 May 2026 14:36:06 -0400 Message-ID: <37fe68a4543e20fb34b6c9a146151711@paul-moore.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Mailer: pstg-pwork:20260512_1604/pstg-lib:20260513_1343/pstg-pwork:20260512_1604 From: Paul Moore To: Blaise Boscaccy , "Blaise Boscaccy" , "Jonathan Corbet" , "" , "James Morris" , "Serge E. Hallyn" , =?UTF-8?q?Micka=C3=ABl=20Sala=C3=BCn?= , =?UTF-8?q?G=C3=BCnther=20Noack?= , "Dr. David Alan Gilbert" , "Andrew Morton" , James.Bottomley@HansenPartnership.com, dhowells@redhat.com, "Fan Wu" , "Ryan Foster" , "Randy Dunlap" , linux-security-module@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, "Song Liu" Subject: Re: [PATCH v7 4/10] lsm: framework for BPF integrity verification References: <20260507191416.2984054-5-bboscaccy@linux.microsoft.com> In-Reply-To: <20260507191416.2984054-5-bboscaccy@linux.microsoft.com> On May 7, 2026 Blaise Boscaccy wrote: > > Add a new LSM hook and two new LSM hook callbacks to support LSMs that > perform integrity verification, e.g. digital signature verification, > of BPF programs. > > While the BPF subsystem does implement a signature verification scheme, > it does not satisfy a number of existing requirements, adding support > for BPF program integrity verification to the LSM framework allows > administrators to select additional integrity verification mechanisms > to meet these needs while also providing a mechanism for future > expansion. Additional on why this is necessary can be found at the > lore archive link below: > > https://lore.kernel.org/linux-security-module/CAHC9VhTQ_DR=ANzoDBjcCtrimV7XcCZVUsANPt=TjcvM4d-vjg@mail.gmail.com/ > > The LSM-based BPF integrity verification mechanism works within the > existing security_bpf_prog_load() hook called by the BPF subsystem. > It adds an additional dedicated integrity callback and a new LSM > hook/callback to be called from within LSMs implementing integrity > verification. > > The first new callback, bpf_prog_load_integrity(), located within the > security_bpf_prog_load() hook, is necessary to ensure that the integrity > verification callbacks are executed before any of the existing LSMs > are executed via the bpf_prog_load() callback. Reusing the existing > bpf_prog_load() callback for integrity verification could result in LSMs > not having access to the integrity verification results when asked to > authorize the BPF program load in the bpf_prog_load() callback. > > The new LSM hook, security_bpf_prog_load_post_integrity(), is intended > to be called from within LSMs performing BPF program integrity > verification. It is used to report the verdict of the integrity > verification to other LSMs enforcing access control policy on BPF > program loads. LSMs enforcing such access controls should register a > bpf_prog_load_post_integrity() callback to receive integrity verdicts. > > More information on these new callbacks and hook can be found in the > code comments in this patch. > > Signed-off-by: Blaise Boscaccy > Link: https://lore.kernel.org/linux-security-module/CAHC9VhTQ_DR=ANzoDBjcCtrimV7XcCZVUsANPt=TjcvM4d-vjg@mail.gmail.com/ > Signed-off-by: Paul Moore > --- > include/linux/lsm_hook_defs.h | 5 +++ > include/linux/security.h | 25 ++++++++++++ > security/security.c | 75 +++++++++++++++++++++++++++++++++-- > 3 files changed, 102 insertions(+), 3 deletions(-) Merged into lsm/dev, thanks. -- paul-moore.com