[PATCH v2 1/2] selftests/powerpc: Add ptrace tests for Protection Key registers

2018-05-24 Thread Thiago Jung Bauermann
This test exercises read and write access to the AMR, IAMR and UAMOR. Signed-off-by: Thiago Jung Bauermann --- tools/testing/selftests/powerpc/include/reg.h | 1 + tools/testing/selftests/powerpc/ptrace/Makefile| 5 +- tools/testing/selftests/powerpc/ptrace/child.h | 139

Re: [PATCH 1/2] selftests/powerpc: Add ptrace tests for Protection Key registers

2018-05-24 Thread Thiago Jung Bauermann
Michael Ellerman writes: > Thiago Jung Bauermann writes: > >> This test exercises read and write access to the AMR, IAMR and UAMOR. >> >> Signed-off-by: Thiago Jung Bauermann >> --- >> tools/testing/selftests/powerpc/include/reg.h | 1 + >&g

Re: [PATCH v2 7/7] ima: Support platform keyring for kernel appraisal

2018-12-12 Thread Thiago Jung Bauermann
tegrity_digsig_verify() above will always fail, and the audit message of failed signature verifications for KEXEC_KERNEL will always log the same rc value, which is whatever request_key() returns when asked to look for an inexistent keyring. Here is a patch which only performs the second try if the platf

Re: [PATCH v2 1/7] integrity: Define a trusted platform keyring

2018-12-12 Thread Thiago Jung Bauermann
t; security/integrity/digsig.c| 48 > +++--- > security/integrity/integrity.h | 3 +- > .../integrity/platform_certs/platform_keyring.c| 35 > 5 files changed, 83 insertions(+), 15 deletions(-) > cre

Re: [PATCH v2 2/7] integrity: Load certs to the platform keyring

2018-12-12 Thread Thiago Jung Bauermann
changed, 90 insertions(+), 24 deletions(-) Reviewed-by: Thiago Jung Bauermann -- Thiago Jung Bauermann IBM Linux Technology Center

Re: [PATCH v2 7/7] ima: Support platform keyring for kernel appraisal

2018-12-12 Thread Thiago Jung Bauermann
ling integrity_digsig_verify() > with INTEGRITY_KEYRING_IMA for readability > > security/integrity/ima/ima_appraise.c | 13 +++-- > 1 file changed, 11 insertions(+), 2 deletions(-) With the change to only access the platform keyring when it is enabled: Reviewed-by: Thiago Jung Bauermann -- Thiago Jung Bauermann IBM Linux Technology Center

[PATCH] integrity: Remove references to module keyring

2018-12-12 Thread Thiago Jung Bauermann
>From what I can tell, it has never been used. Signed-off-by: Thiago Jung Bauermann --- security/integrity/digsig.c| 1 - security/integrity/integrity.h | 5 ++--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/security/integrity/digsig.c b/security/integrity/digsig.c in

[PATCH v9 03/14] PKCS#7: Introduce pkcs7_get_digest()

2018-12-12 Thread Thiago Jung Bauermann
work. 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

[PATCH v9 00/14] Appended signatures support for IMA appraisal

2018-12-12 Thread Thiago Jung Bauermann
te modsig to the measurement list" - Moved some functions from patch "ima: Add functions to read and verify a modsig signature" into this patch. - Moved code related to d-sig support to new patch. - Patch "ima: Store the measurement again when appraisi

[PATCH v9 01/14] MODSIGN: Export module signature definitions

2018-12-12 Thread Thiago Jung Bauermann
() without having to depend on CONFIG_MODULE_SIG. Signed-off-by: Thiago Jung Bauermann Reviewed-by: Mimi Zohar Cc: Jessica Yu --- include/linux/module.h | 3 -- include/linux/module_signature.h | 47 ++ init/Kconfig | 6 ++- kernel/Makefile

[PATCH v9 02/14] PKCS#7: Refactor verify_pkcs7_signature() and add pkcs7_get_message_sig()

2018-12-12 Thread Thiago Jung Bauermann
message, so add pkcs7_get_message_sig(). Signed-off-by: Thiago Jung Bauermann Reviewed-by: Mimi Zohar Cc: David Howells Cc: David Woodhouse Cc: Herbert Xu Cc: "David S. Miller" --- certs/system_keyring.c| 61 --- crypto/asymmetric_keys/pkcs

[PATCH v9 06/14] integrity: Introduce asymmetric_sig_has_known_key()

2018-12-12 Thread Thiago Jung Bauermann
function. Signed-off-by: Thiago Jung Bauermann Signed-off-by: Mimi Zohar --- security/integrity/digsig_asymmetric.c | 44 +++--- security/integrity/integrity.h | 8 + 2 files changed, 41 insertions(+), 11 deletions(-) diff --git a/security/integrity

[PATCH v9 04/14] integrity: Introduce struct evm_xattr

2018-12-12 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 v9 05/14] integrity: Introduce integrity_keyring_from_id()

2018-12-12 Thread Thiago Jung Bauermann
IMA will need to obtain the keyring used to verify file signatures so that it can verify the module-style signature appended to files. Signed-off-by: Thiago Jung Bauermann Signed-off-by: Mimi Zohar --- security/integrity/digsig.c| 28 +--- security/integrity

[PATCH v9 10/14] ima: Add modsig appraise_type option for module-style appended signatures

