[PATCH v2 10/13] powerpc/pseries/svm: Disable doorbells in SVM guests

2019-07-13 Thread Thiago Jung Bauermann
Pai and Michael Anderson. Signed-off-by: Sukadev Bhattiprolu Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/platforms/pseries/smp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/platforms/pseries/smp.c b/arch/powerpc/platforms/pseries/smp.c index

[PATCH v2 09/13] powerpc/pseries/svm: Export guest SVM status to user space via sysfs

2019-07-13 Thread Thiago Jung Bauermann
-by: Ryan Grimm Reviewed-by: Ram Pai Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/kernel/sysfs.c | 29 + 1 file changed, 29 insertions(+) diff --git a/arch/powerpc/kernel/sysfs.c b/arch/powerpc/kernel/sysfs.c index e2147d7c9e72..f7100ab77d29 100644 --- a/arch

[PATCH v2 08/13] powerpc/pseries/svm: Unshare all pages before kexecing a new kernel

2019-07-13 Thread Thiago Jung Bauermann
, unsharing of pages is skipped. NOTE: While testing crashkernel, make sure at least 256M is reserved for crashkernel. Otherwise SWIOTLB allocation will fail and crash kernel will fail to boot. Signed-off-by: Ram Pai Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/include/asm/ultravisor

[PATCH v2 07/13] powerpc/pseries/svm: Use shared memory for Debug Trace Log (DTL)

2019-07-13 Thread Thiago Jung Bauermann
From: Anshuman Khandual Secure guests need to share the DTL buffers with the hypervisor. To that end, use a kmem_cache constructor which converts the underlying buddy allocated SLUB cache pages into shared memory. Signed-off-by: Anshuman Khandual Signed-off-by: Thiago Jung Bauermann --- arch

[PATCH v2 06/13] powerpc/pseries/svm: Use shared memory for LPPACA structures

2019-07-13 Thread Thiago Jung Bauermann
here. Introduce helper is_svm_platform() which uses the S bit of the MSR to tell whether we're running as a secure guest. Signed-off-by: Anshuman Khandual Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/include/asm/svm.h | 26 arch/powerpc/kernel/paca.c | 43

[PATCH v2 05/13] powerpc/pseries: Add and use LPPACA_SIZE constant

2019-07-13 Thread Thiago Jung Bauermann
Helps document what the hard-coded number means. Also take the opportunity to fix an #endif comment. Suggested-by: Alexey Kardashevskiy Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/kernel/paca.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/arch

[PATCH v2 04/13] powerpc/pseries/svm: Add helpers for UV_SHARE_PAGE and UV_UNSHARE_PAGE

2019-07-13 Thread Thiago Jung Bauermann
From: Ram Pai These functions are used when the guest wants to grant the hypervisor access to certain pages. Signed-off-by: Ram Pai Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/include/asm/ultravisor-api.h | 2 ++ arch/powerpc/include/asm/ultravisor.h | 15 +++ 2

[PATCH v2 03/13] powerpc/prom_init: Add the ESM call to prom_init

2019-07-13 Thread Thiago Jung Bauermann
l Anderson [ bauerman: Cleaned up the code a bit. ] Signed-off-by: Thiago Jung Bauermann --- .../admin-guide/kernel-parameters.txt | 5 + arch/powerpc/include/asm/ultravisor-api.h | 1 + arch/powerpc/kernel/prom_init.c | 99 +++ 3 files changed, 105 insertion

[RFC PATCH v2 02/13] powerpc: Add support for adding an ESM blob to the zImage wrapper

2019-07-13 Thread Thiago Jung Bauermann
e comments. ] Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/boot/main.c | 41 ++ arch/powerpc/boot/ops.h| 2 ++ arch/powerpc/boot/wrapper | 24 +--- arch/powerpc/boot/zImage.lds.S | 8 +++ 4 files changed, 72 insert

[PATCH v2 01/13] powerpc/pseries: Introduce option to build secure virtual machines

2019-07-13 Thread Thiago Jung Bauermann
Introduce CONFIG_PPC_SVM to control support for secure guests and include Ultravisor-related helpers when it is selected Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/include/asm/ultravisor.h | 2 +- arch/powerpc/kernel/Makefile | 4 +++- arch/powerpc/platforms/pseries

[PATCH v2 00/13] Secure Virtual Machine Enablement

2019-07-13 Thread Thiago Jung Bauermann
orce SWIOTLB for secure guests Benjamin Herrenschmidt (1): powerpc: Add support for adding an ESM blob to the zImage wrapper Ram Pai (3): powerpc/prom_init: Add the ESM call to prom_init powerpc/pseries/svm: Add helpers for UV_SHARE_PAGE and UV_UNSHARE_PAGE powerpc/pseries/svm: Unshare all

Re: [PATCH 0/3] Remove x86-specific code from generic headers

2019-07-12 Thread Thiago Jung Bauermann
I forgot to mark this series as v2 when generating the patches. Sorry for the confusion. -- Thiago Jung Bauermann IBM Linux Technology Center

[PATCH 2/3] DMA mapping: Move SME handling to x86-specific files

2019-07-12 Thread Thiago Jung Bauermann
mask.", so we just remove dma_check_mask(). In SWIOTLB code, there's no need to mention which memory encryption feature is active, so just use a more generic warning. Besides, other architectures will have different names for similar technology. Signed-off-by: Thiago Jung Bauermann --- arch/s3

[PATCH 3/3] fs/core/vmcore: Move sev_active() reference to x86 arch code

