[PATCH v2] tpm: ibmvtpm: Call tpm2_sessions_init() to initialize session support

2024-07-29 Thread Stefan Berger
he missing call to tpm2_session_init() to the ibmvtpm driver to resolve this issue. Fixes: d2add27cf2b8 ("tpm: Add NULL primary creation") Signed-off-by: Stefan Berger --- drivers/char/tpm/tpm_ibmvtpm.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/char/tpm/tpm_ibmvtpm.

[PATCH v2] tpm: ibmvtpm: Call tpm2_sessions_init() to initialize session support

2024-07-29 Thread Stefan Berger
he missing call to tpm2_session_init() to the ibmvtpm driver to resolve this issue. Fixes: d2add27cf2b8 ("tpm: Add NULL primary creation") Signed-off-by: Stefan Berger --- drivers/char/tpm/tpm_ibmvtpm.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/char/tpm/tpm_ibmvtpm.

Re: [PATCH v2 3/3] tpm: Address !chip->auth in tpm_buf_append_hmac_session*()

2024-07-05 Thread Stefan Berger
On 7/4/24 02:41, Jarkko Sakkinen wrote: On Thu Jul 4, 2024 at 4:56 AM EEST, Stefan Berger wrote: On 7/3/24 14:24, Jarkko Sakkinen wrote: Unless tpm_chip_bootstrap() was called by the driver, !chip->auth can Doesn't tpm_chip_register() need to be called by all drivers? This funct

Re: [PATCH v2 3/3] tpm: Address !chip->auth in tpm_buf_append_hmac_session*()

2024-07-03 Thread Stefan Berger
ess !chip->auth in tpm_buf_hmac_session*() and remove the fallback implementation for !TCG_TPM2_HMAC. Cc: sta...@vger.kernel.org # v6.9+ Reported-by: Stefan Berger Closes: https://lore.kernel.org/linux-integrity/20240617193408.1234365-1-stef...@linux.ibm.com/ Fixes: 1085b8276bb4 ("tpm: A

Re: [ima-evm-utils PATCH] Require specifying openssl PKCS11 engine or provider access method

2024-07-02 Thread Stefan Berger
ction and deprecate sign_hash") Signed-off-by: Mimi Zohar Reviewed-by: Stefan Berger --- src/libimaevm.c | 5 + 1 file changed, 5 insertions(+) diff --git a/src/libimaevm.c b/src/libimaevm.c index a0176c0df9ef..6321f105d91f 100644 --- a/src/libimaevm.c +++ b/src/libimaevm.c @@ -1118,

Re: [PATCH] tpm: Check non-nullity of chip->auth

2024-07-01 Thread Stefan Berger
On 7/1/24 13:07, Jarkko Sakkinen wrote: All exported functions lack the check for non-nullity of chip->auth. Add the guard for each. Link: https://lore.kernel.org/linux-integrity/9f86a167074d9b522311715c567f1c19b88e3ad4.ca...@kernel.org/ Cc: Stefan Berger Cc: sta...@vger.kernel.org

Re: [PATCH] tpm: ibmvtpm: Call tpm2_sessions_init() to initialize session support

2024-07-01 Thread Stefan Berger
On 7/1/24 15:01, Jarkko Sakkinen wrote: On Mon Jul 1, 2024 at 6:29 PM UTC, Stefan Berger wrote: On 7/1/24 11:22, Jarkko Sakkinen wrote: On Fri, 2024-06-28 at 17:00 +0200, Linux regression tracking (Thorsten Leemhuis) wrote: [CCing the regression list] On 20.06.24 00:34, Stefan Berger

Re: [PATCH] tpm: ibmvtpm: Call tpm2_sessions_init() to initialize session support

2024-07-01 Thread Stefan Berger
On 7/1/24 15:01, Jarkko Sakkinen wrote: On Mon Jul 1, 2024 at 6:29 PM UTC, Stefan Berger wrote: On 7/1/24 11:22, Jarkko Sakkinen wrote: On Fri, 2024-06-28 at 17:00 +0200, Linux regression tracking (Thorsten Leemhuis) wrote: [CCing the regression list] On 20.06.24 00:34, Stefan Berger

Re: [PATCH] tpm: ibmvtpm: Call tpm2_sessions_init() to initialize session support

2024-07-01 Thread Stefan Berger
On 7/1/24 11:22, Jarkko Sakkinen wrote: On Fri, 2024-06-28 at 17:00 +0200, Linux regression tracking (Thorsten Leemhuis) wrote: [CCing the regression list] On 20.06.24 00:34, Stefan Berger wrote: Jarkko,   are you ok with this patch? Hmmm, hope I did not miss anythng, but looks like

Re: [PATCH] tpm: ibmvtpm: Call tpm2_sessions_init() to initialize session support

2024-07-01 Thread Stefan Berger
On 7/1/24 11:22, Jarkko Sakkinen wrote: On Fri, 2024-06-28 at 17:00 +0200, Linux regression tracking (Thorsten Leemhuis) wrote: [CCing the regression list] On 20.06.24 00:34, Stefan Berger wrote: Jarkko,   are you ok with this patch? Hmmm, hope I did not miss anythng, but looks like

Re: [PATCH] tpm: ibmvtpm: Call tpm2_sessions_init() to initialize session support

2024-06-28 Thread Stefan Berger
On 6/28/24 12:39, James Bottomley wrote: On Fri, 2024-06-28 at 10:54 +1000, Michael Ellerman wrote: Stefan Berger writes: Fix the following type of error message caused by a missing call to tpm2_sessions_init() in the IBM vTPM driver: [    2.987131] tpm tpm0: tpm2_load_context: failed