2018-12-12 Thread Thiago Jung Bauermann
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 v9 09/14] ima: Export func_tokens

2018-12-12 Thread Thiago Jung Bauermann
ima_read_modsig() will need it so that it can show an error message. Signed-off-by: Thiago Jung Bauermann --- security/integrity/ima/ima.h| 2 ++ security/integrity/ima/ima_policy.c | 12 ++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/security/integrity/ima

[PATCH v9 14/14] ima: Store the measurement again when appraising a modsig

2018-12-12 Thread Thiago Jung Bauermann
nal measurement with the modsig. This is done by defining the appraise subaction flag IMA_READ_MEASURE and testing for it in process_measurement(). Suggested-by: Mimi Zohar Signed-off-by: Thiago Jung Bauermann --- security/integrity/ima/ima.h | 1 + security/integrity/ima/ima_

[PATCH v9 12/14] ima: Add new "d-sig" template field

2018-12-12 Thread Thiago Jung Bauermann
Define new "d-sig" template field which holds the digest that is expected to match the one contained in the modsig. Suggested-by: Mimi Zohar Signed-off-by: Thiago Jung Bauermann --- Documentation/security/IMA-templates.rst | 5 security/integrity/ima/ima.h

[PATCH v9 07/14] integrity: Select CONFIG_KEYS instead of depending on it

2018-12-12 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 v9 08/14] ima: Introduce is_signed()

2018-12-12 Thread Thiago Jung Bauermann
With the introduction of another IMA signature type (modsig), some places will need to check for both of them. It is cleaner to do that if there's a helper function to tell whether an xattr_value represents an IMA signature. Suggested-by: Mimi Zohar Signed-off-by: Thiago Jung Baue

[PATCH v9 11/14] ima: Implement support for module-style appended signatures

2018-12-12 Thread Thiago Jung Bauermann
nable building the sign-file tool when CONFIG_IMA_APPRAISE_MODSIG is enabled, so that the user can sign files using this format. Signed-off-by: Thiago Jung Bauermann --- scripts/Makefile | 4 +- security/integrity/digsig.c | 3 + security/integrity/ima/Kc

[PATCH v9 13/14] ima: Write modsig to the measurement list

2018-12-12 Thread Thiago Jung Bauermann
Add modsig support to the "sig" template field, allowing the the contents of the modsig to be included in the measurement list. Suggested-by: Mimi Zohar Signed-off-by: Thiago Jung Bauermann --- security/integrity/ima/ima.h | 7 +++ security/integrity/ima/im

Re: [PATCH] integrity: Remove references to module keyring

2018-12-17 Thread Thiago Jung Bauermann
James Morris writes: > On Mon, 17 Dec 2018, Mimi Zohar wrote: > >> On Tue, 2018-12-18 at 06:33 +1100, James Morris wrote: >> > On Wed, 12 Dec 2018, Thiago Jung Bauermann wrote: >> > >> > > >From what I can tell, it has never been used. >>

Re: [PATCH] pseries/hotplug: Add more delay in pseries_cpu_die while waiting for rtas-stop

2018-12-10 Thread Thiago Jung Bauermann
#x27;s just a conjecture. -- Thiago Jung Bauermann IBM Linux Technology Center

Re: [PATCH 04/12] __wr_after_init: x86_64: __wr_op