2019-07-12 Thread Thiago Jung Bauermann
the generic weak implementation. To do that, it's necessary to make read_from_oldmem() public so that it can be used outside of vmcore.c. Signed-off-by: Thiago Jung Bauermann --- arch/x86/kernel/crash_dump_64.c | 5 + fs/proc/vmcore.c| 8 include/linux/crash_dump.h

[PATCH 1/3] x86, s390: Move ARCH_HAS_MEM_ENCRYPT definition to arch/Kconfig

2019-07-12 Thread Thiago Jung Bauermann
powerpc is also going to use this feature, so put it in a generic location. Signed-off-by: Thiago Jung Bauermann Reviewed-by: Thomas Gleixner --- arch/Kconfig | 3 +++ arch/s390/Kconfig | 3 --- arch/x86/Kconfig | 4 +--- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git

[PATCH 0/3] Remove x86-specific code from generic headers

2019-07-12 Thread Thiago Jung Bauermann
//lore.kernel.org/linuxppc-dev/20190521044912.1375-12-bauer...@linux.ibm.com/ ² https://lore.kernel.org/kvm/20190612111236.99538-2-pa...@linux.ibm.com/ Thiago Jung Bauermann (3): x86,s390: Move ARCH_HAS_MEM_ENCRYPT definition to arch/Kconfig DMA mapping: Move SME handling to x86-specific f

Re: [PATCH 2/3] DMA mapping: Move SME handling to x86-specific files

2019-07-12 Thread Thiago Jung Bauermann
eason why there is a requirement for a large DMA > mask. Makes sense. I'll submit a v2 which just removes this code. -- Thiago Jung Bauermann IBM Linux Technology Center

Re: [PATCH 1/3] x86/Kconfig: Move ARCH_HAS_MEM_ENCRYPT to arch/Kconfig

2019-07-12 Thread Thiago Jung Bauermann
Hello Thomas, Thanks for quickly reviewing the patches. Thomas Gleixner writes: > On Fri, 12 Jul 2019, Thiago Jung Bauermann wrote: > >> powerpc and s390 are going to use this feature as well, so put it in a >> generic location. >> >> Signed-off-by: Thiag

Re: [PATCH 3/3] fs/core/vmcore: Move sev_active() reference to x86 arch code

2019-07-12 Thread Thiago Jung Bauermann
[ Cc'ing Tom Lendacky which I forgot to do earlier. Sorry about that. ] Hello Halil, Thanks for the quick review. Halil Pasic writes: > On Fri, 12 Jul 2019 02:36:31 -0300 > Thiago Jung Bauermann wrote: > >> Secure Encrypted Virtualization is an x86-specific feature,

[PATCH 3/3] fs/core/vmcore: Move sev_active() reference to x86 arch code

2019-07-11 Thread Thiago Jung Bauermann
the generic weak implementation. To do that, it's necessary to make read_from_oldmem() public so that it can be used outside of vmcore.c. Signed-off-by: Thiago Jung Bauermann --- arch/x86/kernel/crash_dump_64.c | 5 + fs/proc/vmcore.c| 8 include/linux/crash_dump.h

[PATCH 2/3] DMA mapping: Move SME handling to x86-specific files

2019-07-11 Thread Thiago Jung Bauermann
, other architectures will have different names so this gets unwieldy quickly. Signed-off-by: Thiago Jung Bauermann --- arch/x86/Kconfig | 1 + arch/x86/include/asm/dma-mapping.h | 7 +++ arch/x86/include/asm/mem_encrypt.h | 10 ++ include/linux/mem_encrypt.h

[PATCH 1/3] x86/Kconfig: Move ARCH_HAS_MEM_ENCRYPT to arch/Kconfig

2019-07-11 Thread Thiago Jung Bauermann
powerpc and s390 are going to use this feature as well, so put it in a generic location. Signed-off-by: Thiago Jung Bauermann --- arch/Kconfig | 3 +++ arch/x86/Kconfig | 4 +--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/arch/Kconfig b/arch/Kconfig index c47b328eada0

[PATCH 0/3] Remove x86-specific code from generic headers

2019-07-11 Thread Thiago Jung Bauermann
Linus' master branch; Commit e67a5ed1f86f ("dma-direct: Force unencrypted DMA under SME for certain DMA masks"), which is in dma-mapping/for-next and comes from this patch: https://lore.kernel.org/linux-iommu/10b83d9ff31bca88e94da2ff34e30619eb396078.1562785123.git.thomas.lenda...@amd.com/ Th

Re: [PATCH v12 01/11] MODSIGN: Export module signature definitions

2019-07-04 Thread Thiago Jung Bauermann
Hello Philipp, Philipp Rudo writes: > Hi Thiago, > > > On Thu, 04 Jul 2019 03:42:57 -0300 > Thiago Jung Bauermann wrote: > >> Jessica Yu writes: >> >> > +++ Thiago Jung Bauermann [27/06/19 23:19 -0300]: >> >>IMA will use the modul

Re: [PATCH v12 00/11] Appended signatures support for IMA appraisal

2019-07-04 Thread Thiago Jung Bauermann
Mimi Zohar writes: > On Thu, 2019-06-27 at 23:19 -0300, Thiago Jung Bauermann wrote: >> Hello, >> >> This version is essentially identical to the last one. >> >> It is only a rebase on top of today's linux-integrity/next-queued-testing, >> prompted

Re: [PATCH v12 01/11] MODSIGN: Export module signature definitions

2019-07-04 Thread Thiago Jung Bauermann
Jessica Yu writes: > +++ Thiago Jung Bauermann [27/06/19 23:19 -0300]: >>IMA will use the module_signature format for append signatures, so export >>the relevant definitions and factor out the code which verifies that the >>appended signature trailer is val

Re: [RFC PATCH 03/12] powerpc/prom_init: Add the ESM call to prom_init

2019-06-28 Thread Thiago Jung Bauermann
Hello Alexey, Thanks for reviewing this patch! Alexey Kardashevskiy writes: > On 21/05/2019 14:49, Thiago Jung Bauermann wrote: >> @@ -1707,6 +1723,43 @@ static void __init prom_close_stdin(void) >> } >> } >> >> +#ifdef CONFIG_PPC_SVM >> +stat