Re: [PATCH] tpm: ibmvtpm: Call tpm2_sessions_init() to initialize session support

2024-06-28 Thread Stefan Berger
On 6/28/24 12:39, James Bottomley wrote: On Fri, 2024-06-28 at 10:54 +1000, Michael Ellerman wrote: Stefan Berger writes: Fix the following type of error message caused by a missing call to tpm2_sessions_init() in the IBM vTPM driver: [    2.987131] tpm tpm0: tpm2_load_context: failed

[ima-evm-utils][PATCH v2 1/4] Call OPENSSL_Cleanup before main exit to avoid crashes when engine was used

2024-06-24 Thread Stefan Berger
From: Stefan Berger When OPENSSL_Cleanup is called via destructor after main() was left then evmctl crashes on Ubuntu 24.04 (Noble). This can be avoided by calling OpenSSL_Cleanup explicitly before leaving main(). Link: https://bugs.launchpad.net/ubuntu/+source/softhsm2/+bug/2059340 Signed-off

[ima-evm-utils][PATCH v2 3/4] CI/CD: Prepare Ubuntu 24.04 (Noble) to run provider tests

2024-06-24 Thread Stefan Berger
From: Stefan Berger With provider support fixed for Ubuntu 24.04 (Noble), prepare for enabling testing with it. To test provider support on Ubuntu, make a copy of the debian.sh install file and enable the installation of provider support there. Signed-off-by: Stefan Berger --- ci/ubuntu.sh

[ima-evm-utils][PATCH v2 4/4] Replace Ubuntu mantic with noble

2024-06-24 Thread Stefan Berger
As Ubuntu noble contains a pkcs11-provider package, use it for testing. Also use the distro provided openssl version. Suggested-by: Stefan Berger Signed-off-by: Mimi Zohar --- .github/workflows/ci.yml | 5 ++--- .travis.yml | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions

[ima-evm-utils][PATCH v2 2/4] CI/CD: Disable pkcs11 providers for Debian and AltLinux

2024-06-24 Thread Stefan Berger
From: Stefan Berger Disable testing provider support on Debian:latest and AltLinux:sisyphus since both now get stuck while running OpenSSL provider-related tests. This is most likely due to an update in a dependency (OpenSSL, p11-kit-modules, softhsm, or others). On AltLinux the issues

[ima-evm-utils][PATCH v2 0/4] Enable and disable OpenSSL provider tests

2024-06-24 Thread Stefan Berger
com/T/#meb2e76c337fe8d140cdbcc699c0606d31d7749a2 v2: - dropped ci/cd changes from 3/4 in favor of 4/4 Regards, Stefan Stefan Berger (4): Call OPENSSL_Cleanup before main exit to avoid crashes when engine was used CI/CD: Disable pkcs11 providers for Debian and AltLinux CI/CD: Prep

[ima-evm-utils][PATCH 2/3] CI/CD: Disable pkcs11 providers for Debian and AltLinux

2024-06-20 Thread Stefan Berger
From: Stefan Berger Disable testing provider support on Debian:latest and AltLinux:sisyphus since both now get stuck while running OpenSSL provider-related tests. This is most likely due to an update in a dependency (OpenSSL, libp11, softhsm, or others). On AltLinux the issues is related

[ima-evm-utils][PATCH 0/3] Enable and disable OpenSSL provider tests