2018-12-20 Thread Thiago Jung Bauermann
*/ > + wr_poking_base = TASK_UNMAPPED_BASE + > + (kaslr_get_random_long("Write Rare Poking") & PAGE_MASK) % > + (TASK_SIZE - (TASK_UNMAPPED_BASE + wr_range)); > + > + /* > + * Place 64TB of kernel address space within 128TB of user ad

Re: [PATCH 11/12] IMA: turn ima_policy_flags into __wr_after_init

2018-12-20 Thread Thiago Jung Bauermann
> As the name implies, the write protection kicks in only after init() > is completed; before that moment, the data is modifiable in the usual > way. Given that, is it still necessary or useful to use wr_assign() in a function marked with __init? -- Thiago Jung Bauermann IBM Linux Technology Center

Re: [PATCH v18 01/11] powerpc: Rename kexec elfcorehdr_addr to elf_load_addr

2021-02-15 Thread Thiago Jung Bauermann
h/powerpc/include/asm/kexec.h | 2 +- > arch/powerpc/kexec/file_load.c| 4 ++-- > arch/powerpc/kexec/file_load_64.c | 4 ++-- > 3 files changed, 5 insertions(+), 5 deletions(-) Reviewed-by: Thiago Jung Bauermann -- Thiago Jung Bauermann IBM Linux Technology Center

Re: [PATCH v18 02/11] arm64: Rename kexec elf_headers_mem to elf_load_addr

2021-02-15 Thread Thiago Jung Bauermann
for setting up the device tree for > kexec system call. > > Rename elf_headers_mem to elf_load_addr to align with powerpc name so > common code can use it. > > Signed-off-by: Lakshmi Ramasubramanian > Suggested-by: Thiago Jung Bauermann > --- > arch/arm64/include/a

Re: [PATCH v18 03/11] of: Add a common kexec FDT setup function

2021-02-15 Thread Thiago Jung Bauermann
amasubramanian > --- > drivers/of/Makefile | 6 + > drivers/of/kexec.c | 265 ++++++++ > include/linux/of.h | 5 + > 3 files changed, 276 insertions(+) > create mode 100644 drivers/of/kexec.c Reviewed-by: Thiago Jung Bauermann -- Thiago Jung Bauermann IBM Linux Technology Center

Re: [PATCH v18 04/11] arm64: Use common of_kexec_alloc_and_setup_fdt()

2021-02-15 Thread Thiago Jung Bauermann
> 1 file changed, 8 insertions(+), 172 deletions(-) Reviewed-by: Thiago Jung Bauermann -- Thiago Jung Bauermann IBM Linux Technology Center

Re: [PATCH v18 05/11] powerpc: Use common of_kexec_alloc_and_setup_fdt()

2021-02-15 Thread Thiago Jung Bauermann
c/elf_64.c | 30 --- > arch/powerpc/kexec/file_load.c| 132 +- > arch/powerpc/kexec/file_load_64.c | 3 + > 4 files changed, 26 insertions(+), 140 deletions(-) Reviewed-by: Thiago Jung Bauermann -- Thiago Jung Bauermann IBM Linux Technology Center

Re: [PATCH v18 06/11] powerpc: Move ima buffer fields to struct kimage

2021-02-15 Thread Thiago Jung Bauermann
a/ima_kexec.c | 8 ++-- > 5 files changed, 11 insertions(+), 37 deletions(-) Reviewed-by: Thiago Jung Bauermann -- Thiago Jung Bauermann IBM Linux Technology Center

[PATCH v7 00/14] Appended signatures support for IMA appraisal

2018-05-22 Thread Thiago Jung Bauermann
s xattr_value to evm_verifyxattr() unless xattr_value is a modsig. - Patch "ima: Write modsig to the measurement list" - Since now we determine whether we'll use an xattr sig or a modsig at the time they are read, there's no need to store a measurement again in the m

[PATCH v7 02/14] PKCS#7: Refactor verify_pkcs7_signature() and add pkcs7_get_message_sig()

2018-05-22 Thread Thiago Jung Bauermann
message, so add pkcs7_get_message_sig(). Signed-off-by: Thiago Jung Bauermann Reviewed-by: Mimi Zohar Cc: David Howells Cc: David Woodhouse Cc: Herbert Xu Cc: "David S. Miller" --- certs/system_keyring.c| 61 ++- crypto/asymm

[PATCH v7 03/14] PKCS#7: Introduce pkcs7_get_digest()

2018-05-22 Thread Thiago Jung Bauermann
work. 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

[PATCH v7 07/14] integrity: Select CONFIG_KEYS instead of depending on it

2018-05-22 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 v7 05/14] integrity: Introduce integrity_keyring_from_id()

2018-05-22 Thread Thiago Jung Bauermann
IMA will need to obtain the keyring used to verify file signatures so that it can verify the module-style signature appended to files. Signed-off-by: Thiago Jung Bauermann Signed-off-by: Mimi Zohar --- security/integrity/digsig.c| 28 +--- security/integrity

[PATCH v7 08/14] ima: Introduce is_signed()

2018-05-22 Thread Thiago Jung Bauermann
With the introduction of another IMA signature type (modsig), some places will need to check for both of them. It is cleaner to do that if there's a helper function to tell whether an xattr_value represents an IMA signature. Suggested-by: Mimi Zohar Signed-off-by: Thiago Jung Baue

[PATCH v7 06/14] integrity: Introduce asymmetric_sig_has_known_key()

2018-05-22 Thread Thiago Jung Bauermann
function. Signed-off-by: Thiago Jung Bauermann Signed-off-by: Mimi Zohar --- security/integrity/digsig_asymmetric.c | 44 +- security/integrity/integrity.h | 8 +++ 2 files changed, 41 insertions(+), 11 deletions(-) diff --git a/security/integrity

[PATCH v7 09/14] ima: Export func_tokens

2018-05-22 Thread Thiago Jung Bauermann
ima_read_modsig() will need it so that it can show an error message. Signed-off-by: Thiago Jung Bauermann --- security/integrity/ima/ima.h| 2 ++ security/integrity/ima/ima_policy.c | 12 ++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/security/integrity/ima

[PATCH v7 12/14] ima: Add new "d-sig" template field

2018-05-22 Thread Thiago Jung Bauermann
Define new "d-sig" template field which holds the digest that is expected to match the one contained in the modsig. Suggested-by: Mimi Zohar Signed-off-by: Thiago Jung Bauermann --- Documentation/security/IMA-templates.rst | 5 + security/integrity/ima/ima.h

[PATCH v7 14/14] ima: Store the measurement again when appraising a modsig

2018-05-22 Thread Thiago Jung Bauermann
nal measurement with the modsig. This is done by defining the appraise subaction flag IMA_READ_MEASURE and testing for it in process_measurement(). Suggested-by: Mimi Zohar Signed-off-by: Thiago Jung Bauermann --- security/integrity/ima/ima.h | 1 + security/integrity/ima/ima_

[PATCH v7 11/14] ima: Implement support for module-style appended signatures

2018-05-22 Thread Thiago Jung Bauermann
-off-by: Thiago Jung Bauermann --- security/integrity/ima/Kconfig| 3 + security/integrity/ima/ima.h | 36 - security/integrity/ima/ima_appraise.c | 64 +-- security/integrity/ima/ima_main.c | 17 +++- security/integrity/ima/ima_modsig.c | 145

[PATCH v7 13/14] ima: Write modsig to the measurement list

2018-05-22 Thread Thiago Jung Bauermann
Add modsig support to the "sig" template field, allowing the the contents of the modsig to be included in the measurement list. Suggested-by: Mimi Zohar Signed-off-by: Thiago Jung Bauermann --- security/integrity/ima/ima.h | 7 +++ security/integrity/ima/im

[PATCH v7 10/14] ima: Add modsig appraise_type option for module-style appended signatures

2018-05-22 Thread Thiago Jung Bauermann
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 v7 04/14] integrity: Introduce struct evm_xattr

2018-05-22 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. Signed-off-by: Thiago Jung Bauermann --- security/integrity/evm/evm_crypto.c | 4

[PATCH v7 01/14] MODSIGN: Export module signature definitions

2018-05-22 Thread Thiago Jung Bauermann
() without having to depend on CONFIG_MODULE_SIG. 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 +++- kernel/Makefile

Re: [PATCH v2] powerpc, pkey: make protection key 0 less special

2018-04-04 Thread Thiago Jung Bauermann
> { > if (static_branch_likely(&pkey_disabled)) > return; > - mm_pkey_allocation_map(mm) = initial_allocation_mask; > + > + /* allocate key-0 by default */ > + mm_pkey_allocation_map(mm) = initial_allocation_mask | 0x1; > /* -1 means unallocated or invalid */ > mm->context.execute_only_pkey = -1; > } I think we should also set the AMOR and UAMOR bits for key 0. Otherwise, key 0 will be in allocated-but-not-enabled state which is yet another subtle way in which it will be special. Also, pkey_access_permitted() has a special case for key 0. Should it? -- Thiago Jung Bauermann IBM Linux Technology Center