[PATCH v12 11/11] ima: Allow template= option for appraise rules as well

2019-06-27 Thread Thiago Jung Bauermann
It's useful being able to specify a different IMA template on appraise policy rules, so allow it. Signed-off-by: Thiago Jung Bauermann Suggested-by: Mimi Zohar --- security/integrity/ima/ima_policy.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/security/integrity/ima

[PATCH v12 09/11] ima: Define ima-modsig template

2019-06-27 Thread Thiago Jung Bauermann
ields as well as the ones from the "ima-sig" descriptor. Change ima_store_measurement() to accept a struct modsig * argument so that it can be passed along to the templates via struct ima_event_data. Suggested-by: Mimi Zohar Signed-off-by: Thiago Jung Bauermann Reviewed-by: Mim

[PATCH v12 10/11] ima: Store the measurement again when appraising a modsig

2019-06-27 Thread Thiago Jung Bauermann
situation and store an additional measurement with the modsig. This is done by adding an IMA_MEASURE action flag if we read a modsig and the IMA template contains a modsig field. Suggested-by: Mimi Zohar Signed-off-by: Thiago Jung Bauermann --- security/integrity/ima/ima.h | 1 + security/int

[PATCH v12 07/11] ima: Implement support for module-style appended signatures

2019-06-27 Thread Thiago Jung Bauermann
. Because modsig verification needs to convert from an integrity keyring id to the keyring itself, add an integrity_keyring_from_id() function in digsig.c so that integrity_modsig_verify() can use it. Signed-off-by: Thiago Jung Bauermann Signed-off-by: Mimi Zohar --- security/integrity/digsig.c

[PATCH v12 08/11] ima: Collect modsig

2019-06-27 Thread Thiago Jung Bauermann
Obtain the modsig and calculate its corresponding hash in ima_collect_measurement(). Signed-off-by: Thiago Jung Bauermann --- security/integrity/ima/ima.h | 8 - security/integrity/ima/ima_api.c | 5 ++- security/integrity/ima/ima_appraise.c | 2 +- security/integrity/ima

[PATCH v12 06/11] ima: Factor xattr_verify() out of ima_appraise_measurement()

2019-06-27 Thread Thiago Jung Bauermann
they're now pointers), and fixing the style of a block comment to appease checkpatch. Suggested-by: Mimi Zohar Signed-off-by: Thiago Jung Bauermann Reviewed-by: Mimi Zohar --- security/integrity/ima/ima_appraise.c | 141 +++--- 1 file changed, 81 insertions(+), 60 deletions

[PATCH v12 05/11] ima: Add modsig appraise_type option for module-style appended signatures

2019-06-27 Thread Thiago Jung Bauermann
a signature stored in the extended attribute or an appended signature. For now, the rule above will behave exactly the same as if appraise_type=imasig was specified. The actual modsig implementation will be introduced separately. Suggested-by: Mimi Zohar Signed-off-by: Thiago Jung Bauermann

[PATCH v12 01/11] MODSIGN: Export module signature definitions

2019-06-27 Thread Thiago Jung Bauermann
() without having to depend on either CONFIG_MODULE_SIG or CONFIG_MODULES. Signed-off-by: Thiago Jung Bauermann Reviewed-by: Mimi Zohar Cc: Jessica Yu --- include/linux/module.h | 3 -- include/linux/module_signature.h | 44 + init/Kconfig | 6

[PATCH v12 03/11] PKCS#7: Introduce pkcs7_get_digest()

2019-06-27 Thread Thiago Jung Bauermann
. Verifying that sinfo->sig->digest isn't NULL is sufficient because both places which allocate sinfo->sig (pkcs7_parse_message() and pkcs7_note_signed_info()) use kzalloc() so sig->digest is always initialized to zero. Signed-off-by: Thiago Jung Bauermann Reviewed-by: Mimi Zohar Cc: David

[PATCH v12 04/11] integrity: Select CONFIG_KEYS instead of depending on it

2019-06-27 Thread Thiago Jung Bauermann
This avoids a dependency cycle in soon-to-be-introduced CONFIG_IMA_APPRAISE_MODSIG: it will select CONFIG_MODULE_SIG_FORMAT which in turn selects CONFIG_KEYS. Kconfig then complains that CONFIG_INTEGRITY_SIGNATURE depends on CONFIG_KEYS. Signed-off-by: Thiago Jung Bauermann Signed-off-by: Mimi

[PATCH v12 02/11] PKCS#7: Refactor verify_pkcs7_signature()

2019-06-27 Thread Thiago Jung Bauermann
IMA will need to verify a PKCS#7 signature which has already been parsed. For this reason, factor out the code which does that from verify_pkcs7_signature() into a new function which takes a struct pkcs7_message instead of a data buffer. Signed-off-by: Thiago Jung Bauermann Reviewed-by: Mimi

[PATCH v12 00/11] Appended signatures support for IMA appraisal