2024-06-20 Thread Stefan Berger
From: Stefan Berger This series enables tests with OpenSSL providers on Ubuntu for testing with pkcs11 and SoftHSM. At the same time it disables testing with OpenSSL providers on AltLinux and Debian due to an issue that most likely stems from a bug in a dependency (OpenSSL, libp11, SoftHSM

[ima-evm-utils][PATCH 3/3] CI/CD: Also enable Ubuntu 24.04 (Noble) and run provider tests

2024-06-20 Thread Stefan Berger
From: Stefan Berger With provider support fixed for Ubuntu 24.04 (Noble), enable testing with it. To test provider support on Ubuntu, make a copy of the debian.sh install file and enable the installation of provider support there. Signed-off-by: Stefan Berger --- .github/workflows/ci.yml | 5

[ima-evm-utils][PATCH 1/3] Call OPENSSL_Cleanup before main exit to avoid crashes when engine was used

2024-06-20 Thread Stefan Berger
From: Stefan Berger When OPENSSL_Cleanup is called via destructor after main() was left then evmctl crashes on Ubuntu 24.04 (Noble). This can be avoided by calling OpenSSL_Cleanup explicitly before leaving main(). Link: https://bugs.launchpad.net/ubuntu/+source/softhsm2/+bug/2059340 Signed-off

Re: [PATCH] tpm: ibmvtpm: Call tpm2_sessions_init() to initialize session support

2024-06-19 Thread Stefan Berger
Jarkko, are you ok with this patch? Stefan On 6/17/24 15:34, Stefan Berger wrote: Fix the following type of error message caused by a missing call to tpm2_sessions_init() in the IBM vTPM driver: [2.987131] tpm tpm0: tpm2_load_context: failed with a TPM error 0x01C4 [2.987140] ima

Re: [PATCH] tpm: ibmvtpm: Call tpm2_sessions_init() to initialize session support

2024-06-19 Thread Stefan Berger
Jarkko, are you ok with this patch? Stefan On 6/17/24 15:34, Stefan Berger wrote: Fix the following type of error message caused by a missing call to tpm2_sessions_init() in the IBM vTPM driver: [2.987131] tpm tpm0: tpm2_load_context: failed with a TPM error 0x01C4 [2.987140] ima

Re: [PATCH] tpm: ibmvtpm: Call tpm2_sessions_init() to initialize session support

2024-06-17 Thread Stefan Berger
On 6/17/24 16:05, James Bottomley wrote: On Mon, 2024-06-17 at 15:56 -0400, Stefan Berger wrote: On 6/17/24 15:42, James Bottomley wrote: On Mon, 2024-06-17 at 15:34 -0400, Stefan Berger wrote: Fix the following type of error message caused by a missing call to tpm2_sessions_init

Re: [PATCH] tpm: ibmvtpm: Call tpm2_sessions_init() to initialize session support

2024-06-17 Thread Stefan Berger
On 6/17/24 16:05, James Bottomley wrote: On Mon, 2024-06-17 at 15:56 -0400, Stefan Berger wrote: On 6/17/24 15:42, James Bottomley wrote: On Mon, 2024-06-17 at 15:34 -0400, Stefan Berger wrote: Fix the following type of error message caused by a missing call to tpm2_sessions_init

Re: [PATCH] tpm: ibmvtpm: Call tpm2_sessions_init() to initialize session support

2024-06-17 Thread Stefan Berger
On 6/17/24 15:42, James Bottomley wrote: On Mon, 2024-06-17 at 15:34 -0400, Stefan Berger wrote: Fix the following type of error message caused by a missing call to tpm2_sessions_init() in the IBM vTPM driver: [    2.987131] tpm tpm0: tpm2_load_context: failed with a TPM error 0x01C4

Re: [PATCH] tpm: ibmvtpm: Call tpm2_sessions_init() to initialize session support

2024-06-17 Thread Stefan Berger
On 6/17/24 15:42, James Bottomley wrote: On Mon, 2024-06-17 at 15:34 -0400, Stefan Berger wrote: Fix the following type of error message caused by a missing call to tpm2_sessions_init() in the IBM vTPM driver: [    2.987131] tpm tpm0: tpm2_load_context: failed with a TPM error 0x01C4

[PATCH] tpm: ibmvtpm: Call tpm2_sessions_init() to initialize session support

2024-06-17 Thread Stefan Berger
imary creation") Signed-off-by: Stefan Berger --- drivers/char/tpm/tpm_ibmvtpm.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/char/tpm/tpm_ibmvtpm.c b/drivers/char/tpm/tpm_ibmvtpm.c index d3989b257f42..1e5b107d1f3b 100644 --- a/drivers/char/tpm/tpm_ibmvtpm.c +++ b/driver

[PATCH] tpm: ibmvtpm: Call tpm2_sessions_init() to initialize session support

2024-06-17 Thread Stefan Berger
imary creation") Signed-off-by: Stefan Berger --- drivers/char/tpm/tpm_ibmvtpm.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/char/tpm/tpm_ibmvtpm.c b/drivers/char/tpm/tpm_ibmvtpm.c index d3989b257f42..1e5b107d1f3b 100644 --- a/drivers/char/tpm/tpm_ibmvtpm.c +++ b/driver

[Bug 2059340] Re: crash in libsofthsm2 on armhf after time_t transition

2024-06-11 Thread Stefan Berger
I have encountered a similar problem when running test case of ima-evm- utils with softhsm used as engine on Ubuntu 24.04 (Noble). In this case I am also crashing in pkcs11_slot_unref when this line here is called: CRYPTOKI_call(slot->ctx, C_CloseAllSessions(slot->id));

Re: [PATCH 1/5] backends/tpm: Remove newline character in trace event

2024-06-07 Thread Stefan Berger
r *buf) "%s" # tpm_emulator.c tpm_emulator_set_locality(uint8_t locty) "setting locality to %d" Reviewed-by: Stefan Berger

[ima-evm-utils PATCH 1/2] evmctl: Replace OSS_PROVIDER_load with OSSL_PROVIDER_try_load (Ubuntu)

2024-05-14 Thread Stefan Berger
evmctl ima_sign failed with (1) EVP_DigestInit() failed openssl: error:0308010C:digital envelope routines::unsupported openssl: error:0386:digital envelope routines::initialization error Signed-off-by: Stefan Berger --- src/evmctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion

[ima-evm-utils PATCH 0/2] Fix issue with tests and provider on Ubuntu 24.04

2024-05-14 Thread Stefan Berger
Stefan Berger (2): evmctl: Replace OSS_PROVIDER_load with OSSL_PROVIDER_try_load (Ubuntu) tests: Use EVMCTL_ENGINE to set engine or provider for test case src/evmctl.c | 2 +- tests/sign_verify.test | 8 2 files changed, 5 insertions(+), 5 deletions(-) -- 2.45.0

[ima-evm-utils PATCH 2/2] tests: Use EVMCTL_ENGINE to set engine or provider for test case

2024-05-14 Thread Stefan Berger
the pkcs11-provider instead and not force usage of the engine by passing '--engine pkcs11' to the command line. Fixes: ffde173250 ("tests: Add pkcs11 test using provider") Signed-off-by: Stefan Berger --- tests/sign_verify.test | 8 1 file changed, 4 insertions(+), 4 deletion

Re: [PATCH v10 2/2] tpm: add backend for mssim

2024-05-01 Thread Stefan Berger
On 5/1/24 12:52, James Bottomley wrote: On Wed, 2024-05-01 at 12:31 -0400, Stefan Berger wrote: On 5/1/24 12:21, James Bottomley wrote: On Tue, 2024-04-30 at 17:12 -0400, Stefan Berger wrote: On 4/30/24 15:08, James Bottomley wrote: [...] +The mssim backend supports snapshotting

Re: [PATCH v10 2/2] tpm: add backend for mssim