Re: [PATCH 1/2] selftests/powerpc: Add ptrace tests for Protection Key registers

2018-03-27 Thread Thiago Jung Bauermann
Ram Pai writes: > On Fri, Feb 23, 2018 at 03:33:43PM -0300, Thiago Jung Bauermann wrote: >> This test exercises read and write access to the AMR, IAMR and UAMOR. >> > > Tested-by: Ram Pai > Acked-by: Ram Pai Ping? Can this and patch 2/2 go in v4.17? >> Signed

Re: [PATCH v12 07/22] selftests/vm: fixed bugs in pkey_disable_clear()

2018-03-28 Thread Thiago Jung Bauermann
ey_reg() < orig_pkey_reg); >> } >> >> void pkey_write_allow(int pkey) > > This seems so horribly wrong that I wonder how it worked in the first > place. Any idea? The code simply wasn't used. pkey_disable_clear() is called by pkey_write_allow() and pkey_access_allow(), but before this patch series nothing called either of these functions. -- Thiago Jung Bauermann IBM Linux Technology Center

Re: [PATCH v12 07/22] selftests/vm: fixed bugs in pkey_disable_clear()

2018-03-28 Thread Thiago Jung Bauermann
Dave Hansen writes: > On 03/28/2018 01:47 PM, Thiago Jung Bauermann wrote: >>>>if (flags) >>>> - assert(rdpkey_reg() > orig_pkey_reg); >>>> + assert(rdpkey_reg() < orig_pkey_reg); >>>> } >>>> >>

[PATCH] powerpc: kexec_file: Fix error code when trying to load kdump kernel

2018-03-29 Thread Thiago Jung Bauermann
: Operation not supported Fixes: a0458284f062 ("powerpc: Add support code for kexec_file_load()") Reported-by: Dave Young Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/kernel/machine_kexec_file_64.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) This is a minor issue

Re: [PATCH v3] powerpc/pseries: Only wait for dying CPU after call to rtas_stop_self()

2019-03-12 Thread Thiago Jung Bauermann
Gautham R Shenoy writes: >> Signed-off-by: Thiago Jung Bauermann > > Thanks for this version. I have tested the patch and we no longer see > the "Querying DEAD? cpu X (Y) shows 2" message. > > > Tested-and-Reviewed-by: Gautham R. Shenoy Thanks f

Re: [PATCH v5 10/10] integrity: support EC-RDSA signatures for asymmetric_verify

2019-02-25 Thread Thiago Jung Bauermann
= "raw"; > + } else { > + pks.pkey_algo = "rsa"; > + pks.encoding = "pkcs1"; > + } > pks.digest = (u8 *)data; > pks.digest_size = datalen; > pks.s = hdr->sig; -- Thiago Jung Bauermann IBM Linux Technology Center

Re: [PATCH v17 02/10] of: Add a common kexec FDT setup function

2021-02-11 Thread Thiago Jung Bauermann
4 KB to initial_boot_params won't be enough for crash kernels on ppc64. The current powerpc code doubles the size of initial_boot_params (which is normally larger than 4 KB) and even that isn't enough. A patch was added to powerpc/next today which uses a more precise (but arch-specific) formula: https://lore.kernel.org/linuxppc-dev/161243826811.119001.14083048209224609814.stgit@hbathini/ So I believe we need a hook here where architectures can provide their own specific calculation for the size of the fdt. Perhaps a weakly defined function providing a default implementation which an arch-specific file can override (a la arch_kexec_kernel_image_load())? Then the powerpc specific hook would be the kexec_fdt_totalsize_ppc64() function from the patch I linked above. -- Thiago Jung Bauermann IBM Linux Technology Center