2019-06-27 Thread Thiago Jung Bauermann
asurement again when appraising a modsig" - Renamed ima_template_has_sig() to ima_template_has_modsig(). - Added a change to ima_collect_measurement(), making it to call ima_collect_modsig() even if IMA_COLLECT is set in iint->flags. - Removed IMA_READ_MEASURE flag. - Rena

Re: [RFC PATCH] virtio_ring: Use DMA API if guest memory is encrypted

2019-06-27 Thread Thiago Jung Bauermann
Michael S. Tsirkin writes: > On Mon, Jun 03, 2019 at 10:13:59PM -0300, Thiago Jung Bauermann wrote: >> >> >> Michael S. Tsirkin writes: >> >> > On Wed, Apr 17, 2019 at 06:42:00PM -0300, Thiago Jung Bauermann wrote: >> >> I rephrased it in

Re: [PATCH v11 02/13] PKCS#7: Refactor verify_pkcs7_signature()

2019-06-24 Thread Thiago Jung Bauermann
Hello David, AFAIK Mimi is happy with this patch set, but I still need acks from maintainers of other subsystems that my changes touch before she can accept it. Are this patch and the next one ("PKCS#7: Introduce pkcs7_get_digest()") OK from your PoV? -- Thiago Jung Bauermann

Re: [PATCH v11 01/13] MODSIGN: Export module signature definitions

2019-06-24 Thread Thiago Jung Bauermann
Hello Jessica, AFAIK Mimi is happy with this patch set, but I still need acks from maintainers of other subsystems that my changes touch before she can accept it. Is this patch OK from your PoV? -- Thiago Jung Bauermann IBM Linux Technology Center Thiago Jung Bauermann writes: >

Re: [PATCH kernel 1/2] powerpc/pseries/dma: Allow swiotlb

2019-06-18 Thread Thiago Jung Bauermann
Alexey Kardashevskiy writes: > On 11/05/2019 08:36, Thiago Jung Bauermann wrote: >> >> Alexey Kardashevskiy writes: >> >>> The commit 8617a5c5bc00 ("powerpc/dma: handle iommu bypass in >>> dma_iommu_ops") merged direct DMA ops into the IO

Re: [PATCH v4 3/6] kvmppc: H_SVM_INIT_START and H_SVM_INIT_DONE hcalls

2019-06-18 Thread Thiago Jung Bauermann
+{ > + return H_UNSUPPORTED; > +} > #endif /* CONFIG_PPC_UV */ > #endif /* __POWERPC_KVM_PPC_HMM_H__ */ This patch won't build when CONFIG_PPC_UV isn't set because of two typos: "inine" and the ';' at the end of kvmppc_h_svm_init_done() function prototype. -- Thiago Jung Bauermann IBM Linux Technology Center

[PATCH v11 13/13] ima: Allow template= option for appraise rules as well

2019-06-11 Thread Thiago Jung Bauermann
It's useful being able to specify a different IMA template on appraise policy rules, so allow it. Signed-off-by: Thiago Jung Bauermann Suggested-by: Mimi Zohar --- security/integrity/ima/ima_policy.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/security/integrity/ima

[PATCH v11 11/13] ima: Define ima-modsig template

2019-06-11 Thread Thiago Jung Bauermann
ields as well as the ones from the "ima-sig" descriptor. Change ima_store_measurement() to accept a struct modsig * argument so that it can be passed along to the templates via struct ima_event_data. Suggested-by: Mimi Zohar Signed-off-by: Thiago Jung Bauermann Reviewed-by: Mim

[PATCH v11 12/13] ima: Store the measurement again when appraising a modsig

2019-06-11 Thread Thiago Jung Bauermann
situation and store an additional measurement with the modsig. This is done by adding an IMA_MEASURE action flag if we read a modsig and the IMA template contains a modsig field. Suggested-by: Mimi Zohar Signed-off-by: Thiago Jung Bauermann --- security/integrity/ima/ima.h | 1 + security/int

[PATCH v11 10/13] ima: Collect modsig

2019-06-11 Thread Thiago Jung Bauermann
Obtain the modsig and calculate its corresponding hash in ima_collect_measurement(). Signed-off-by: Thiago Jung Bauermann --- security/integrity/ima/ima.h | 8 - security/integrity/ima/ima_api.c | 5 ++- security/integrity/ima/ima_appraise.c | 2 +- security/integrity/ima

[PATCH v11 09/13] ima: Implement support for module-style appended signatures

2019-06-11 Thread Thiago Jung Bauermann
. Because modsig verification needs to convert from an integrity keyring id to the keyring itself, add an integrity_keyring_from_id() function in digsig.c so that integrity_modsig_verify() can use it. Signed-off-by: Thiago Jung Bauermann Signed-off-by: Mimi Zohar --- security/integrity/digsig.c

[PATCH v11 08/13] ima: Factor xattr_verify() out of ima_appraise_measurement()

2019-06-11 Thread Thiago Jung Bauermann
they're now pointers), and fixing the style of a block comment to appease checkpatch. Suggested-by: Mimi Zohar Signed-off-by: Thiago Jung Bauermann Reviewed-by: Mimi Zohar --- security/integrity/ima/ima_appraise.c | 141 +++--- 1 file changed, 81 insertions(+), 60 deletions

[PATCH v11 07/13] ima: Add modsig appraise_type option for module-style appended signatures

2019-06-11 Thread Thiago Jung Bauermann
a signature stored in the extended attribute or an appended signature. For now, the rule above will behave exactly the same as if appraise_type=imasig was specified. The actual modsig implementation will be introduced separately. Suggested-by: Mimi Zohar Signed-off-by: Thiago Jung Bauermann