2024-05-01 Thread Stefan Berger
On 5/1/24 12:21, James Bottomley wrote: On Tue, 2024-04-30 at 17:12 -0400, Stefan Berger wrote: On 4/30/24 15:08, James Bottomley wrote: [...] +The mssim backend supports snapshotting and migration by not resetting I don't thing snapshotting is supported because snapshooting would

Re: [PATCH v10 0/2] tpm: add mssim backend

2024-04-30 Thread Stefan Berger
On 4/30/24 15:08, James Bottomley wrote: The requested feedback was to convert the tpmdev handler to being json based, which requires rethreading all the backends. The good news is this reduced quite a bit of code (especially as I converted it to error_fatal handling as well, which removes

Re: [PATCH v10 2/2] tpm: add backend for mssim

2024-04-30 Thread Stefan Berger
On 4/30/24 15:08, James Bottomley wrote: The Microsoft Simulator (mssim) is the reference emulation platform for the TCG TPM 2.0 specification. https://github.com/Microsoft/ms-tpm-20-ref.git It exports a fairly simple network socket based protocol on two sockets, one for command (default

Re: [PATCH v8 00/22] add integrity and security to TPM2 transactions

2024-04-30 Thread Stefan Berger
On 4/30/24 14:37, Jarkko Sakkinen wrote: On Tue Apr 30, 2024 at 2:18 PM EEST, Stefan Berger wrote: On 4/29/24 19:49, Jarkko Sakkinen wrote: On Tue Apr 30, 2024 at 1:26 AM EEST, Jarkko Sakkinen wrote: Right and obviously 3rd option is to send a PR to https://gitlab.com/jarkkojs/linux

Re: [PATCH v13 04/20] libtasn1: changes for grub compatibility

2024-04-30 Thread Stefan Berger
Reviewed-by: Stefan Berger --- grub-core/lib/libtasn1/lib/decoding.c | 8 grub-core/lib/libtasn1/lib/element.c| 2 +- grub-core/lib/libtasn1/lib/gstr.c | 2 +- grub-core/lib/libtasn1/lib/int.h| 3 +-- grub-core/lib/libtasn1/lib/parser_aux.c | 2 +- in

Re: [PATCH v8 00/22] add integrity and security to TPM2 transactions

2024-04-30 Thread Stefan Berger
On 4/29/24 19:49, Jarkko Sakkinen wrote: On Tue Apr 30, 2024 at 1:26 AM EEST, Jarkko Sakkinen wrote: Right and obviously 3rd option is to send a PR to https://gitlab.com/jarkkojs/linux-tpmdd-test. I.e. patch file goes to patches/qemu (BR2_GLOBAL_PATCH_DIR points there). Stefan, can I do a

[PATCH ima-evm-utils] First try to get keyid from cert then fall back to calculating

2024-04-29 Thread Stefan Berger
then fall back to calculating it from the public key. This way signature verification will first use the same method to get the key id as the Linux kernel does. Signed-off-by: Stefan Berger --- src/libimaevm.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/libimaevm.c b

Re: [RFC PATCH v2 0/2] ima: Fix detection of read/write violations on stacked filesystems

2024-04-23 Thread Stefan Berger
On 4/23/24 02:02, Amir Goldstein wrote: On Mon, Apr 22, 2024 at 6:07 PM Stefan Berger wrote: This series fixes the detection of read/write violations on stacked filesystems. To be able to access the relevant dentries necessary to detect files opened for writing on a stacked filesystem

[RFC PATCH v2 2/2] ima: Fix detection of read/write violations on stacked filesystems

2024-04-22 Thread Stefan Berger
by again calling d_real. On a normal filesystem this would return the same dentry as before and on a stacked filesystem it would return the next-level dentry, so either the upper or lower dentry of the next lower layer. Signed-off-by: Stefan Berger --- security/integrity/ima/ima_main.c | 21

[RFC PATCH v2 0/2] ima: Fix detection of read/write violations on stacked filesystems

2024-04-22 Thread Stefan Berger
in a stacked filesystem while traversing the layers. Stefan v2: - Simplified 2nd patch - Improvements on patch description on 1st patch Stefan Berger (2): ovl: Define D_REAL_FILEDATA for d_real to return dentry with data ima: Fix detection of read/write violations on stacked filesystems

[RFC PATCH v2 1/2] ovl: Define D_REAL_FILEDATA for d_real to return dentry with data

2024-04-22 Thread Stefan Berger
. This allows a caller to get all dentries involved in hold a file's data and iterate through the layers. Signed-off-by: Stefan Berger --- fs/overlayfs/super.c | 6 ++ include/linux/dcache.h | 1 + 2 files changed, 7 insertions(+) diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c

Re: [PATCH v12 10/20] tpm2: Add TPM Software Stack (TSS)

2024-04-19 Thread Stefan Berger
, TPM2_TestParms Cc: Stefan Berger Signed-off-by: Hernan Gatta Signed-off-by: Gary Lin Reviewed-by: Stefan Berger ___ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel

Re: [PATCH v12 13/20] util/grub-protect: Add new tool

2024-04-19 Thread Stefan Berger
in the key file, so there is no need to specify PCRs when invoking tpm2_key_protector_init. Cc: Stefan Berger Signed-off-by: Hernan Gatta Signed-off-by: Gary Lin Reviewed-by: Stefan Berger ___ Grub-devel mailing list Grub-devel@gnu.org https

Re: [PATCH v12 18/20] diskfilter: look up cryptodisk devices first

2024-04-19 Thread Stefan Berger
will be found first, not the attacker's disk. Signed-off-by: Gary Lin Cc: Fabian Vogt Reviewed-by: Stefan Berger --- grub-core/disk/diskfilter.c | 35 ++- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/grub-core/disk/diskfilter.c b/grub-core

Re: [PATCH v12 20/20] tests: Add tpm2_test

2024-04-19 Thread Stefan Berger
image, try to mount the image with tpm2_key_protector_init and cryptomount, and verify the result. Based on the idea from Michael Chang. Cc: Michael Chang Cc: Stefan Berger Signed-off-by: Gary Lin --- Makefile.util.def| 6 + tests/tpm2_test.in | 311

Re: [PATCH v12 16/20] cryptodisk: Fallback to passphrase

2024-04-19 Thread Stefan Berger
` is now set. Print the existing errors out first, before proceeding with the passphrase. Cc: Stefan Berger Signed-off-by: Patrick Colp Signed-off-by: Gary Lin Reviewed-by: Stefan Berger --- grub-core/disk/cryptodisk.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git

Re: [PATCH v2 5/5] qemu: Always set labels for TPM state

2024-04-18 Thread Stefan Berger
, but also because no such check currently exists for disks and other types of persistent storage such as NVRAM files, which always get relabeled. Signed-off-by: Andrea Bolognani Reviewed-by: Stefan Berger --- src/qemu/qemu_tpm.c | 11 ++- 1 file changed, 2 insertions(+), 9 deletions

Re: [PATCH v2 3/5] qemu: Propagate shared_filesystems

2024-04-18 Thread Stefan Berger
several layers in order to make use of it. Note that with this change the list is propagated all the way through, but its contents are still ignored, so the behavior remains the same for now. Signed-off-by: Andrea Bolognani Reviewed-by: Stefan Berger

Re: [PATCH v2 4/5] utils: Use overrides in virFileIsSharedFS()

2024-04-18 Thread Stefan Berger
'/' then. It may be wroth mentioning this in 2/5. Reviewed-by: Stefan Berger + +if (g_strv_contains((const char *const *) overrides, dirpath)) +return true; +} + +return false; +} + int virFileIsSharedFS(const char *path, - char *const

Re: [PATCH 09/10] qemu: Always set labels for TPM state

2024-04-18 Thread Stefan Berger
On 4/17/24 11:20, Andrea Bolognani wrote: On Wed, Mar 20, 2024 at 09:10:48AM -0700, Andrea Bolognani wrote: On Wed, Mar 20, 2024 at 10:18:39AM -0400, Stefan Berger wrote: On 3/20/24 08:23, Peter Krempa wrote: Did you consider the case when the migration fails and the VM will be restored

Re: [PATCH v2 2/5] qemu: Introduce shared_filesystems configuration option

2024-04-17 Thread Stefan Berger
On 4/17/24 09:29, Andrea Bolognani wrote: As explained in the comment, this can help in scenarios where a shared filesystem can't be detected as such by libvirt, by giving the admin the opportunity to provide this information manually. Signed-off-by: Andrea Bolognani ---

Re: [PATCH v2 1/5] security: Fix alignment

2024-04-17 Thread Stefan Berger
On 4/17/24 09:29, Andrea Bolognani wrote: Signed-off-by: Andrea Bolognani Reviewed-by: Stefan Berger --- src/security/security_selinux.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/security/security_selinux.c b/src/security/security_selinux.c index

Re: [PATCH v11 00/20] Automatic Disk Unlock with TPM2

2024-04-15 Thread Stefan Berger
On 4/15/24 05:45, Gary Lin wrote: On Fri, Apr 12, 2024 at 12:24:36PM -0400, Stefan Berger wrote: On 4/12/24 04:39, Gary Lin via Grub-devel wrote: GIT repo for v11: https://github.com/lcp/grub2/tree/tpm2-unlock-v11 This patch series is based on "Automatic TPM Disk Unlock"(

Re: [PATCH v11 16/20] cryptodisk: Fallback to passphrase

2024-04-12 Thread Stefan Berger
On 4/12/24 04:39, Gary Lin via Grub-devel wrote: From: Patrick Colp If a protector is specified, but it fails to unlock the disk, fall back to asking for the passphrase. However, an error was set indicating that the protector(s) failed. Later code (e.g., LUKS code) fails as `grub_errno` is

Re: [PATCH v11 17/20] cryptodisk: wipe out the cached keys from protectors

2024-04-12 Thread Stefan Berger
to retrieve the secret key. To defend such attack, wipe out the cached key when we don't need it. Signed-off-by: Gary Lin Cc: Fabian Vogt Reviewed-by: Stefan Berger --- grub-core/disk/cryptodisk.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/grub-core/disk

Re: [PATCH v11 19/20] tpm2: Enable tpm2 module for grub-emu

2024-04-12 Thread Stefan Berger
the device node on host, it's easy to implement the essential TCG2 command submission function with the read/write functions and enable tpm2 module for grub-emu, so that we can further test TPM key unsealing with grub-emu. Signed-off-by: Gary Lin Reviewed-by: Stefan Berger --- grub-core

Re: [PATCH v11 15/20] tpm2: Implement NV index

2024-04-12 Thread Stefan Berger
off-by: Patrick Colp Signed-off-by: Gary Lin Reviewed-by: Stefan Berger --- grub-core/tpm2/module.c | 25 - 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/grub-core/tpm2/module.c b/grub-core/tpm2/module.c index 0ed8f2682..b4d588b0c 100644 --- a/grub-core/t

Re: [PATCH v11 13/20] util/grub-protect: Add new tool

2024-04-12 Thread Stefan Berger
On 4/12/24 04:39, Gary Lin via Grub-devel wrote: From: Hernan Gatta To utilize the key protectors framework, there must be a way to protect full-disk encryption keys in the first place. The grub-protect tool includes support for the TPM2 key protector but other protectors that require setup

Re: [PATCH v11 12/20] cryptodisk: Support key protectors

2024-04-12 Thread Stefan Berger
to unlock %s%s%s (%s)\n", + cargs->protectors[i], source->name, +source->partition != NULL ? "," : "", +part != NULL ? part : N_("UNKNOWN"), dev->uuid); + grub_free (part); +

Re: [RFC 2/2] ima: Fix detection of read/write violations on stacked filesystems

2024-04-12 Thread Stefan Berger
On 4/12/24 14:08, Amir Goldstein wrote: On Fri, Apr 12, 2024 at 5:01 PM Stefan Berger wrote: On a stacked filesystem, when one process opens the file holding a file's data (e.g., on upper or lower layer on overlayfs) then issue a violation when another process opens the file for reading

Re: [PATCH v11 11/20] key_protector: Add TPM2 Key Protector

2024-04-12 Thread Stefan Berger
On 4/12/24 04:39, Gary Lin via Grub-devel wrote: From: Hernan Gatta The TPM2 key protector is a module that enables the automatic retrieval of a fully-encrypted disk's unlocking key from a TPM 2.0. A few minor finds/comments below. The theory of operation is such that the module accepts

Re: [PATCH v11 09/20] key_protector: Add key protectors framework

2024-04-12 Thread Stefan Berger
otector_unregister (struct grub_key_protector *protector); + +grub_err_t +grub_key_protector_recover_key (const char *protector, + grub_uint8_t **key, + grub_size_t *key_size); + +#endif /* ! GRUB_PROTECTOR_HEADER */ with nit fixed: Reviewed-by: Stefan Ber

Re: [PATCH v11 00/20] Automatic Disk Unlock with TPM2

2024-04-12 Thread Stefan Berger
module for libtasn1 -: - > 8: 7a1aced55 libtasn1: Add the documentation -: ----- > 9: 957b048f2 key_protector: Add key protectors framework 1: ca024f496 ! 10: cbeaf8472 tpm2: Add TPM Software Stack (TSS) @@ Commit message TPM2_SequenceComplete, TPM2_Hash, TPM2_Ver

Re: [PATCH v11 14/20] tpm2: Support authorized policy

2024-04-12 Thread Stefan Berger
n the boot components, just run the 'sign' command again to update the signature in sealed.tpm, and TPM can unseal the key file with the updated PCR policy. (*1) https://www.hansenpartnership.com/draft-bottomley-tpm2-keys.html (*2) https://github.com/okirch/pcr-oracle Signed-off-by: Gary Lin Reviewed-

Re: [PATCH v10 20/20] tests: Add tpm2_test

2024-04-12 Thread Stefan Berger
On 4/9/24 04:30, Gary Lin via Grub-devel wrote: For the tpm2 module, the TCG2 command submission function is the only difference between the a QEMU instance and grub-emu. To test TPM key unsealing with a QEMU instance, it requires an extra OS image to invoke grub-protect to seal the LUKS key,

Re: [PATCH v11 10/20] tpm2: Add TPM Software Stack (TSS)

2024-04-12 Thread Stefan Berger
On 4/12/24 04:39, Gary Lin wrote: From: Hernan Gatta A Trusted Platform Module (TPM) Software Stack (TSS) provides logic to compose, submit, and parse TPM commands and responses. compose and submit TPM commands and parse reponses. A limited number of TPM commands may be accessed via the

[RFC 0/2] ima: Fix detection of read/write violations on stacked filesystems

2024-04-12 Thread Stefan Berger
in a stacked filesystem. Stefan Stefan Berger (2): ovl: Define D_REAL_FILEDATA for d_real to return dentry with data ima: Fix detection of read/write violations on stacked filesystems fs/overlayfs/super.c | 6 ++ include/linux/dcache.h| 1 + security

[RFC 1/2] ovl: Define D_REAL_FILEDATA for d_real to return dentry with data

2024-04-12 Thread Stefan Berger
. Signed-off-by: Stefan Berger --- fs/overlayfs/super.c | 6 ++ include/linux/dcache.h | 1 + 2 files changed, 7 insertions(+) diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c index 06a231970cb5..f466ad89b005 100644 --- a/fs/overlayfs/super.c +++ b/fs/overlayfs/super.c @@ -36,6

[RFC 2/2] ima: Fix detection of read/write violations on stacked filesystems

2024-04-12 Thread Stefan Berger
where a violation is generated when one process opens a file for writing and another one opens the same file for reading. On stacked filesystem also search all the lower layers for relevant files opened for writing and issue the violation if one is found. Signed-off-by: Stefan Berger

Re: [PATCH 12/12] backends/tpm: Use qemu_hexdump_line() to avoid sprintf()

2024-04-10 Thread Stefan Berger
t; Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Stefan Berger --- backends/tpm/tpm_util.c | 24 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/backends/tpm/tpm_util.c b/backends/tpm/tpm_util.c index 1856589c3b..0747af2d1c 100644 --- a/backends/t

Re: [PATCH 12/12] backends/tpm: Use qemu_hexdump_line() to avoid sprintf()

2024-04-10 Thread Stefan Berger
t; Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Stefan Berger --- backends/tpm/tpm_util.c | 24 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/backends/tpm/tpm_util.c b/backends/tpm/tpm_util.c index 1856589c3b..0747af2d1c 100644 --- a/backends/t

Re: [PATCH v10 10/20] tpm2: Add TPM Software Stack (TSS)

2024-04-09 Thread Stefan Berger
On 4/9/24 04:30, Gary Lin via Grub-devel wrote: From: Hernan Gatta A Trusted Platform Module (TPM) Software Stack (TSS) provides logic to compose, submit, and parse TPM commands and responses. A limited number of TPM commands may be accessed via the EFI TCG2 protocol. This protocol exposes

Re: [PATCH 06/10] qemu: Introduce shared_filesystems configuration option

2024-03-26 Thread Stefan Berger
On 3/26/24 12:38, Andrea Bolognani wrote: On Tue, Mar 26, 2024 at 12:04:21PM -0400, Stefan Berger wrote: On 3/26/24 11:54, Andrea Bolognani wrote: On Wed, Mar 20, 2024 at 08:43:24AM -0700, Andrea Bolognani wrote: On Wed, Mar 20, 2024 at 12:37:37PM +0100, Peter Krempa wrote: On Wed, Mar

Re: [PATCH 06/10] qemu: Introduce shared_filesystems configuration option

2024-03-26 Thread Stefan Berger
On 3/26/24 11:54, Andrea Bolognani wrote: On Wed, Mar 20, 2024 at 08:43:24AM -0700, Andrea Bolognani wrote: On Wed, Mar 20, 2024 at 12:37:37PM +0100, Peter Krempa wrote: On Wed, Mar 20, 2024 at 10:19:11 +0100, Andrea Bolognani wrote: +# libvirt will normally prevent migration if the storage

[PATCH] ima: Fix use-after-free on a dentry's dname.name

2024-03-22 Thread Stefan Berger
ble snapshot of the name instead. Link: https://lore.kernel.org/all/20240202182732.GE2087318@ZenIV/ Signed-off-by: Al Viro Signed-off-by: Stefan Berger --- security/integrity/ima/ima_api.c | 16 security/integrity/ima/ima_template_lib.c | 17 ++--- 2 files

Re: [PATCH 10/10] NEWS: Document qemu shared_filesystems option

2024-03-20 Thread Stefan Berger
On 3/20/24 11:59, Andrea Bolognani wrote: On Wed, Mar 20, 2024 at 10:07:11AM -0400, Stefan Berger wrote: On 3/20/24 05:19, Andrea Bolognani wrote: + * qemu: Add ``shared_filesystems`` configuration option + +This option can be used to configure libvirt so that migration between two

Re: [PATCH 02/10] security: Fix name for _virSecurityDACChardevCallbackData

2024-03-20 Thread Stefan Berger
On 3/20/24 05:19, Andrea Bolognani wrote: It was clearly copied over from the SELinux driver without updating its name in the process. Signed-off-by: Andrea Bolognani Reviewed-by: Stefan Berger ___ Devel mailing list -- devel@lists.libvirt.org

Re: [PATCH 09/10] qemu: Always set labels for TPM state

2024-03-20 Thread Stefan Berger
On 3/20/24 08:23, Peter Krempa wrote: On Wed, Mar 20, 2024 at 10:19:14 +0100, Andrea Bolognani wrote: Up until this point, we have avoided setting labels for incoming migration when the TPM state is stored on a shared filesystem. This seems to make sense, because since the underlying storage

Re: [PATCH 10/10] NEWS: Document qemu shared_filesystems option

2024-03-20 Thread Stefan Berger
On 3/20/24 05:19, Andrea Bolognani wrote: Signed-off-by: Andrea Bolognani --- NEWS.rst | 7 +++ 1 file changed, 7 insertions(+) diff --git a/NEWS.rst b/NEWS.rst index 489201d3fc..7e17043c2a 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -17,6 +17,13 @@ v10.2.0 (unreleased) * **New

Re: [PATCH 01/10] security: Fix alignment

2024-03-20 Thread Stefan Berger
On 3/20/24 05:19, Andrea Bolognani wrote: Signed-off-by: Andrea Bolognani Reviewed-by: Stefan Berger ___ Devel mailing list -- devel@lists.libvirt.org To unsubscribe send an email to devel-le...@lists.libvirt.org

Re: [PATCH 05/10] qemu: Tweak augeas schema

2024-03-20 Thread Stefan Berger
g ... *) let entry = default_tls_entry | vnc_entry Reviewed-by: Stefan Berger ___ Devel mailing list -- devel@lists.libvirt.org To unsubscribe send an email to devel-le...@lists.libvirt.org

Re: [PATCH 04/10] security: Drop virSecurity(DAC|SELinux)SetImageLabelRelative()

2024-03-20 Thread Stefan Berger
On 3/20/24 05:19, Andrea Bolognani wrote: The single caller for each function passes the same value for @src and @parent, which means that we don't really need the additional API. Signed-off-by: Andrea Bolognani Reviewed-by: Stefan Berger

Re: [PATCH 03/10] security: Drop virSecurity(DAC|SELinux)RestoreImageLabelSingle()

2024-03-20 Thread Stefan Berger
On 3/20/24 05:19, Andrea Bolognani wrote: Each one only has a single, trivial caller. Signed-off-by: Andrea Bolognani Reviewed-by: Stefan Berger ___ Devel mailing list -- devel@lists.libvirt.org To unsubscribe send an email to devel-le

Re: [PATCH 2/6] ieee1275/powerpc: enables device mapper discovery

2024-03-15 Thread Stefan Berger
On 3/15/24 00:06, Michael Chang via Grub-devel wrote: On Mon, May 08, 2023 at 01:58:36PM +, Avnish Chouhan wrote: From: Diego Domingos This patch enables the device mapper discovery on ofpath.c. Currently, when we are dealing with a device like /dev/dm-* the ofpath returns null since

Re: [RFC PATCH v2 3/3] tpm: of: If available use linux,sml-log to get the log and its size

2024-03-12 Thread Stefan Berger
On 3/12/24 11:43, Jarkko Sakkinen wrote: On Mon Mar 11, 2024 at 10:33 PM EET, Stefan Berger wrote: On 3/11/24 16:25, Jarkko Sakkinen wrote: On Mon Mar 11, 2024 at 3:20 PM EET, Stefan Berger wrote: If linux,sml-log is available use it to get the TPM log rather than the pointer found

Re: [RFC PATCH v2 3/3] tpm: of: If available use linux,sml-log to get the log and its size

2024-03-12 Thread Stefan Berger
On 3/12/24 11:43, Jarkko Sakkinen wrote: On Mon Mar 11, 2024 at 10:33 PM EET, Stefan Berger wrote: On 3/11/24 16:25, Jarkko Sakkinen wrote: On Mon Mar 11, 2024 at 3:20 PM EET, Stefan Berger wrote: If linux,sml-log is available use it to get the TPM log rather than the pointer found

Re: [PATCH 1/2] powerpc/prom_init: Replace linux,sml-base/sml-size with linux,sml-log

2024-03-12 Thread Stefan Berger
On 3/12/24 12:22, Rob Herring wrote: On Tue, Mar 12, 2024 at 09:32:50PM +1100, Michael Ellerman wrote: Rob Herring writes: On Fri, Mar 08, 2024 at 07:23:35AM -0500, Stefan Berger wrote: On 3/7/24 16:52, Rob Herring wrote: On Thu, Mar 07, 2024 at 09:41:31PM +1100, Michael Ellerman wrote

Re: [PATCH 1/2] powerpc/prom_init: Replace linux,sml-base/sml-size with linux,sml-log

2024-03-12 Thread Stefan Berger
On 3/12/24 12:22, Rob Herring wrote: On Tue, Mar 12, 2024 at 09:32:50PM +1100, Michael Ellerman wrote: Rob Herring writes: On Fri, Mar 08, 2024 at 07:23:35AM -0500, Stefan Berger wrote: On 3/7/24 16:52, Rob Herring wrote: On Thu, Mar 07, 2024 at 09:41:31PM +1100, Michael Ellerman wrote

Re: [PATCH 2/2] tpm: of: If available Use linux,sml-log to get the log and its size

2024-03-12 Thread Stefan Berger
On 3/12/24 11:50, Jarkko Sakkinen wrote: On Tue Mar 12, 2024 at 12:35 PM EET, Michael Ellerman wrote: Stefan Berger writes: On 3/7/24 15:00, Jarkko Sakkinen wrote: On Thu Mar 7, 2024 at 9:57 PM EET, Jarkko Sakkinen wrote: in short summary: s/Use/use/ On Wed Mar 6, 2024 at 5:55 PM EET

Re: [PATCH 2/2] tpm: of: If available Use linux,sml-log to get the log and its size

2024-03-12 Thread Stefan Berger
On 3/12/24 11:50, Jarkko Sakkinen wrote: On Tue Mar 12, 2024 at 12:35 PM EET, Michael Ellerman wrote: Stefan Berger writes: On 3/7/24 15:00, Jarkko Sakkinen wrote: On Thu Mar 7, 2024 at 9:57 PM EET, Jarkko Sakkinen wrote: in short summary: s/Use/use/ On Wed Mar 6, 2024 at 5:55 PM EET

Re: [RFC PATCH v2 2/3] dt-bindings: tpm: Add linux,sml-log to ibm,vtpm.yaml

2024-03-12 Thread Stefan Berger
On 3/12/24 07:11, Lukas Wunner wrote: On Mon, Mar 11, 2024 at 09:20:29AM -0400, Stefan Berger wrote: Add linux,sml-log, which carries the firmware TPM log in a uint8-array, to the properties. Either this property is required or both linux,sml-base and linux,sml-size are required. Add a test

Re: [RFC PATCH v2 2/3] dt-bindings: tpm: Add linux,sml-log to ibm,vtpm.yaml

2024-03-12 Thread Stefan Berger
On 3/12/24 07:11, Lukas Wunner wrote: On Mon, Mar 11, 2024 at 09:20:29AM -0400, Stefan Berger wrote: Add linux,sml-log, which carries the firmware TPM log in a uint8-array, to the properties. Either this property is required or both linux,sml-base and linux,sml-size are required. Add a test

Re: [RFC PATCH v2 3/3] tpm: of: If available use linux,sml-log to get the log and its size

2024-03-11 Thread Stefan Berger
On 3/11/24 16:25, Jarkko Sakkinen wrote: On Mon Mar 11, 2024 at 3:20 PM EET, Stefan Berger wrote: If linux,sml-log is available use it to get the TPM log rather than the pointer found in linux,sml-base. This resolves an issue on PowerVM and KVM on Power where after a kexec the memory pointed

Re: [RFC PATCH v2 3/3] tpm: of: If available use linux,sml-log to get the log and its size

2024-03-11 Thread Stefan Berger
On 3/11/24 16:25, Jarkko Sakkinen wrote: On Mon Mar 11, 2024 at 3:20 PM EET, Stefan Berger wrote: If linux,sml-log is available use it to get the TPM log rather than the pointer found in linux,sml-base. This resolves an issue on PowerVM and KVM on Power where after a kexec the memory pointed

Re: [RFC PATCH v2 1/3] powerpc/prom_init: Replace linux,sml-base/sml-size with linux,sml-log

2024-03-11 Thread Stefan Berger
On 3/11/24 13:24, Christophe Leroy wrote: Le 11/03/2024 à 14:20, Stefan Berger a écrit : linux,sml-base holds the address of a buffer with the TPM log. This buffer may become invalid after a kexec. To avoid accessing an invalid address or corrupted buffer, embed the whole TPM log

  1   2   3   4   5   6   7   8   9   10   >