Re: [PATCH] x86/sgx: Allows ioctl PROVISION to execute before CREATE

2021-01-20 Thread Jarkko Sakkinen
On Wed, Jan 20, 2021 at 11:57:18AM +0800, Tianjia Zhang wrote: > Hi, > > On 1/20/21 4:05 AM, Sean Christopherson wrote: > > On Mon, Jan 18, 2021, Tianjia Zhang wrote: > > > In function sgx_encl_create(), the logic of directly assigning > > > value to attributes_mask determines that the call to >

Re: [PATCH v2] x86/sgx: Fix free_cnt counting logic in epc section

2021-01-20 Thread Jarkko Sakkinen
On Wed, Jan 20, 2021 at 11:53:20AM +0800, Tianjia Zhang wrote: > Increase `section->free_cnt` in sgx_sanitize_section() is more > reasonable, which is called in ksgxd kernel thread, instead of This is lacking reasoning of why. /Jarkko > assigning it to epc section pages number at

Re:

2021-01-20 Thread Jarkko Sakkinen
rtificate > verification") > Reported-by: Tobias Markus > Signed-off-by: Tianjia Zhang > Signed-off-by: David Howells > Reviewed-and-tested-by: Toke Høiland-Jørgensen > Tested-by: João Fonseca > Cc: sta...@vger.kernel.org # v5.10+ > --- For what it's worth Acked-by:

Re: [PATCH] selftests/x86: Simplify the code of getting vdso base address in sgx

2021-01-20 Thread Jarkko Sakkinen
On Mon, Jan 18, 2021 at 09:33:21PM +0800, Tianjia Zhang wrote: > The base address of vDSO can be obtained through the library function > `getauxval()`, so use `getauxval(AT_SYSINFO_EHDR)` instead of a custom > implementation to simplify the code. > > Reported-by: Jia Zhang > Signed-off-by:

Re: [PATCH] x86/sgx: Remove redundant if conditions in sgx_encl_create

2021-01-20 Thread Jarkko Sakkinen
On Mon, Jan 18, 2021 at 09:33:58PM +0800, Tianjia Zhang wrote: > In this scenario, there is no case where va_page is NULL, and > the error has been checked. The if condition statement here is > redundant, so remove the condition detection. > > Reported-by: Jia Zhang > Signed-off-by: Tianjia

Re: [PATCH] x86/sgx: Fix free_cnt counting logic in epc section

2021-01-20 Thread Jarkko Sakkinen
On Mon, Jan 18, 2021 at 09:33:47PM +0800, Tianjia Zhang wrote: > Increase `section->free_cnt` in sgx_sanitize_section() is > more reasonable, which is called in ksgxd kernel thread, > instead of assigning it to epc section pages number at > initialization. Although this is unlikely to fail, these

Re: [PATCH] x86/sgx: Allows ioctl PROVISION to execute before CREATE

2021-01-20 Thread Jarkko Sakkinen
On Mon, Jan 18, 2021 at 09:33:35PM +0800, Tianjia Zhang wrote: > In function sgx_encl_create(), the logic of directly assigning > value to attributes_mask determines that the call to > SGX_IOC_ENCLAVE_PROVISION must be after the command of > SGX_IOC_ENCLAVE_CREATE. If change this assignment

Re: [PATCH] mm: Optimizing error condition detection in do_mprotect_pkey()

2021-01-20 Thread Jarkko Sakkinen
On Mon, Jan 18, 2021 at 09:33:10PM +0800, Tianjia Zhang wrote: > Obviously, the error variable detection of the if statement is > for the mprotect callback function, so it is also put into the > scope of calling callbck. > > Reported-by: Jia Zhang > Signed-off-by: Tianjia Zhang No fixes

Re: [PATCH v4] certs: Add EFI_CERT_X509_GUID support for dbx entries

2021-01-20 Thread Jarkko Sakkinen
On Fri, Jan 15, 2021 at 09:49:02AM -0700, Eric Snowberg wrote: > > > On Jan 15, 2021, at 2:15 AM, Jarkko Sakkinen wrote: > > > > On Wed, Jan 13, 2021 at 05:11:10PM -0700, Eric Snowberg wrote: > >> > >>> On Jan 13, 2021, at 1:41 PM, Jarkko Sakkinen

Re: [PATCH v3 09/10] certs: Allow root user to append signed hashes to the blacklist keyring

2021-01-19 Thread Jarkko Sakkinen
On Thu, Jan 14, 2021 at 04:19:08PM +0100, Mickaël Salaün wrote: > From: Mickaël Salaün > > Add a kernel option SYSTEM_BLACKLIST_AUTH_UPDATE to enable the root user > to dynamically add new keys to the blacklist keyring. This enables to > invalidate new certificates, either from being loaded in

Re: [PATCH v3 08/10] certs: Check that builtin blacklist hashes are valid

2021-01-19 Thread Jarkko Sakkinen
ug invalid hash formats, and > it make sure that previous hashes which could have been loaded in the > kernel (but ignored) are now noticed and deal with by the user. > > Cc: David Howells > Cc: David Woodhouse > Signed-off-by: Mickaël Salaün > Acked-by: Jarkko Sakkinen I get

Re: [PATCH v3 05/10] certs: Replace K{U,G}IDT_INIT() with GLOBAL_ROOT_{U,G}ID

2021-01-19 Thread Jarkko Sakkinen
On Thu, Jan 14, 2021 at 04:19:04PM +0100, Mickaël Salaün wrote: > From: Mickaël Salaün > > Align with the new macros and add appropriate include files. > > Cc: David Woodhouse > Signed-off-by: Mickaël Salaün > Signed-off-by: David Howells The commit message makes no sense. What you new

Re: [PATCH v3 06/10] certs: Make blacklist_vet_description() more strict

2021-01-19 Thread Jarkko Sakkinen
dhouse > Signed-off-by: Mickaël Salaün > Acked-by: Jarkko Sakkinen In this I'm not as worried about ABI, i.e. you don't have any reason supply any other data, which doesn't follow these ruels, whereas there could very well be a script that does format hex "incorrectly". /Jarkko