Re: [PATCH v17 02/10] of: Add a common kexec FDT setup function

2021-02-11 Thread Thiago Jung Bauermann
Lakshmi Ramasubramanian writes: > On 2/11/21 5:09 PM, Thiago Jung Bauermann wrote: >> There's actually a complication that I just noticed and needs to be >> addressed. More below. >> > > <...> > >>> + >>> +/* >>> + * o

Re: [PATCH v17 02/10] of: Add a common kexec FDT setup function

2021-02-12 Thread Thiago Jung Bauermann
nian >>>> wrote: >>>>> >>>>> On 2/11/21 5:09 PM, Thiago Jung Bauermann wrote: >>>>>> >>>>>> There's actually a complication that I just noticed and needs to be >>>>>> addressed. More below. &g

Re: [PATCH v19 01/13] kexec: Move ELF fields to struct kimage

2021-02-23 Thread Thiago Jung Bauermann
; 1 file changed, 5 insertions(+) With that fixed: Reviewed-by: Thiago Jung Bauermann -- Thiago Jung Bauermann IBM Linux Technology Center

Re: [PATCH v19 02/13] arm64: Use ELF fields defined in 'struct kimage'

2021-02-23 Thread Thiago Jung Bauermann
and the commit id is meaningless. > Reported-by: kernel test robot > --- > arch/arm64/include/asm/kexec.h | 4 > arch/arm64/kernel/machine_kexec_file.c | 18 +- > 2 files changed, 9 insertions(+), 13 deletions(-) With that fixed: Reviewed-by: Thiago Jung Bauermann -- Thiago Jung Bauermann IBM Linux Technology Center

Re: [PATCH v19 03/13] powerpc: Use ELF fields defined in 'struct kimage'

2021-02-23 Thread Thiago Jung Bauermann
and the commit id is meaningless. > Reported-by: kernel test robot > --- > arch/powerpc/include/asm/kexec.h | 4 > arch/powerpc/kexec/file_load.c| 6 +++--- > arch/powerpc/kexec/file_load_64.c | 14 +++--- > 3 files changed, 10 insertions(+), 14 deletions(-)

Re: [PATCH v19 04/13] x86: Use ELF fields defined in 'struct kimage'

2021-02-23 Thread Thiago Jung Bauermann
--- > arch/x86/kernel/kexec-bzimage64.c | 2 +- > arch/x86/kernel/machine_kexec_64.c | 4 ++-- > 4 files changed, 10 insertions(+), 15 deletions(-) With that fixed: Reviewed-by: Thiago Jung Bauermann -- Thiago Jung Bauermann IBM Linux Technology Center

Re: [PATCH v19 04/13] x86: Use ELF fields defined in 'struct kimage'

2021-02-23 Thread Thiago Jung Bauermann
arch/x86/kernel/kexec-bzimage64.c | 2 +- > arch/x86/kernel/machine_kexec_64.c | 4 ++-- > 4 files changed, 10 insertions(+), 15 deletions(-) With that fixed: Reviewed-by: Thiago Jung Bauermann -- Thiago Jung Bauermann IBM Linux Technology Center

Re: [PATCH v19 05/13] of: Add a common kexec FDT setup function

2021-02-23 Thread Thiago Jung Bauermann
+++++++ > include/linux/of.h | 5 + > 3 files changed, 276 insertions(+) > create mode 100644 drivers/of/kexec.c With that fixed: Reviewed-by: Thiago Jung Bauermann -- Thiago Jung Bauermann IBM Linux Technology Center

Re: [PATCH v17 02/10] of: Add a common kexec FDT setup function

2021-02-10 Thread Thiago Jung Bauermann
masubramanian > --- > drivers/of/Makefile | 6 ++ > drivers/of/kexec.c | 258 ++++++++ > include/linux/of.h | 13 +++ > 3 files changed, 277 insertions(+) > create mode 100644 drivers/of/kexec.c Reviewed-by: Thiago Jung Bauermann -- Thiago Jung Bauermann IBM Linux Technology Center

Re: [PATCH v17 03/10] arm64: Use common of_kexec_alloc_and_setup_fdt()

2021-02-10 Thread Thiago Jung Bauermann
> 1 file changed, 8 insertions(+), 172 deletions(-) Reviewed-by: Thiago Jung Bauermann -- Thiago Jung Bauermann IBM Linux Technology Center

Re: [PATCH v17 04/10] powerpc: Use common of_kexec_alloc_and_setup_fdt()