[PATCH v11 05/13] integrity: Select CONFIG_KEYS instead of depending on it

2019-06-11 Thread Thiago Jung Bauermann
This avoids a dependency cycle in soon-to-be-introduced CONFIG_IMA_APPRAISE_MODSIG: it will select CONFIG_MODULE_SIG_FORMAT which in turn selects CONFIG_KEYS. Kconfig then complains that CONFIG_INTEGRITY_SIGNATURE depends on CONFIG_KEYS. Signed-off-by: Thiago Jung Bauermann Signed-off-by: Mimi

[PATCH v11 06/13] ima: Use designated initializers for struct ima_event_data

2019-06-11 Thread Thiago Jung Bauermann
all struct initializations. Signed-off-by: Thiago Jung Bauermann Reviewed-by: Mimi Zohar --- security/integrity/ima/ima_api.c | 13 + security/integrity/ima/ima_init.c | 4 ++-- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/security/integrity/ima/ima_api.c b

[PATCH v11 04/13] integrity: Introduce struct evm_xattr

2019-06-11 Thread Thiago Jung Bauermann
ost places the array doesn't hold a digest. A separate struct evm_xattr is introduced, with the original definition of evm_ima_xattr_data to be used in the places that actually expect that definition, specifically the EVM HMAC code. Signed-off-by: Thiago Jung Bauermann Reviewed-by: Mimi Zohar ---

[PATCH v11 03/13] PKCS#7: Introduce pkcs7_get_digest()

2019-06-11 Thread Thiago Jung Bauermann
. Verifying that sinfo->sig->digest isn't NULL is sufficient because both places which allocate sinfo->sig (pkcs7_parse_message() and pkcs7_note_signed_info()) use kzalloc() so sig->digest is always initialized to zero. Signed-off-by: Thiago Jung Bauermann Reviewed-by: Mimi Zohar Cc: David

[PATCH v11 02/13] PKCS#7: Refactor verify_pkcs7_signature()

2019-06-11 Thread Thiago Jung Bauermann
IMA will need to verify a PKCS#7 signature which has already been parsed. For this reason, factor out the code which does that from verify_pkcs7_signature() into a new function which takes a struct pkcs7_message instead of a data buffer. Signed-off-by: Thiago Jung Bauermann Reviewed-by: Mimi

[PATCH v11 01/13] MODSIGN: Export module signature definitions

2019-06-11 Thread Thiago Jung Bauermann
() without having to depend on either CONFIG_MODULE_SIG or CONFIG_MODULES. Signed-off-by: Thiago Jung Bauermann Reviewed-by: Mimi Zohar Cc: Jessica Yu --- include/linux/module.h | 3 -- include/linux/module_signature.h | 44 + init/Kconfig | 6

[PATCH v11 00/13] Appended signatures support for IMA appraisal

2019-06-11 Thread Thiago Jung Bauermann
measurement again when appraising a modsig" - Renamed ima_template_has_sig() to ima_template_has_modsig(). - Added a change to ima_collect_measurement(), making it to call ima_collect_modsig() even if IMA_COLLECT is set in iint->flags. - Removed IMA_READ_MEASURE flag. - Renamed

Re: [RFC PATCH] virtio_ring: Use DMA API if guest memory is encrypted

2019-06-03 Thread Thiago Jung Bauermann
Michael S. Tsirkin writes: > On Wed, Apr 17, 2019 at 06:42:00PM -0300, Thiago Jung Bauermann wrote: >> I rephrased it in terms of address translation. What do you think of >> this version? The flag name is slightly different too: >> >> >> VIRTIO_F_ACCESS_PLA

Re: [PATCH 00/12] Secure Virtual Machine Enablement

2019-06-01 Thread Thiago Jung Bauermann
Hello, Thiago Jung Bauermann writes: > This series enables Secure Virtual Machines (SVMs) on powerpc. SVMs use the > Protected Execution Facility (PEF) and request to be migrated to secure > memory during prom_init() so by default all of their memory is inaccessible > to th

Re: [PATCH v10 09/12] ima: Implement support for module-style appended signatures