Re: [PATCH v3 04/10] certs: Fix blacklist flag type confusion

2021-01-19 Thread Jarkko Sakkinen
.c > +++ b/security/keys/key.c > @@ -303,6 +303,8 @@ struct key *key_alloc(struct key_type *type, const char > *desc, > key->flags |= 1 << KEY_FLAG_BUILTIN; > if (flags & KEY_ALLOC_UID_KEYRING) > key->flags |= 1 << KEY_FLAG_UID_KEYRING; > + if (flags & KEY_ALLOC_SET_KEEP) > + key->flags |= 1 << KEY_FLAG_KEEP; > > #ifdef KEY_DEBUGGING > key->magic = KEY_DEBUG_MAGIC; > -- > 2.30.0 > Acked-by: Jarkko Sakkinen /Jarkko

Re: [PATCH v3 03/10] PKCS#7: Fix missing include

2021-01-19 Thread Jarkko Sakkinen
On Thu, Jan 14, 2021 at 04:19:02PM +0100, Mickaël Salaün wrote: > From: Mickaël Salaün > > Add missing linux/types.h for size_t. > > [DH: Changed from stddef.h] > > Signed-off-by: Mickaël Salaün > Signed-off-by: David Howells > Reviewed-by: Ben Boeckel > ---

Re: [PATCH v3 02/10] certs: Fix blacklisted hexadecimal hash string check

2021-01-19 Thread Jarkko Sakkinen
On Thu, Jan 14, 2021 at 04:19:01PM +0100, Mickaël Salaün wrote: > From: Mickaël Salaün > > When looking for a blacklisted hash, bin2hex() is used to transform a > binary hash to an ascii (lowercase) hexadecimal string. This string is > then search for in the description of the keys from the

Re: [PATCH v3 01/10] certs/blacklist: fix kernel doc interface issue

2021-01-19 Thread Jarkko Sakkinen
vger.kernel.org > Signed-off-by: Alex Shi > Signed-off-by: David Howells > Reviewed-by: Ben Boeckel > Signed-off-by: Mickaël Salaün Reviewed-by: Jarkko Sakkinen /Jarkko

Re: [PATCH v8 2/4] KEYS: trusted: Introduce TEE based Trusted Keys

2021-01-19 Thread Jarkko Sakkinen
On Tue, Jan 19, 2021 at 12:30:42PM +0200, Jarkko Sakkinen wrote: > On Fri, Jan 15, 2021 at 11:32:31AM +0530, Sumit Garg wrote: > > On Thu, 14 Jan 2021 at 07:35, Jarkko Sakkinen wrote: > > > > > > On Wed, Jan 13, 2021 at 04:47:00PM +0530, Sumit Garg wrote: > > >

Re: [PATCH v8 2/4] KEYS: trusted: Introduce TEE based Trusted Keys

2021-01-19 Thread Jarkko Sakkinen
On Fri, Jan 15, 2021 at 11:32:31AM +0530, Sumit Garg wrote: > On Thu, 14 Jan 2021 at 07:35, Jarkko Sakkinen wrote: > > > > On Wed, Jan 13, 2021 at 04:47:00PM +0530, Sumit Garg wrote: > > > Hi Jarkko, > > > > > > On Mon, 11 Jan 2021 at 22:05, Jarkko Sakki

Re: [PATCH 3/4] tpm: in tpm2_del_space check if ops pointer is still valid

2021-01-17 Thread Jarkko Sakkinen
On Sat, Jan 16, 2021 at 02:22:40AM +0100, Lino Sanfilippo wrote: > From: Lino Sanfilippo > > In tpm2_del_space() the sessions are flushed by means of the tpm_chip > operations. However the concerning operations pointer my already be NULL at > this time in case that the chip has been unregistered

Re: [PATCH 2/4] tpm: fix reference counting for struct tpm_chip

2021-01-17 Thread Jarkko Sakkinen
On Sat, Jan 16, 2021 at 02:22:39AM +0100, Lino Sanfilippo wrote: > From: Lino Sanfilippo > > Commit 8979b02aaf1d ("tpm: Fix reference count to main device") tried to > fix a reference count issue which prevented the tpm_chip structure from > being freed in case that no TPM2 was used. The fix was

Re: [PATCH 1/4] tpm: in case of error properly cleanup in tpmm_chip_alloc

2021-01-17 Thread Jarkko Sakkinen
On Sat, Jan 16, 2021 at 02:22:38AM +0100, Lino Sanfilippo wrote: > From: Lino Sanfilippo > > In tpmm_chip_alloc() a resource management action handler is installed to > release the chip->dev in case of error. This will result in the chip being > freed if it was the last reference. If the

Re: [PATCH RFC] x86/sgx: Add trivial NUMA allocation

2021-01-15 Thread Jarkko Sakkinen
On Thu, Jan 14, 2021 at 10:35:03AM -0800, Dave Hansen wrote: > On 1/14/21 9:54 AM, Jarkko Sakkinen wrote: > > On Tue, Jan 12, 2021 at 04:24:01PM -0800, Dave Hansen wrote: > >> We need a bit more information here as well. What's the relationship > >> between NUMA no

Re: [PATCH] x86/sgx: fix the return type of sgx_init

2021-01-15 Thread Jarkko Sakkinen
On Thu, Jan 14, 2021 at 12:12:12PM +, Darren Kenny wrote: > On Wednesday, 2021-01-13 at 15:23:11 -08, Sami Tolvanen wrote: > > device_initcall() expects a function of type initcall_t, which returns > > an integer. Change the signature of sgx_init() to match. > > > > Fixes: e7e0545299d8c

Re: [PATCH] x86/sgx: fix the return type of sgx_init

2021-01-15 Thread Jarkko Sakkinen
> (EPC) sections") > Signed-off-by: Sami Tolvanen Thank you. Reviewed-by: Jarkko Sakkinen I applied this to the master and next of git://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-sgx.git Including to the v5.12 PR, actually is the first commit included to that. That remind

Re: [PATCH v3] x86/sgx: Synchronize encl->srcu in sgx_encl_release().

2021-01-15 Thread Jarkko Sakkinen
On Wed, Jan 13, 2021 at 10:42:12PM -0600, Haitao Huang wrote: > On Mon, 11 Jan 2021 18:08:10 -0600, Jarkko Sakkinen > wrote: > > > On Tue, Jan 05, 2021 at 03:57:49PM +0100, Borislav Petkov wrote: > > > On Wed, Dec 16, 2020 at 03:49:20PM +0200, Jarkko Sak

Re: [PATCH v3 00/10] Enable root to update the blacklist keyring

2021-01-15 Thread Jarkko Sakkinen
On Thu, Jan 14, 2021 at 04:18:59PM +0100, Mickaël Salaün wrote: > This third patch series includes back three fix patches taken from the first > series (and cherry-picked from David Howells's tree [1]), and one cosmetic fix > from Alex Shi which helps avoid future conflicts. I also added some

Re: [PATCH] tpm/tpm_tis: Fix variable reset during IRQ probing

2021-01-15 Thread Jarkko Sakkinen
On Thu, Jan 14, 2021 at 12:12:16PM +0800, Tianjia Zhang wrote: > > > On 1/14/21 10:51 AM, Jarkko Sakkinen wrote: > > On Wed, Jan 13, 2021 at 08:00:21PM +0800, Tianjia Zhang wrote: > > > In tpm_tis_core_init(), tpm2_probe() will be called first, this > > &

Re: [PATCH v4] certs: Add EFI_CERT_X509_GUID support for dbx entries

2021-01-15 Thread Jarkko Sakkinen
On Wed, Jan 13, 2021 at 05:11:10PM -0700, Eric Snowberg wrote: > > > On Jan 13, 2021, at 1:41 PM, Jarkko Sakkinen > > wrote: > > > > On Tue, Jan 12, 2021 at 02:57:39PM +, David Howells wrote: > >> Eric Snowberg wrote: > >> > >&g

Re: [PATCH v3] x86/sgx: Synchronize encl->srcu in sgx_encl_release().

2021-01-14 Thread Jarkko Sakkinen
On Wed, Jan 13, 2021 at 09:46:02AM -0800, Paul E. McKenney wrote: > On Wed, Jan 13, 2021 at 07:18:23PM +0200, Jarkko Sakkinen wrote: > > On Tue, Jan 12, 2021 at 07:35:50PM +0100, Borislav Petkov wrote: > > > + paulmck. > > > > > > On Tue, Jan 12, 2021 at 02:

Re: [PATCH v5] scripts: use pkg-config to locate libcrypto

2021-01-14 Thread Jarkko Sakkinen
nel.org # 5.6.x Acked-by: Jarkko Sakkinen /Jarkko

Re: [PATCH RFC] x86/sgx: Add trivial NUMA allocation

2021-01-14 Thread Jarkko Sakkinen
On Tue, Jan 12, 2021 at 04:24:01PM -0800, Dave Hansen wrote: > On 12/16/20 5:50 AM, Jarkko Sakkinen wrote: > > Create a pointer array for each NUMA node with the references to the > > contained EPC sections. Use this in __sgx_alloc_epc_page() to knock the > > current NUMA n

Re: [PATCH v2 0/5] Enable root to update the blacklist keyring

2021-01-13 Thread Jarkko Sakkinen
On Sun, Jan 10, 2021 at 06:57:10AM +0200, Jarkko Sakkinen wrote: > On Tue, Jan 05, 2021 at 11:12:57AM +0100, Mickaël Salaün wrote: > > Jarkko, David, what is the status of this patch series? Do you need help > > to test it? > > Hi, a leave/vacation and the holiday period bad

Re: [PATCH v5] scripts: use pkg-config to locate libcrypto

2021-01-13 Thread Jarkko Sakkinen
nel.org # 5.6.x Acked-by: Jarkko Sakkinen /Jarkko

Re: [PATCH] tpm/tpm_tis: Fix variable reset during IRQ probing

2021-01-13 Thread Jarkko Sakkinen
On Wed, Jan 13, 2021 at 08:00:21PM +0800, Tianjia Zhang wrote: > In tpm_tis_core_init(), tpm2_probe() will be called first, this > function will eventually call tpm_tis_send(), and then > tpm_tis_probe_irq_single() will detect whether the interrupt is > normal, mainly the installation interrupted,

Re: [PATCH] x86/sgx: rename and document SGX bit lock

2021-01-13 Thread Jarkko Sakkinen
lternatives. > > Give the lock bit a better name, and document what it actually trying > to do. > > Cc: Sean Christopherson > Cc: Jarkko Sakkinen > Cc: Borislav Petkov > Cc: x...@kernel.org > > --- > > b/arch/x86/kernel/cpu/sgx/encl.h |2 +- > b/arch/x86

Re: [PATCH v8 2/4] KEYS: trusted: Introduce TEE based Trusted Keys

2021-01-13 Thread Jarkko Sakkinen
On Wed, Jan 13, 2021 at 04:47:00PM +0530, Sumit Garg wrote: > Hi Jarkko, > > On Mon, 11 Jan 2021 at 22:05, Jarkko Sakkinen wrote: > > > > On Tue, Nov 03, 2020 at 09:31:44PM +0530, Sumit Garg wrote: > > > Add support for TEE based trusted keys where TEE pro

Re: [PATCH v4] certs: Add EFI_CERT_X509_GUID support for dbx entries

2021-01-13 Thread Jarkko Sakkinen
On Tue, Jan 12, 2021 at 02:57:39PM +, David Howells wrote: > Eric Snowberg wrote: > > > > On Dec 10, 2020, at 2:49 AM, David Howells wrote: > > > > > > Eric Snowberg wrote: > > > > > >> Add support for EFI_CERT_X509_GUID dbx entries. When a EFI_CERT_X509_GUID > > >> is found, it is added

Re: [PATCH v3] x86/sgx: Synchronize encl->srcu in sgx_encl_release().

2021-01-13 Thread Jarkko Sakkinen
On Tue, Jan 12, 2021 at 07:35:50PM +0100, Borislav Petkov wrote: > + paulmck. > > On Tue, Jan 12, 2021 at 02:08:10AM +0200, Jarkko Sakkinen wrote: > > On Tue, Jan 05, 2021 at 03:57:49PM +0100, Borislav Petkov wrote: > > > On Wed, Dec 16, 2020 at 03:49:20PM +020

Re: [PATCH 4/5] security: DH - use KDF implementation from crypto API

2021-01-11 Thread Jarkko Sakkinen
On Mon, 2021-01-04 at 22:49 +0100, Stephan Müller wrote: > The kernel crypto API provides the SP800-108 counter KDF implementation. > Thus, the separate implementation provided as part of the keys subsystem > can be replaced with calls to the KDF offered by the kernel crypto API. > > The keys

Re: [PATCH v3] x86/sgx: Synchronize encl->srcu in sgx_encl_release().

2021-01-11 Thread Jarkko Sakkinen
On Mon, Jan 04, 2021 at 02:22:05PM -0600, Haitao Huang wrote: > On Wed, 16 Dec 2020 07:49:20 -0600, Jarkko Sakkinen > wrote: > > > Add synchronize_srcu_expedited() to sgx_encl_release() to catch a grace > > period initiated by sgx_mmu_notifier_release(). > > > &g

Re: [PATCH v3] x86/sgx: Synchronize encl->srcu in sgx_encl_release().

2021-01-11 Thread Jarkko Sakkinen
On Tue, Jan 05, 2021 at 03:57:49PM +0100, Borislav Petkov wrote: > On Wed, Dec 16, 2020 at 03:49:20PM +0200, Jarkko Sakkinen wrote: > > Add synchronize_srcu_expedited() to sgx_encl_release() to catch a grace > > period initiated by sgx_mmu_notifier_release(). > >

Re: [PATCH v8 2/4] KEYS: trusted: Introduce TEE based Trusted Keys

2021-01-11 Thread Jarkko Sakkinen
On Tue, Nov 03, 2020 at 09:31:44PM +0530, Sumit Garg wrote: > Add support for TEE based trusted keys where TEE provides the functionality > to seal and unseal trusted keys using hardware unique key. > > Refer to Documentation/tee.txt for detailed information about TEE. > > Signed-off-by: Sumit

Re: [PATCH v2 0/5] Enable root to update the blacklist keyring

2021-01-09 Thread Jarkko Sakkinen
On Tue, Jan 05, 2021 at 11:12:57AM +0100, Mickaël Salaün wrote: > Jarkko, David, what is the status of this patch series? Do you need help > to test it? Hi, a leave/vacation and the holiday period badly mixed my schedules. I'm testing this upcoming week. /Jarkko

Re: [PATCH -next] tpm: Use kzalloc for allocating only one thing

2021-01-04 Thread Jarkko Sakkinen
On Tue, Dec 29, 2020 at 08:23:49AM -0800, James Bottomley wrote: > On Tue, 2020-12-29 at 21:51 +0800, Zheng Yongjun wrote: > > Use kzalloc rather than kcalloc(1,...) > > > > The semantic patch that makes this change is as follows: > > (http://coccinelle.lip6.fr/) > > What's the reason for

[PATCH RFC] x86/sgx: Add trivial NUMA allocation

2020-12-16 Thread Jarkko Sakkinen
Create a pointer array for each NUMA node with the references to the contained EPC sections. Use this in __sgx_alloc_epc_page() to knock the current NUMA node before the others. Suggested-by: Sean Christopherson Signed-off-by: Jarkko Sakkinen --- arch/x86/kernel/cpu/sgx/main.c | 66

[PATCH v3] x86/sgx: Synchronize encl->srcu in sgx_encl_release().

2020-12-16 Thread Jarkko Sakkinen
d-by: Sean Christopherson Suggested-by: Haitao Huang Signed-off-by: Jarkko Sakkinen --- v3: Fine-tuned tags, and added missing change log for v2. v2: Switch to synchronize_srcu_expedited(). arch/x86/kernel/cpu/sgx/encl.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/arch/x86/kernel/cpu/sgx

Re: [PATCH] x86/sgx: Synchronize encl->srcu in sgx_encl_release().

2020-12-16 Thread Jarkko Sakkinen
On Tue, Dec 15, 2020 at 02:04:10PM -0800, Sean Christopherson wrote: > On Tue, Dec 15, 2020, Jarkko Sakkinen wrote: > > On Mon, Dec 14, 2020 at 11:01:32AM -0800, Sean Christopherson wrote: > > > Haitao reported the bug, and for all intents and purposes provided the > >

[PATCH] x86/sgx: Synchronize encl->srcu in sgx_encl_release().

2020-12-15 Thread Jarkko Sakkinen
Haitao Huang Signed-off-by: Jarkko Sakkinen --- arch/x86/kernel/cpu/sgx/encl.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/arch/x86/kernel/cpu/sgx/encl.c b/arch/x86/kernel/cpu/sgx/encl.c index ee50a5010277..fe7256db6e73 100644 --- a/arch/x86/kernel/cpu/sgx/encl.c +++ b/arch/

Re: [PATCH] x86/sgx: Synchronize encl->srcu in sgx_encl_release().

2020-12-15 Thread Jarkko Sakkinen
On Tue, Dec 15, 2020 at 11:34:37AM -0600, Haitao Huang wrote: > On Mon, 14 Dec 2020 23:59:55 -0600, Jarkko Sakkinen > wrote: > > > On Tue, Dec 15, 2020 at 07:56:01AM +0200, Jarkko Sakkinen wrote: > > > On Mon, Dec 14, 2020 at 11:01:32AM -0800, Sean Christopherson wrote

Re: [PATCH v41 00/24] Intel SGX foundations

2020-12-15 Thread Jarkko Sakkinen
On Tue, Dec 15, 2020 at 01:43:22PM +0800, Hui, Chunyang wrote: > Tested-by: Chunyang Hui > > The Occlum project (https://occlum.io/) is a libOS built on top of Intel > SGX feature. We ran Occlum tests using v5.10 kernel with SGX patch v41 on > SGX hardware with the Flexible Launch Control (FLC)

Re: [PATCH] x86/sgx: Synchronize encl->srcu in sgx_encl_release().

2020-12-14 Thread Jarkko Sakkinen
On Tue, Dec 15, 2020 at 07:56:01AM +0200, Jarkko Sakkinen wrote: > On Mon, Dec 14, 2020 at 11:01:32AM -0800, Sean Christopherson wrote: > > On Fri, Dec 11, 2020, Jarkko Sakkinen wrote: > > > Each sgx_mmun_notifier_release() starts a grace period, which means th

Re: [PATCH] x86/sgx: Synchronize encl->srcu in sgx_encl_release().

2020-12-14 Thread Jarkko Sakkinen
On Mon, Dec 14, 2020 at 11:01:32AM -0800, Sean Christopherson wrote: > On Fri, Dec 11, 2020, Jarkko Sakkinen wrote: > > Each sgx_mmun_notifier_release() starts a grace period, which means that > > Should be sgx_mmu_notifier_release(), here and in the comment. Thanks.

Re: [GIT PULL] keys: Collected minor fixes and cleanups

2020-12-14 Thread Jarkko Sakkinen
On Mon, Dec 14, 2020 at 12:49:27PM -0800, Linus Torvalds wrote: > The pain just isn't worth it, but more importantly, you simply need to > get your workflow in order, and not send me completely untested > garbage that hasn't even been compiled. I have now more bandwidth. It was mostly eaten by

[PATCH] x86/sgx: Synchronize encl->srcu in sgx_encl_release().

2020-12-11 Thread Jarkko Sakkinen
("x86/sgx: Add a page reclaimer") Cc: Borislav Petkov Cc: Dave Hansen Reported-by: Sean Christopherson Signed-off-by: Jarkko Sakkinen --- arch/x86/kernel/cpu/sgx/encl.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/arch/x86/kernel/cpu/sgx/encl.c b/arch/x86/kernel/cpu/

Re: [PATCH 00/18] keys: Miscellaneous fixes

2020-12-11 Thread Jarkko Sakkinen
On Fri, Dec 11, 2020 at 12:51:46PM +0200, Jarkko Sakkinen wrote: > On Wed, Dec 09, 2020 at 12:14:24PM +, David Howells wrote: > > > > Hi Jarkko, > > > > I've extended my collection of minor keyrings fixes for the next merge > > window. Anything else I shou

Re: [PATCH -next] char/tpm: simplify the return expression of tpm_tis_synquacer_module_init()

2020-12-11 Thread Jarkko Sakkinen
On Thu, Dec 10, 2020 at 09:55:15PM +0800, Zheng Yongjun wrote: > Simplify the return expression. > > Signed-off-by: Zheng Yongjun I don't see how this would be meaningful change as the existing code is according to the coding style. > --- > drivers/char/tpm/tpm_tis_synquacer.c | 7 +-- >

Re: [PATCH 00/18] keys: Miscellaneous fixes

2020-12-11 Thread Jarkko Sakkinen
On Wed, Dec 09, 2020 at 12:14:24PM +, David Howells wrote: > > Hi Jarkko, > > I've extended my collection of minor keyrings fixes for the next merge > window. Anything else I should add (or anything I should drop)? > > The patches can be found on the following branch: > > >

Re: [Regression] Can only do S3 once after "tpm: take TPM chip power gating out of tpm_transmit()"

2020-12-11 Thread Jarkko Sakkinen
On Thu, Dec 10, 2020 at 12:23:57PM +0800, Kai-Heng Feng wrote: > > > > On Dec 8, 2020, at 18:17, Jarkko Sakkinen wrote: > > > > On Mon, Dec 07, 2020 at 12:42:53PM +0800, Kai-Heng Feng wrote: > >> Hi Jarkko, > >> > >> A user report that

Re: [PATCH v8 3/4] doc: trusted-encrypted: updates with TEE as a new trust source

2020-12-11 Thread Jarkko Sakkinen
On Wed, Dec 09, 2020 at 11:50:19AM -0500, Mimi Zohar wrote: > On Tue, 2020-12-08 at 19:49 +0200, Jarkko Sakkinen wrote: > > On Tue, Dec 08, 2020 at 10:02:57AM -0500, Mimi Zohar wrote: > > > > > Please also use a proper email client and split your paragraphs into > >

Re: [PATCH v6] char: tpm: add i2c driver for cr50

2020-12-11 Thread Jarkko Sakkinen
On Wed, Dec 09, 2020 at 02:41:45PM +0200, Adrian Ratiu wrote: > On Tue, 08 Dec 2020, Jarkko Sakkinen wrote: > > On Mon, Dec 07, 2020 at 04:20:16PM +0200, Adrian Ratiu wrote: > > > From: "dlau...@chromium.org" Add TPM 2.0 > > > compatible I2C interface for c

Re: [PATCH 00/18] keys: Miscellaneous fixes

2020-12-11 Thread Jarkko Sakkinen
On Wed, Dec 09, 2020 at 12:14:24PM +, David Howells wrote: > > Hi Jarkko, > > I've extended my collection of minor keyrings fixes for the next merge > window. Anything else I should add (or anything I should drop)? Looks good to me. I dropped the keys fixes that I had previously in my tree

Re: [PATCH v8 3/4] doc: trusted-encrypted: updates with TEE as a new trust source

2020-12-08 Thread Jarkko Sakkinen
On Tue, Dec 08, 2020 at 10:02:57AM -0500, Mimi Zohar wrote: > Hi Jarkko, > > On Fri, 2020-12-04 at 17:30 +0200, Jarkko Sakkinen wrote: > > On Wed, Dec 02, 2020 at 02:34:07PM -0500, gmail Elaine Palmer wrote: > > > Hi Sumit, > > > > > > Thank you

Re: [PATCH v3 3/4] tpm_tis: Disable interrupts if interrupt storm detected

2020-12-08 Thread Jarkko Sakkinen
On Mon, Dec 07, 2020 at 11:58:44AM -0800, James Bottomley wrote: > On Mon, 2020-12-07 at 15:28 -0400, Jason Gunthorpe wrote: > > On Sun, Dec 06, 2020 at 08:26:16PM +0100, Thomas Gleixner wrote: > > > Just as a side note. I was looking at tpm_tis_probe_irq_single() > > > and that function is

Re: [PATCH v3 3/4] tpm_tis: Disable interrupts if interrupt storm detected

2020-12-08 Thread Jarkko Sakkinen
On Mon, Dec 07, 2020 at 03:28:03PM -0400, Jason Gunthorpe wrote: > On Sun, Dec 06, 2020 at 08:26:16PM +0100, Thomas Gleixner wrote: > > Just as a side note. I was looking at tpm_tis_probe_irq_single() and > > that function is leaking the interrupt request if any of the checks > > afterwards fails,

Re: [PATCH v6] char: tpm: add i2c driver for cr50

2020-12-08 Thread Jarkko Sakkinen
s to look legit. Has anyone tested this? /Jarkko > > Cc: Helen Koike > Cc: Jarkko Sakkinen > Cc: Ezequiel Garcia > Signed-off-by: Duncan Laurie > [swb...@chromium.org: Depend on i2c even if it's a module, replace > boilier plate with SPDX tag, drop asm/byteorder.h inc

Re: [PATCH][RFC] tpm: Rework open/close/shutdown to avoid races

2020-12-08 Thread Jarkko Sakkinen
On Fri, Dec 04, 2020 at 01:18:05PM +0300, Sergey Temerkhanov wrote: > Avoid race condition at shutdown by shutting downn the TPM 2.0 > devices synchronously. This eliminates the condition when the > shutdown sequence sets chip->ops to NULL leading to the following: > > [ 1586.593561][ T8669]

Re: [Regression] Can only do S3 once after "tpm: take TPM chip power gating out of tpm_transmit()"

2020-12-08 Thread Jarkko Sakkinen
On Mon, Dec 07, 2020 at 12:42:53PM +0800, Kai-Heng Feng wrote: > Hi Jarkko, > > A user report that the system can only do S3 once. Subsequent S3 fails after > commit a3fbfae82b4c ("tpm: take TPM chip power gating out of tpm_transmit()"). > > Dmesg with the issue, collected under 5.10-rc2: >

Re: [PATCH v3 2/4] drm/i915/pmu: Use kstat_irqs to get interrupt count

2020-12-08 Thread Jarkko Sakkinen
On Sun, Dec 06, 2020 at 10:33:09PM +0100, Thomas Gleixner wrote: > On Sun, Dec 06 2020 at 17:38, Thomas Gleixner wrote: > > On Fri, Dec 04 2020 at 18:43, Jerry Snitselaar wrote: > >> Now that kstat_irqs is exported, get rid of count_interrupts in > >> i915_pmu.c > > > > May I ask why this has been

Re: [PATCH v3 1/4] irq: export kstat_irqs

2020-12-05 Thread Jarkko Sakkinen
by: kernel test robot I'm not sure if this makes much sense. > Cc: Thomas Gleixner > Cc: Jarkko Sakkinen > Cc: Jason Gunthorpe > Cc: Peter Huewe > Cc: James Bottomley > Cc: Matthew Garrett > Cc: Hans de Goede > Signed-off-by: Jerry Snitselaar /Jarkko

Re: [PATCH v1 0/9] Enable root to update the blacklist keyring

2020-12-04 Thread Jarkko Sakkinen
On Fri, Dec 04, 2020 at 02:01:36PM +, David Howells wrote: > Mickaël Salaün wrote: > > > > What would be easiest way to smoke test the changes? > > > > An easy way to test it is to enable the second trusted keyring to > > dynamically load certificates in the kernel. Then we can create a

Re: [PATCH v8 3/4] doc: trusted-encrypted: updates with TEE as a new trust source

2020-12-04 Thread Jarkko Sakkinen
On Wed, Dec 02, 2020 at 02:34:07PM -0500, gmail Elaine Palmer wrote: > Hi Sumit, > > Thank you for the detailed descriptions and examples of trust sources > for Trusted Keys. A group of us in IBM (Stefan Berger, Ken Goldman, > Zhongshu Gu, Nayna Jain, Elaine Palmer, George Wilson, Mimi Zohar)

Re: [PATCH v5] char: tpm: add i2c driver for cr50

2020-12-04 Thread Jarkko Sakkinen
63 and must be drained by AP. > - Provides an interrupt to indicate when read response data is ready > and when the TPM is finished processing write data. > > This driver is based on the existing infineon I2C TPM driver, which > most closely matches the cr50 i2c protocol behavior. > &g

Re: [PATCH v8 0/4] Introduce TEE based Trusted Keys support

2020-12-03 Thread Jarkko Sakkinen
On Fri, Nov 06, 2020 at 04:52:52PM +0200, Jarkko Sakkinen wrote: > On Fri, Nov 06, 2020 at 03:02:41PM +0530, Sumit Garg wrote: > > On Thu, 5 Nov 2020 at 10:37, Jarkko Sakkinen wrote: > > > > > > On Tue, Nov 03, 2020 at 09:31:42PM +0530, Sumit Garg wrote: > > >

Re: [PATCH v2] tpm_tis: Disable interrupts if interrupt storm detected

2020-12-03 Thread Jarkko Sakkinen
On Wed, Dec 02, 2020 at 11:11:41PM -0700, Jerry Snitselaar wrote: > > Jerry Snitselaar @ 2020-12-02 17:02 MST: > > > Jarkko Sakkinen @ 2020-12-02 09:49 MST: > > > >> On Tue, Dec 01, 2020 at 12:59:23PM -0700, Jerry Snitselaar wrote: > >>> >

Re: [PATCH] sgx.7: New page with overview of Software Guard eXtensions (SGX)

2020-12-03 Thread Jarkko Sakkinen
On Wed, Dec 02, 2020 at 07:17:42PM +0200, Jarkko Sakkinen wrote: > On Wed, Dec 02, 2020 at 11:37:01AM +0100, Michael Kerrisk (man-pages) wrote: > > Hi Jarkko, > > > > Thanks for the page. I'll have some more comments later, most likely. > > But to begin with, are t

[tip: x86/sgx] x86/sgx: Return -EINVAL on a zero length buffer in sgx_ioc_enclave_add_pages()

2020-12-03 Thread tip-bot2 for Jarkko Sakkinen
The following commit has been merged into the x86/sgx branch of tip: Commit-ID: a4b9c48b96517ff4780b22a784e7537eac5dc21b Gitweb: https://git.kernel.org/tip/a4b9c48b96517ff4780b22a784e7537eac5dc21b Author:Jarkko Sakkinen AuthorDate:Thu, 03 Dec 2020 20:35:27 +02:00

[PATCH] x86/sgx: Return -EINVAL on a zero length buffer in sgx_ioc_enclave_add_pages()

2020-12-03 Thread Jarkko Sakkinen
/ Fixes: c6d26d370767 ("x86/sgx: Add SGX_IOC_ENCLAVE_ADD_PAGES") Reported-by: Dan Carpenter Signed-off-by: Jarkko Sakkinen --- arch/x86/kernel/cpu/sgx/ioctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/cpu/sgx/ioctl.c b/arch/x86/kernel/cpu/sgx/ioc

Re: [PATCH] x86/sgx: Initialize "ret" in sgx_ioc_enclave_add_pages()

2020-12-03 Thread Jarkko Sakkinen
On Wed, Dec 02, 2020 at 06:38:29PM +0100, Borislav Petkov wrote: > On Wed, Dec 02, 2020 at 06:22:00PM +0200, Jarkko Sakkinen wrote: > > Initialize "ret" to zero as otherwise a zero length address range will > > leave it uninitialized. > > That length is: > &g

Re: [PATCH] drivers: char: tpm: remove unneeded MODULE_VERSION() usage

2020-12-02 Thread Jarkko Sakkinen
.35bf249cc95a 100644 > --- a/drivers/char/tpm/tpm_atmel.c > +++ b/drivers/char/tpm/tpm_atmel.c > @@ -231,5 +231,4 @@ module_exit(cleanup_atmel); > > MODULE_AUTHOR("Leendert van Doorn (leend...@watson.ibm.com)"); > MODULE_DESCRIPTION("TPM Driver"); > -MOD

Re: [PATCH v4] char: tpm: add i2c driver for cr50

2020-12-02 Thread Jarkko Sakkinen
63 and must be drained by AP. > - Provides an interrupt to indicate when read response data is ready > and when the TPM is finished processing write data. > > This driver is based on the existing infineon I2C TPM driver, which > most closely matches the cr50 i2c protocol behavior. > &g

Re: [PATCH v2] tpm_tis: Disable interrupts if interrupt storm detected

2020-12-02 Thread Jarkko Sakkinen
have a bios issue causing an interrupt storm to > >> occur. The issue isn't limited to a single tpm or system manufacturer > >> so keeping a denylist of systems with the issue isn't optimal. Instead > >> try to detect the problem occurring, disable interrupts, and rev

Re: [PATCH] keys: remove trailing semicolon in macro definition

2020-12-02 Thread Jarkko Sakkinen
On Sat, Nov 28, 2020 at 09:30:44PM -0800, Joe Perches wrote: > On Sun, 2020-11-29 at 06:45 +0200, Jarkko Sakkinen wrote: > > On Fri, Nov 27, 2020 at 11:15:43AM -0800, t...@redhat.com wrote: > > > From: Tom Rix > > > > > > The macro use will already have

Re: [PATCH v1 0/9] Enable root to update the blacklist keyring

2020-12-02 Thread Jarkko Sakkinen
On Mon, Nov 30, 2020 at 09:23:59AM +0100, Mickaël Salaün wrote: > > On 30/11/2020 03:40, Jarkko Sakkinen wrote: > > On Fri, Nov 20, 2020 at 07:04:17PM +0100, Mickaël Salaün wrote: > >> Hi, > >> > >> This patch series mainly add a new configuration opti

Re: [PATCH 0/9] keys: Miscellaneous fixes

2020-12-02 Thread Jarkko Sakkinen
On Mon, Nov 30, 2020 at 09:21:32AM +, David Howells wrote: > Jarkko Sakkinen wrote: > > > I think that looks good, thank you. I'm sending PR next week. Should I > > bundle those to that? > > I've updated the branch to include an ack from you, plus added the &

Re: [PATCH 1/2] asm: sgx.h: fix a typo on a kernel-doc markup

2020-12-02 Thread Jarkko Sakkinen
rnel-doc markup: > > sgx_epage_flags -> sgx_page_flags > > Signed-off-by: Mauro Carvalho Chehab Thank you. Acked-by: Jarkko Sakkinen /Jarkko

Re: [PATCH] tpm_tis: Disable interrupts on ThinkPad T490s

2020-12-02 Thread Jarkko Sakkinen
On Sun, Nov 29, 2020 at 12:34:34PM +0100, Hans de Goede wrote: > Hi All, > > On 11/29/20 4:23 AM, Jarkko Sakkinen wrote: > > On Tue, Nov 24, 2020 at 10:45:01PM +0100, Hans de Goede wrote: > >> Hi, > >> > >> On 11/24/20 6:52 PM, Jerry Snitselaar wrote: &

Re: [PATCH v1 0/9] Enable root to update the blacklist keyring

2020-11-29 Thread Jarkko Sakkinen
On Fri, Nov 20, 2020 at 07:04:17PM +0100, Mickaël Salaün wrote: > Hi, > > This patch series mainly add a new configuration option to enable the > root user to load signed keys in the blacklist keyring. This keyring is > useful to "untrust" certificates or files. Enabling to safely update > this

Re: [PATCH] keys: remove trailing semicolon in macro definition

2020-11-28 Thread Jarkko Sakkinen
On Fri, Nov 27, 2020 at 11:15:43AM -0800, t...@redhat.com wrote: > From: Tom Rix > > The macro use will already have a semicolon. > > Signed-off-by: Tom Rix I'm in-between whether this is worth of merging. The commit message does not help with that decision too much. /Jarkko

Re: [PATCH 0/9] keys: Miscellaneous fixes

2020-11-28 Thread Jarkko Sakkinen
On Fri, Nov 27, 2020 at 04:45:24PM +, David Howells wrote: > > Hi Jarkko, > > I've collected together a bunch of minor keyrings fixes, but I'm not sure > there's anything that can't wait for the next merge window. > > The patches can be found on the following branch: > > >

Re: [PATCH v3] char: tpm: add i2c driver for cr50

2020-11-28 Thread Jarkko Sakkinen
63 and must be drained by AP. > - Provides an interrupt to indicate when read response data is ready > and when the TPM is finished processing write data. > > This driver is based on the existing infineon I2C TPM driver, which > most closely matches the cr50 i2c protocol behavior. > &g

Re: [PATCH v2] char: tpm: add i2c driver for cr50

2020-11-28 Thread Jarkko Sakkinen
On Thu, Nov 26, 2020 at 03:19:24AM -0300, Ezequiel Garcia wrote: > On Thu, 2020-11-26 at 05:30 +0200, Jarkko Sakkinen wrote: > > On Tue, 2020-11-24 at 10:14 -0300, Ezequiel Garcia wrote: > > > Hi Jarkko, > > > > > > Thanks for your review. > > > &g

Re: [PATCH] tpm_tis: Disable interrupts on ThinkPad T490s

2020-11-28 Thread Jarkko Sakkinen
On Tue, Nov 24, 2020 at 10:45:01PM +0100, Hans de Goede wrote: > Hi, > > On 11/24/20 6:52 PM, Jerry Snitselaar wrote: > > > > Jarkko Sakkinen @ 2020-11-23 20:26 MST: > > > >> On Wed, Nov 18, 2020 at 11:36:20PM -0700, Jerry Snitselaar wrote: > >>&

Re: [PATCH] tpm_tis: Disable interrupts on ThinkPad T490s

2020-11-28 Thread Jarkko Sakkinen
On Tue, Nov 24, 2020 at 10:10:21AM -0800, James Bottomley wrote: > On Tue, 2020-11-24 at 10:52 -0700, Jerry Snitselaar wrote: > > Before diving further into that though, does anyone else have an > > opinion on ripping out the irq code, and just using polling? We've > > been only polling since 2015

Re: [PATCH] tpm_tis: Disable interrupts on ThinkPad T490s

2020-11-28 Thread Jarkko Sakkinen
On Tue, Nov 24, 2020 at 10:52:56AM -0700, Jerry Snitselaar wrote: > > Jarkko Sakkinen @ 2020-11-23 20:26 MST: > > > On Wed, Nov 18, 2020 at 11:36:20PM -0700, Jerry Snitselaar wrote: > >> > >> Matthew Garrett @ 2020-10-15 15:39 MST: > >> > >>

Re: [PATCH 131/141] tpm: Fix fall-through warnings for Clang

2020-11-26 Thread Jarkko Sakkinen
On Tue, 2020-11-24 at 08:40 -0600, Gustavo A. R. Silva wrote: > On Tue, Nov 24, 2020 at 12:53:22AM +0200, Jarkko Sakkinen wrote: > > On Tue, Nov 24, 2020 at 12:52:31AM +0200, Jarkko Sakkinen wrote: > > > On Fri, Nov 20, 2020 at 12:40:14PM -0600, Gustavo A. R. Silva wrote: >

Re: [PATCH] tpm: ibmvtpm: fix error return code in tpm_ibmvtpm_probe()

2020-11-25 Thread Jarkko Sakkinen
On Tue, 2020-11-24 at 21:52 +0800, Wang Hai wrote: > Fix to return a negative error code from the error handling > case instead of 0, as done elsewhere in this function. > > Fixes: d8d74ea3c002 ("tpm: ibmvtpm: Wait for buffer to be set before > proceeding") > Reported-by: Hulk Robot >

Re: [PATCH v2] char: tpm: add i2c driver for cr50

2020-11-25 Thread Jarkko Sakkinen
On Tue, 2020-11-24 at 10:14 -0300, Ezequiel Garcia wrote: > Hi Jarkko, > > Thanks for your review. > > On Tue, 2020-11-24 at 00:06 +0200, Jarkko Sakkinen wrote: > > On Fri, Nov 20, 2020 at 07:23:45PM +0200, Adrian Ratiu wrote: > > > From: "dlau...@chro

Re: [PATCH v8 4/4] MAINTAINERS: Add myself as Trusted Keys co-maintainer

2020-11-23 Thread Jarkko Sakkinen
On Tue, Nov 03, 2020 at 09:31:46PM +0530, Sumit Garg wrote: > Add a Trusted Keys co-maintainer entry in order to support TEE based > Trusted Keys framework. > > Signed-off-by: Sumit Garg Acked-by: Jarkko Sakkinen > --- > MAINTAINERS | 2 ++ > 1 file changed, 2 insertio

Re: [PATCH v8 2/4] KEYS: trusted: Introduce TEE based Trusted Keys

2020-11-23 Thread Jarkko Sakkinen
On Tue, Nov 03, 2020 at 09:31:44PM +0530, Sumit Garg wrote: > Add support for TEE based trusted keys where TEE provides the functionality > to seal and unseal trusted keys using hardware unique key. > > Refer to Documentation/tee.txt for detailed information about TEE. > > Signed-off-by: Sumit

<    1   2   3   4   5   6   7   8   9   10   >