2021-02-10 Thread Thiago Jung Bauermann
initrd_len, cmdline); > if (!fdt) { > pr_err("Not enough memory for the device tree.\n"); This error string can be a bit misleading now, since of_kexec_alloc_and_setup_fdt() can fail for reasons other than lack of memory. I suggest changing it to the error st

Re: [PATCH v17 06/10] powerpc: Enable passing IMA log to next kernel on kexec

2021-02-10 Thread Thiago Jung Bauermann
CONFIG_IMA > is enabled, to indicate that the IMA measurement log information is > present in the device tree for powerpc. > > Signed-off-by: Lakshmi Ramasubramanian > Suggested-by: Thiago Jung Bauermann > --- > arch/powerpc/Kconfig | 2 +- > 1 file changed, 1 insertion(+),

Re: [PATCH v17 07/10] powerpc: Move arch independent ima kexec functions to drivers/of/kexec.c

2021-02-10 Thread Thiago Jung Bauermann
es changed, 241 insertions(+), 272 deletions(-) > delete mode 100644 arch/powerpc/include/asm/ima.h > delete mode 100644 arch/powerpc/kexec/ima.c Reviewed-by: Thiago Jung Bauermann Tested-by: Thiago Jung Bauermann -- Thiago Jung Bauermann IBM Linux Technology Center

Re: [PATCH v17 09/10] powerpc: Delete unused function delete_fdt_mem_rsv()

2021-02-10 Thread Thiago Jung Bauermann
uot;. > > Co-developed-by: Prakhar Srivastava > Signed-off-by: Prakhar Srivastava > Signed-off-by: Lakshmi Ramasubramanian > --- > arch/powerpc/include/asm/kexec.h | 1 - > arch/powerpc/kexec/file_load.c | 32 -------- > 2 files changed,

Re: [PATCH v17 10/10] arm64: Enable passing IMA log to next kernel on kexec

2021-02-10 Thread Thiago Jung Bauermann
Prakhar Srivastava > Signed-off-by: Lakshmi Ramasubramanian > Suggested-by: Thiago Jung Bauermann > --- > arch/arm64/Kconfig | 1 + > 1 file changed, 1 insertion(+) Reviewed-by: Thiago Jung Bauermann -- Thiago Jung Bauermann IBM Linux Technology Center

Re: [PATCH] of: error: 'const struct kimage' has no member named 'arch'

2021-02-18 Thread Thiago Jung Bauermann
reusing CONFIG_HAVE_IMA_KEXEC for ppc. > > But for arm64, CONFIG_HAVE_IMA_KEXEC is enabled in the final patch in the > patch > set (the one for carrying forward IMA log across kexec for arm64). arm64 calls > of_kexec_alloc_and_setup_fdt() prior to enabling CONFIG_HAVE_IMA_KEXEC and > hence > breaks the build for arm64. One problem is that I believe that this patch won't placate the robot, because IIUC it generates config files at random and this change still allows hppa and s390 to enable CONFIG_OF_KEXEC. Perhaps a new CONFIG_HAVE_KIMAGE_ARCH option? Not having that option would still allow building kexec.o, but would be used inside kexec.c to avoid accessing kimage.arch members. -- Thiago Jung Bauermann IBM Linux Technology Center

Re: [PATCH] of: error: 'const struct kimage' has no member named 'arch'

2021-02-19 Thread Thiago Jung Bauermann
Lakshmi Ramasubramanian writes: > On 2/18/21 5:13 PM, Thiago Jung Bauermann wrote: >> Lakshmi Ramasubramanian writes: >> >>> On 2/18/21 4:07 PM, Mimi Zohar wrote: >>> >>> Hi Mimi, >>> >>>> On Thu, 2021-02-18 at 14:33 -0800, La

[PATCH] powerpc/kexec_file: Restore FDT size estimation for kdump kernel

2021-02-19 Thread Thiago Jung Bauermann
space needed by the kdump kernel, and change the function name so that it better reflects what the function is now doing. Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/include/asm/kexec.h | 2 +- arch/powerpc/kexec/elf_64.c | 2 +- arch/powerpc/kexec/file_load_64.c | 26 -

Re: [PATCH 04/13] module: use RCU to synchronize find_module

2021-01-28 Thread Thiago Jung Bauermann
len, > > struct module *find_module(const char *name) > { > - module_assert_mutex(); Does it make sense to replace the assert above with the warn below (untested)? RCU_LOCKDEP_WARN(rcu_read_lock_sched_held()); > return find_module_all(name, strlen(name), false); &g

Re: [PATCH 04/13] module: use RCU to synchronize find_module

2021-01-29 Thread Thiago Jung Bauermann
Christoph Hellwig writes: > On Thu, Jan 28, 2021 at 05:50:56PM -0300, Thiago Jung Bauermann wrote: >> > struct module *find_module(const char *name) >> > { >> > - module_assert_mutex(); >> >> Does it make sense to replace the asse

Re: [PATCH v15 09/10] arm64: Call kmalloc() to allocate DTB buffer

2021-02-01 Thread Thiago Jung Bauermann
Joe Perches writes: > On Thu, 2021-01-28 at 00:52 -0300, Thiago Jung Bauermann wrote: >> The problem is that this patch implements only part of the suggestion, >> which isn't useful in itself. So the patch series should either drop >> this patch or consolidate the

Re: [PATCH v2 2/2] memblock: do not start bottom-up allocations with kernel_end

2021-02-08 Thread Thiago Jung Bauermann
Mike Rapoport writes: > On Sat, Jan 23, 2021 at 06:09:11PM -0800, Andrew Morton wrote: >> On Fri, 22 Jan 2021 01:37:14 -0300 Thiago Jung Bauermann >> wrote: >> >> > Mike Rapoport writes: >> > >> > > > Signed-off-by: Rom

Re: [PATCH 5.10 051/120] memblock: do not start bottom-up allocations with kernel_end

2021-02-09 Thread Thiago Jung Bauermann
re and a warning like this one: Not sure if this is ready for stable yet (including stable branches 4.19 and 5.4), since it seems to uncover latent bugs in x86 early memory reservation. I asked about this issue here: https://lore.kernel.org/lkml/87ft26yuwg.fsf@manicouagan.localdomain/ -- Thia

Re: [PATCH v3] powerpc/pseries/svm: Allocate SWIOTLB buffer anywhere in memory

2020-08-19 Thread Thiago Jung Bauermann
Konrad Rzeszutek Wilk writes: > On Tue, Aug 18, 2020 at 07:11:26PM -0300, Thiago Jung Bauermann wrote: >> POWER secure guests (i.e., guests which use the Protection Execution >> Facility) need to use SWIOTLB to be able to do I/O with the hypervisor, but >> they don't

Re: [PATCH v2] powerpc/pseries/svm: Allocate SWIOTLB buffer anywhere in memory

2020-08-18 Thread Thiago Jung Bauermann
Christoph Hellwig writes: > On Mon, Aug 17, 2020 at 06:46:58PM -0300, Thiago Jung Bauermann wrote: >> POWER secure guests (i.e., guests which use the Protection Execution >> Facility) need to use SWIOTLB to be able to do I/O with the hypervisor, but >> they don't nee

[PATCH v3] powerpc/pseries/svm: Allocate SWIOTLB buffer anywhere in memory

2020-08-18 Thread Thiago Jung Bauermann
instead of memblock_alloc_low(). Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/include/asm/svm.h | 4 arch/powerpc/mm/mem.c| 6 +- arch/powerpc/platforms/pseries/svm.c | 26 ++ 3 files changed, 35 insertions(+), 1 deletion(-) Chang

Re: [PATCH v3] powerpc/pseries/svm: Allocate SWIOTLB buffer anywhere in memory

2020-08-19 Thread Thiago Jung Bauermann
Christoph Hellwig writes: > On Tue, Aug 18, 2020 at 07:11:26PM -0300, Thiago Jung Bauermann wrote: >> POWER secure guests (i.e., guests which use the Protection Execution >> Facility) need to use SWIOTLB to be able to do I/O with the hypervisor, but >> they don't nee

Re: [PATCH v10 2/8] powerpc: Move delete_fdt_mem_rsv() to drivers/of/kexec.c

2020-12-11 Thread Thiago Jung Bauermann
Hi Lakshmi, Lakshmi Ramasubramanian writes: > On 12/6/20 5:50 PM, Lakshmi Ramasubramanian wrote: > > Hi Thiago, > >> On 12/4/20 6:22 PM, Thiago Jung Bauermann wrote >>> >>> Hello Lakshmi, >>> >>> Lakshmi Ramasubramanian writes: >>

Re: [PATCH v10 2/8] powerpc: Move delete_fdt_mem_rsv() to drivers/of/kexec.c

2020-12-11 Thread Thiago Jung Bauermann
Lakshmi Ramasubramanian writes: > On 12/11/20 10:19 AM, Thiago Jung Bauermann wrote: >> Hi Lakshmi, >> Lakshmi Ramasubramanian writes: >> >>> On 12/6/20 5:50 PM, Lakshmi Ramasubramanian wrote: >>> >>> Hi Thiago, >>> >>>&

Re: [RFC PATCH 2/4] of: Add a common kexec FDT setup function

2020-12-11 Thread Thiago Jung Bauermann
exec.c when CONFIG_KEXEC_FILE is enabled is fine. But when > more functions (such as remove_ima_buffer()) are moved to this file, Makefile > needs to be updated for other ima kexec related CONFIGs. IMA kexec is only available if CONFIG_KEXEC_FILE is enabled, so I don't understand what problem you are seeing. -- Thiago Jung Bauermann IBM Linux Technology Center

Re: [RFC PATCH 1/4] powerpc: Rename kexec elfcorehdr_addr to elf_headers_mem

2020-12-22 Thread Thiago Jung Bauermann
ec/file_load_64.c | 4 ++-- > 3 files changed, 5 insertions(+), 5 deletions(-) Reviewed-by: Thiago Jung Bauermann -- Thiago Jung Bauermann IBM Linux Technology Center

Re: [RFC PATCH 2/4] of: Add a common kexec FDT setup function

2020-12-22 Thread Thiago Jung Bauermann
alloc. The > arm64 version also retries with a bigger allocation. That seems > unnecessary. > --- > drivers/of/Makefile | 1 + > drivers/of/kexec.c | 228 ++++++++ > include/linux/of.h | 5 + > 3 files changed, 234 insertions(+) > create mode 100644 drivers/of/kexec.c Reviewed-by: Thiago Jung Bauermann -- Thiago Jung Bauermann IBM Linux Technology Center

Re: [RFC PATCH 3/4] arm64: Use common of_kexec_setup_new_fdt()

2020-12-22 Thread Thiago Jung Bauermann
Rob Herring writes: > Signed-off-by: Rob Herring > --- > arch/arm64/kernel/machine_kexec_file.c | 123 + > 1 file changed, 3 insertions(+), 120 deletions(-) Reviewed-by: Thiago Jung Bauermann -- Thiago Jung Bauermann IBM Linux Technology Center

Re: [RFC PATCH 4/4] powerpc: Use common of_kexec_setup_new_fdt()

2020-12-22 Thread Thiago Jung Bauermann
Rob Herring writes: > Signed-off-by: Rob Herring > --- > > After the IMA changes, delete_fdt_mem_rsv() can also be removed. > > arch/powerpc/kexec/file_load.c | 125 ++--- > 1 file changed, 6 insertions(+), 119 deletions(-) Reviewed-by:

Re: [PATCH v13 1/6] ima: Move arch_ima_add_kexec_buffer() to ima

2020-12-22 Thread Thiago Jung Bauermann
--- > arch/powerpc/kexec/ima.c | 17 - > security/integrity/ima/ima_kexec.c | 22 ++ > 3 files changed, 22 insertions(+), 20 deletions(-) Reviewed-by: Thiago Jung Bauermann Just one nit below. Also, I just noticed that this patch series hasn't been cc'

Re: [PATCH v13 2/6] powerpc: Move arch independent ima kexec functions to drivers/of/kexec.c

2020-12-22 Thread Thiago Jung Bauermann
100644 > --- a/security/integrity/ima/ima_kexec.c > +++ b/security/integrity/ima/ima_kexec.c > @@ -10,6 +10,7 @@ > #include > #include > #include > +#include > #include > #include "ima.h" This include isn't necessary. -- Thiago Jung Bauermann IBM Linux Technology Center

Re: [PATCH v13 2/6] powerpc: Move arch independent ima kexec functions to drivers/of/kexec.c

2020-12-22 Thread Thiago Jung Bauermann
uot;arch/powerpc/kexec/ima.c" to > "drivers/of/kexec.c" only when CONFIG_HAVE_IMA_KEXEC is enabled. > > => Also, compile write_number() and setup_ima_buffer() only when > CONFIG_IMA_KEXEC is enabled. Sounds good, with one additional change: So far, CONFIG_HAVE_IMA

Re: [PATCH v13 2/6] powerpc: Move arch independent ima kexec functions to drivers/of/kexec.c

2020-12-22 Thread Thiago Jung Bauermann
With this change, setup_new_fdt() is nothing more than a call to of_kexec_setup_new_fdt(). It should be removed, and its caller should call of_kexec_setup_new_fdt() directly. This change could be done in patch 4 of this series, to keep this patch simpler. -- Thiago Jung Bauermann IBM Linux Technology Center

Re: [PATCH v13 3/6] kexec: Use fdt_appendprop_addrrange() to add ima buffer to FDT

2020-12-22 Thread Thiago Jung Bauermann
r Srivastava > Signed-off-by: Prakhar Srivastava > Signed-off-by: Lakshmi Ramasubramanian > --- > drivers/of/kexec.c | 57 -- > 1 file changed, 5 insertions(+), 52 deletions(-) This is a nice improvement, thanks. Reviewed-by: Thiago Jung Bauermann -- Thiago Jung Bauermann IBM Linux Technology Center

Re: [PATCH v13 4/6] powerpc: Delete unused function delete_fdt_mem_rsv()

2020-12-22 Thread Thiago Jung Bauermann
etions(-) As I mentioned in the other email, this patch could remove setup_new_fdt() as well. I'm a bit ambivalent on whether this patch should be squashed with patch 2 or left on its own, but I tend toward the latter option because patch 2 is big enough already. -- Thiago Jung Bauermann IBM Linux Technology Center

Re: [PATCH v13 5/6] arm64: Free DTB buffer if fdt_open_into() fails

2020-12-22 Thread Thiago Jung Bauermann
ons(+), 1 deletion(-) Reviewed-by: Thiago Jung Bauermann -- Thiago Jung Bauermann IBM Linux Technology Center

Re: [PATCH v13 6/6] arm64: Add IMA log information in kimage used for kexec

2020-12-22 Thread Thiago Jung Bauermann
rm64/Kconfig > @@ -1094,6 +1094,7 @@ config KEXEC > config KEXEC_FILE > bool "kexec file based system call" > select KEXEC_CORE > + select HAVE_IMA_KEXEC > help > This is new version of kexec system call. This system call is > file based

Re: [PATCH v14 0/6] Carry forward IMA measurement log on kexec on ARM64

2021-01-12 Thread Thiago Jung Bauermann
erence for >> allocating the FDT. Then we can further consolidate the DT kexec code. >> >> It all needs some acks from arm64 and powerpc maintainers. As far as >> merging, I think via the integrity tree makes the most sense. > > Thanks, Rob. Lakshmi, please update Rob's patches to include patch > descriptions before re-posting. Also please update the powerpc mailing list address to linuxppc-...@lists.ozlabs.org -- Thiago Jung Bauermann IBM Linux Technology Center

Re: [PATCH v14 2/6] powerpc: Move arch independent ima kexec functions to drivers/of/kexec.c

2021-01-12 Thread Thiago Jung Bauermann
| 202 > drivers/of/kexec.c | 240 + > include/linux/of.h | 2 + > security/integrity/ima/ima.h | 4 - > security/integrity/ima/ima_kexec.c | 1 + > 9 files changed, 244 insertions(+), 248 dele

Re: [PATCH v14 4/6] powerpc: Delete unused functions

2021-01-12 Thread Thiago Jung Bauermann
> arch/powerpc/include/asm/kexec.h | 4 --- > arch/powerpc/kexec/file_load.c| 60 --- > arch/powerpc/kexec/file_load_64.c | 4 ++- > 3 files changed, 3 insertions(+), 65 deletions(-) Reviewed-by: Thiago Jung Bauermann -- Thiago Jung Bauermann IBM Linux Technology Center

<    1   2   3   4   5   6   7   >