2019-05-28 Thread Thiago Jung Bauermann
Mimi Zohar writes: > Hi Thiago, > > On Thu, 2019-04-18 at 00:51 -0300, Thiago Jung Bauermann wrote: >> >> @@ -326,6 +356,10 @@ int ima_appraise_measurement(enum ima_hooks func, >> case INTEGRITY_UNKNOWN: >> break; >> case INTEGRITY_NOXATTRS:/* No EV

Re: [PATCH v10 09/12] ima: Implement support for module-style appended signatures

2019-05-28 Thread Thiago Jung Bauermann
check_sig(sig, buf_len, func_tokens[func]); And in mod_check_sig(): pr_err("%s: Module is not signed with expected PKCS#7 message\n", name); If you think it's not worth it to expose func_tokens, I can make ima_read_modsig() pass a more generic const string such as "IMA modsig" for example. > Other than this, the patch looks good. Nice! -- Thiago Jung Bauermann IBM Linux Technology Center

Re: [PATCH v10 12/12] ima: Store the measurement again when appraising a modsig

2019-05-28 Thread Thiago Jung Bauermann
Mimi Zohar writes: > Hi Thiago, > > On Thu, 2019-04-18 at 00:51 -0300, Thiago Jung Bauermann wrote: >> If the IMA template contains the "modsig" or "d-modsig" field, then the >> modsig should be added to the measurement list when the file is appraised

Re: [PATCH v10 11/12] ima: Define ima-modsig template

2019-05-28 Thread Thiago Jung Bauermann
Mimi Zohar writes: > On Thu, 2019-04-18 at 00:51 -0300, Thiago Jung Bauermann wrote: >> Define new "d-modsig" template field which holds the digest that is >> expected to match the one contained in the modsig, and also new "modsig" >> template fiel

Re: [PATCH v10 01/12] MODSIGN: Export module signature definitions

2019-05-28 Thread Thiago Jung Bauermann
Mimi Zohar writes: > On Thu, 2019-04-18 at 00:51 -0300, Thiago Jung Bauermann wrote: >> IMA will use the module_signature format for append signatures, so export >> the relevant definitions and factor out the code which verifies that the >> appended signature trailer

Re: [PATCH] powerpc: Fix loading of kernel + initramfs with kexec_file_load()

2019-05-27 Thread Thiago Jung Bauermann
Michael Ellerman writes: > On Wed, 2019-05-22 at 22:01:58 UTC, Thiago Jung Bauermann wrote: >> Commit b6664ba42f14 ("s390, kexec_file: drop arch_kexec_mem_walk()") >> changed kexec_add_buffer() to skip searching for a memory location if >> kexec_buf.mem is a

Re: [PATCH 11/12] powerpc/pseries/svm: Force SWIOTLB for secure guests

2019-05-22 Thread Thiago Jung Bauermann
o > that we don't need all this boilerplate code? Yes, that's a good idea. Will do. >> config PPC_SVM >> bool "Secure virtual machine (SVM) support for POWER" >> depends on PPC_PSERIES >> +select SWIOTLB >> +select ARCH_HAS_MEM_ENCRYPT >> default n > > n is the default default, no need to explictly specify it. Indeed. Changed for the next version. -- Thiago Jung Bauermann IBM Linux Technology Center

Re: [PATCH] powerpc: Fix loading of kernel + initramfs with kexec_file_load()

2019-05-22 Thread Thiago Jung Bauermann
Dave Young writes: > On 05/22/19 at 07:01pm, Thiago Jung Bauermann wrote: >> Commit b6664ba42f14 ("s390, kexec_file: drop arch_kexec_mem_walk()") >> changed kexec_add_buffer() to skip searching for a memory location if >> kexec_buf.mem is a

[PATCH] powerpc: Fix loading of kernel + initramfs with kexec_file_load()

2019-05-22 Thread Thiago Jung Bauermann
t Setting the mem field before every call to kexec_add_buffer() fixes this regression. Fixes: b6664ba42f14 ("s390, kexec_file: drop arch_kexec_mem_walk()") Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/kernel/kexec_elf_64.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-

[PATCH 12/12] powerpc/configs: Enable secure guest support in pseries and ppc64 defconfigs

2019-05-20 Thread Thiago Jung Bauermann
From: Ryan Grimm Enables running as a secure guest in platforms with an Ultravisor. Signed-off-by: Ryan Grimm Signed-off-by: Ram Pai Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/configs/ppc64_defconfig | 1 + arch/powerpc/configs/pseries_defconfig | 1 + 2 files changed, 2

[PATCH 10/12] powerpc/pseries/iommu: Don't use dma_iommu_ops on secure guests

2019-05-20 Thread Thiago Jung Bauermann
Secure guest memory is inacessible to devices so regular DMA isn't possible. In that case set devices' dma_map_ops to NULL so that the generic DMA code path will use SWIOTLB and DMA to bounce buffers. Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/platforms/pseries/iommu.c | 6 +- 1

[PATCH 07/12] powerpc/pseries/svm: Use shared memory for Debug Trace Log (DTL)

2019-05-20 Thread Thiago Jung Bauermann
From: Anshuman Khandual Secure guests need to share the DTL buffers with the hypervisor. To that end, use a kmem_cache constructor which converts the underlying buddy allocated SLUB cache pages into shared memory. Signed-off-by: Anshuman Khandual Signed-off-by: Thiago Jung Bauermann --- arch

[PATCH 11/12] powerpc/pseries/svm: Force SWIOTLB for secure guests

2019-05-20 Thread Thiago Jung Bauermann
into the ARCH_HAS_MEM_ENCRYPT hooks and call swiotlb_update_mem_attributes() to convert SWIOTLB's memory pool to shared memory. Signed-off-by: Anshuman Khandual [ Use ARCH_HAS_MEM_ENCRYPT hooks to share swiotlb memory pool. ] Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/include/asm/mem_encrypt.h | 19

[PATCH 09/12] powerpc/pseries/svm: Disable doorbells in SVM guests

2019-05-20 Thread Thiago Jung Bauermann
Pai and Michael Anderson. Signed-off-by: Sukadev Bhattiprolu Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/platforms/pseries/smp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/platforms/pseries/smp.c b/arch/powerpc/platforms/pseries/smp.c index

[PATCH 08/12] powerpc/pseries/svm: Export guest SVM status to user space via sysfs

2019-05-20 Thread Thiago Jung Bauermann
-by: Ryan Grimm Reviewed-by: Ram Pai Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/kernel/sysfs.c | 29 + 1 file changed, 29 insertions(+) diff --git a/arch/powerpc/kernel/sysfs.c b/arch/powerpc/kernel/sysfs.c index e8e93c2c7d03..8fdab134e9ae 100644 --- a/arch

[PATCH 06/12] powerpc/pseries/svm: Use shared memory for LPPACA structures

2019-05-20 Thread Thiago Jung Bauermann
here. Introduce helper is_svm_platform() which uses the S bit of the MSR to tell whether we're running as a secure guest. Signed-off-by: Anshuman Khandual Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/include/asm/svm.h | 26 arch/powerpc/kernel/paca.c | 43

[PATCH 05/12] powerpc/pseries: Add and use LPPACA_SIZE constant

2019-05-20 Thread Thiago Jung Bauermann
Helps document what the hard-coded number means. Also take the opportunity to fix an #endif comment. Suggested-by: Alexey Kardashevskiy Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/kernel/paca.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/arch

[PATCH 00/12] Secure Virtual Machine Enablement

2019-05-20 Thread Thiago Jung Bauermann
t: Add the ESM call to prom_init powerpc/pseries/svm: Add helpers for UV_SHARE_PAGE and UV_UNSHARE_PAGE Ryan Grimm (2): powerpc/pseries/svm: Export guest SVM status to user space via sysfs powerpc/configs: Enable secure guest support in pseries and ppc64 defconfigs Sukadev Bhattiprolu (1)

[PATCH 04/12] powerpc/pseries/svm: Add helpers for UV_SHARE_PAGE and UV_UNSHARE_PAGE

2019-05-20 Thread Thiago Jung Bauermann
From: Ram Pai These functions are used when the guest wants to grant the hypervisor access to certain pages. Signed-off-by: Ram Pai Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/include/asm/ultravisor-api.h | 2 ++ arch/powerpc/include/asm/ultravisor.h | 14 ++ 2

[RFC PATCH 03/12] powerpc/prom_init: Add the ESM call to prom_init

2019-05-20 Thread Thiago Jung Bauermann
hcall when the ESM ucall fails. ] Signed-off-by: Michael Anderson [ Cleaned up the code a bit. ] Signed-off-by: Thiago Jung Bauermann --- .../admin-guide/kernel-parameters.txt | 5 + arch/powerpc/include/asm/ultravisor-api.h | 1 + arch/powerpc/kernel/prom_init.c

[RFC PATCH 02/12] powerpc: Add support for adding an ESM blob to the zImage wrapper

2019-05-20 Thread Thiago Jung Bauermann
mments. ] Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/boot/main.c | 41 ++ arch/powerpc/boot/ops.h| 2 ++ arch/powerpc/boot/wrapper | 24 +--- arch/powerpc/boot/zImage.lds.S | 8 +++ 4 files changed, 72 insertions(+),

[PATCH 01/12] powerpc/pseries: Introduce option to build secure virtual machines

2019-05-20 Thread Thiago Jung Bauermann
Introduce CONFIG_PPC_SVM to control support for secure guests and include Ultravisor-related helpers when it is selected Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/include/asm/ultravisor.h | 2 +- arch/powerpc/kernel/Makefile | 4 +++- arch/powerpc/platforms/pseries

Re: [PATCH] powerpc/64s: Make boot look nice(r)

2019-05-16 Thread Thiago Jung Bauermann
gt;> >> #define pr_fmt(fmt) "hash-mmu: " fmt >> >> Could we simply undef it just before print_system_hash_info() ? > > Little bit fragile I think. > >> Or move print_system_hash_info() in another book3s64 specific file which >> doesn't set pr_fmt ? > > print_system_info() would be okay for me and allow getting rid of > that PPC64 config. Although it also needs to go in a file without > pr_fmt I guess that's not so hard. Or it could use printk(KERN_INFO "...") instead of pr_info(), which I think makes sense if the pr_fmt prefix is undesired. -- Thiago Jung Bauermann IBM Linux Technology Center

Re: [PATCH kernel 2/2] powerpc/pseries/dma: Enable swiotlb

2019-05-10 Thread Thiago Jung Bauermann
t; select PPC_DOORBELL > select FORCE_SMP > + select SWIOTLB > default y > > config PPC_SPLPAR I put this in a PPC_SVM config option: https://lore.kernel.org/linuxppc-dev/20180824162535.22798-3-bauer...@linux.ibm.com/ -- Thiago Jung Bauermann IBM Linux Technology Center

Re: [PATCH kernel 1/2] powerpc/pseries/dma: Allow swiotlb

2019-05-10 Thread Thiago Jung Bauermann
Freeing unused kernel memory: 4224K [0.406519] This architecture does not have kernel memory protection. [0.406633] Run /sbin/init as init process Sorry, I don't have any information on where the guest is stuck. I tried +l, +t and +w but nothing out of the ordinary showed up. Will try somethin

Re: [PATCH v4] powerpc/pseries: Remove limit in wait for dying CPU

2019-04-30 Thread Thiago Jung Bauermann
Hello Nathan, Thanks for reviewing the patch! Nathan Lynch writes: > Thiago Jung Bauermann writes: >> This can be a problem because if the busy loop finishes too early, then the >> kernel may offline another CPU before the previous one finished dying, >> which would l

Re: [RFC PATCH] virtio_ring: Use DMA API if guest memory is encrypted

2019-04-26 Thread Thiago Jung Bauermann
Michael S. Tsirkin writes: > On Wed, Apr 24, 2019 at 10:01:56PM -0300, Thiago Jung Bauermann wrote: >> >> Michael S. Tsirkin writes: >> >> > On Wed, Apr 17, 2019 at 06:42:00PM -0300, Thiago Jung Bauermann wrote: >> >> >> >> Michael S. Tsi

Re: [RFC PATCH] virtio_ring: Use DMA API if guest memory is encrypted

2019-04-24 Thread Thiago Jung Bauermann
Michael S. Tsirkin writes: > On Wed, Apr 17, 2019 at 06:42:00PM -0300, Thiago Jung Bauermann wrote: >> >> Michael S. Tsirkin writes: >> >> > On Thu, Mar 21, 2019 at 09:05:04PM -0300, Thiago Jung Bauermann wrote: >> >> >> >> Michael S. Tsi

[PATCH v4] powerpc/pseries: Remove limit in wait for dying CPU

2019-04-23 Thread Thiago Jung Bauermann
il the CPU stops. Also change the loop to wait 100 µs between each call to smp_query_cpu_stopped() to avoid querying RTAS too often. Signed-off-by: Thiago Jung Bauermann Analyzed-by: Gautham R Shenoy --- arch/powerpc/platforms/pseries/hotplug-cpu.c | 10 +++--- 1 file changed, 7 insert

[PATCH v10 12/12] ima: Store the measurement again when appraising a modsig

2019-04-17 Thread Thiago Jung Bauermann
situation and store an additional measurement with the modsig. This is done by adding an IMA_MEASURE action flag if we read a modsig and the IMA template contains a modsig field. Suggested-by: Mimi Zohar Signed-off-by: Thiago Jung Bauermann --- security/integrity/ima/ima.h | 1 + security/int

[PATCH v10 11/12] ima: Define ima-modsig template

2019-04-17 Thread Thiago Jung Bauermann
ields as well as the ones from the "ima-sig" descriptor. Change ima_store_measurement() to accept a struct modsig * argument so that it can be passed along to the templates via struct ima_event_data. Suggested-by: Mimi Zohar Signed-off-by: Thiago Jung Bauermann --- Documentation/securi

[PATCH v10 10/12] ima: Collect modsig

2019-04-17 Thread Thiago Jung Bauermann
Obtain the modsig and calculate its corresponding hash in ima_collect_measurement(). Signed-off-by: Thiago Jung Bauermann --- security/integrity/ima/ima.h | 8 - security/integrity/ima/ima_api.c | 5 ++- security/integrity/ima/ima_appraise.c | 2 +- security/integrity/ima

[PATCH v10 09/12] ima: Implement support for module-style appended signatures

2019-04-17 Thread Thiago Jung Bauermann
. Because modsig verification needs to convert from an integrity keyring id to the keyring itself, add an integrity_keyring_from_id() function in digsig.c so that integrity_modsig_verify() can use it. Signed-off-by: Thiago Jung Bauermann Signed-off-by: Mimi Zohar --- security/integrity/digsig.c

[PATCH v10 08/12] ima: Factor xattr_verify() out of ima_appraise_measurement()

2019-04-17 Thread Thiago Jung Bauermann
they're now pointers), and fixing the style of a block comment to appease checkpatch. Suggested-by: Mimi Zohar Signed-off-by: Thiago Jung Bauermann --- security/integrity/ima/ima_appraise.c | 141 +++--- 1 file changed, 81 insertions(+), 60 deletions(-) diff --git a/security

[PATCH v10 07/12] ima: Add modsig appraise_type option for module-style appended signatures

2019-04-17 Thread Thiago Jung Bauermann
a signature stored in the extended attribute or an appended signature. For now, the rule above will behave exactly the same as if appraise_type=imasig was specified. The actual modsig implementation will be introduced separately. Suggested-by: Mimi Zohar Signed-off-by: Thiago Jung Bauermann

[PATCH v10 06/12] ima: Use designated initializers for struct ima_event_data

2019-04-17 Thread Thiago Jung Bauermann
all struct initializations. Signed-off-by: Thiago Jung Bauermann --- security/integrity/ima/ima_api.c | 11 +++ security/integrity/ima/ima_init.c | 4 ++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/security/integrity/ima/ima_api.c b/security/integrity/ima/ima_api.c

[PATCH v10 05/12] integrity: Select CONFIG_KEYS instead of depending on it

2019-04-17 Thread Thiago Jung Bauermann
This avoids a dependency cycle in soon-to-be-introduced CONFIG_IMA_APPRAISE_MODSIG: it will select CONFIG_MODULE_SIG_FORMAT which in turn selects CONFIG_KEYS. Kconfig then complains that CONFIG_INTEGRITY_SIGNATURE depends on CONFIG_KEYS. Signed-off-by: Thiago Jung Bauermann Signed-off-by: Mimi

[PATCH v10 04/12] integrity: Introduce struct evm_xattr

2019-04-17 Thread Thiago Jung Bauermann
ost places the array doesn't hold a digest. A separate struct evm_xattr is introduced, with the original definition of evm_ima_xattr_data to be used in the places that actually expect that definition, specifically the EVM HMAC code. Signed-off-by: Thiago Jung Bauermann Reviewed-by: Mimi Zohar ---

[PATCH v10 03/12] PKCS#7: Introduce pkcs7_get_digest()

2019-04-17 Thread Thiago Jung Bauermann
. Verifying that sinfo->sig->digest isn't NULL is sufficient because both places which allocate sinfo->sig (pkcs7_parse_message() and pkcs7_note_signed_info()) use kzalloc() so sig->digest is always initialized to zero. Signed-off-by: Thiago Jung Bauermann Cc: David Howells Cc: Herbert Xu

[PATCH v10 02/12] PKCS#7: Refactor verify_pkcs7_signature()

2019-04-17 Thread Thiago Jung Bauermann
IMA will need to verify a PKCS#7 signature which has already been parsed. For this reason, factor out the code which does that from verify_pkcs7_signature() into a new function which takes a struct pkcs7_message instead of a data buffer. Signed-off-by: Thiago Jung Bauermann Reviewed-by: Mimi

<    1   2   3   4   5   6   7   8   9   >