Re: [PATCH v8 5/8] ima: make process_buffer_measurement() generic

2019-10-19 Thread Mimi Zohar
On Sat, 2019-10-19 at 14:06 -0400, Nayna Jain wrote: > process_buffer_measurement() is limited to measuring the kexec boot > command line. This patch makes process_buffer_measurement() more > generic, allowing it to measure other types of buffer data (e.g. > blacklisted binary hashes or key

Re: [PATCH v8 7/8] ima: check against blacklisted hashes for files with modsig

2019-10-19 Thread Mimi Zohar
On Sat, 2019-10-19 at 14:06 -0400, Nayna Jain wrote: > diff --git a/Documentation/ABI/testing/ima_policy > b/Documentation/ABI/testing/ima_policy > index 29ebe9afdac4..4c97afcc0f3c 100644 > --- a/Documentation/ABI/testing/ima_policy > +++ b/Documentation/ABI/testing/ima_policy > @@ -25,6 +25,7

Re: [PATCH v8 2/8] powerpc/ima: add support to initialize ima policy rules

2019-10-19 Thread Mimi Zohar
On Sat, 2019-10-19 at 14:06 -0400, Nayna Jain wrote: > index ..65d82ee74ea4 > --- /dev/null > +++ b/arch/powerpc/kernel/ima_arch.c > @@ -0,0 +1,39 @@ > +// SPDX-License-Identifier: GPL-2.0 > +/* > + * Copyright (C) 2019 IBM Corporation > + * Author: Nayna Jain > + */ > + > +#include

Re: [PATCH v8 4/8] powerpc/ima: add measurement rules to ima arch specific policy

2019-10-19 Thread Mimi Zohar
On Sat, 2019-10-19 at 14:06 -0400, Nayna Jain wrote: > This patch adds the measurement rules to the arch specific policies on > trusted boot enabled systems. This version does not add rules to the existing arch specific policy, but defines an arch specific trusted boot only policy and a combined

Re: passing NULL to clock_getres (VDSO): terminated by unexpected signal 11

2019-10-19 Thread Andreas Schwab
On Okt 19 2019, Christophe Leroy wrote: > Hi Nathan, > > While trying to switch powerpc VDSO to C version of gettimeofday(), I'm > getting the following kind of error with vdsotest: > > passing NULL to clock_getres (VDSO): terminated by unexpected signal 11 > > Looking at commit a9446a906f52

Re: [PATCH v7 7/8] ima: check against blacklisted hashes for files with modsig

2019-10-19 Thread Nayna
Hi Mimi, On 10/11/2019 09:19 AM, Mimi Zohar wrote: On Mon, 2019-10-07 at 21:14 -0400, Nayna Jain wrote: Asymmetric private keys are used to sign multiple files. The kernel currently support checking against the blacklisted keys. However, if the public key is blacklisted, any file signed by

Re: [PATCH v7 4/8] powerpc/ima: add measurement rules to ima arch specific policy

2019-10-19 Thread Nayna
Hi Michael, On 10/15/2019 07:29 AM, Michael Ellerman wrote: Nayna Jain writes: This patch adds the measurement rules to the arch specific policies on trusted boot enabled systems. Signed-off-by: Nayna Jain Reviewed-by: Mimi Zohar --- arch/powerpc/kernel/ima_arch.c | 45

[PATCH v8 2/8] powerpc/ima: add support to initialize ima policy rules

2019-10-19 Thread Nayna Jain
PowerNV system use a Linux-based bootloader, which relies on the IMA subsystem to enforce different secure boot modes. Since the verification policy may differ based on the secure boot mode of the system, the policies must be defined at runtime. This patch implements arch-specific support to

[PATCH v8 8/8] powerpc/ima: update ima arch policy to check for blacklist

2019-10-19 Thread Nayna Jain
This patch updates the arch-specific policies for PowerNV system to make sure that the binary hash is not blacklisted. Signed-off-by: Nayna Jain Reviewed-by: Mimi Zohar --- arch/powerpc/kernel/ima_arch.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git

[PATCH v8 7/8] ima: check against blacklisted hashes for files with modsig

2019-10-19 Thread Nayna Jain
Asymmetric private keys are used to sign multiple files. The kernel currently support checking against blacklisted keys. However, if the public key is blacklisted, any file signed by the blacklisted key will automatically fail signature verification. We might not want to blacklist all the files

[PATCH v8 6/8] certs: add wrapper function to check blacklisted binary hash

2019-10-19 Thread Nayna Jain
The -EKEYREJECTED error returned by existing is_hash_blacklisted() is misleading when called for checking against blacklisted hash of a binary. This patch adds a wrapper function is_binary_blacklisted() to return -EPERM error if binary is blacklisted. Signed-off-by: Nayna Jain Reviewed-by: Mimi

[PATCH v8 5/8] ima: make process_buffer_measurement() generic

2019-10-19 Thread Nayna Jain
process_buffer_measurement() is limited to measuring the kexec boot command line. This patch makes process_buffer_measurement() more generic, allowing it to measure other types of buffer data (e.g. blacklisted binary hashes or key hashes). This patch modifies the function to conditionally

[PATCH v8 4/8] powerpc/ima: add measurement rules to ima arch specific policy

2019-10-19 Thread Nayna Jain
This patch adds the measurement rules to the arch specific policies on trusted boot enabled systems. Signed-off-by: Nayna Jain --- arch/powerpc/kernel/ima_arch.c | 34 +- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/kernel/ima_arch.c

[PATCH v8 3/8] powerpc: detect the trusted boot state of the system

2019-10-19 Thread Nayna Jain
While secure boot permits only properly verified signed kernels to be booted, trusted boot takes a measurement of the kernel image prior to boot that can be subsequently compared against good known values via attestation services. This patch reads the trusted boot state of a PowerNV system. The

[PATCH v8 1/8] powerpc: detect the secure boot mode of the system

2019-10-19 Thread Nayna Jain
This patch defines a function to detect the secure boot state of a PowerNV system. The PPC_SECURE_BOOT config represents the base enablement of secure boot for powerpc. Signed-off-by: Nayna Jain --- arch/powerpc/Kconfig | 10 + arch/powerpc/include/asm/secure_boot.h |

[PATCH v8 0/8] powerpc: Enabling IMA arch specific secure boot policies

2019-10-19 Thread Nayna Jain
This patchset extends the previous version[1] by adding support for checking against a blacklist of binary hashes. The IMA subsystem supports custom, built-in, arch-specific policies to define the files to be measured and appraised. These policies are honored based on priority, where

passing NULL to clock_getres (VDSO): terminated by unexpected signal 11

2019-10-19 Thread Christophe Leroy
Hi Nathan, While trying to switch powerpc VDSO to C version of gettimeofday(), I'm getting the following kind of error with vdsotest: passing NULL to clock_getres (VDSO): terminated by unexpected signal 11 Looking at commit a9446a906f52 ("lib/vdso/32: Remove inconsistent NULL pointer

[RFC PATCH 13/13] powerpc/vas: Free send window after credits returned

2019-10-19 Thread Haren Myneni
NX may be processing requests while trying to close window. Wait until all credits are returned and then free send window from VAS instance. Signed-off-by: Haren Myneni --- arch/powerpc/platforms/powernv/vas-window.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git

[RFC PATCH 12/13] powerpc/vas: Display process stuck message

2019-10-19 Thread Haren Myneni
Process can not close send window until all requests are processed. Means wait until window state is not busy and send credits are returned. Display debug message in case taking longer to close the window. Signed-off-by: Haren Myneni --- arch/powerpc/platforms/powernv/vas-window.c | 26

[RFC PATCH 11/13] powerpc/vas: Return credits after handling fault

2019-10-19 Thread Haren Myneni
NX expects OS to return credit for send window after processing each fault. Also credit has to be returned even for fault window. Signed-off-by: Sukadev Bhattiprolu Signed-off-by: Haren Myneni --- arch/powerpc/platforms/powernv/vas-fault.c | 10 ++

[RFC PATCH 10/13] powerpc/vas: Do not use default credits for receive window

2019-10-19 Thread Haren Myneni
System checkstops if RxFIFO overruns with more requests than the maximum possible number of CRBs allowed in FIFO at any time. So max credits value (rxattr.wcreds_max) is set and is passed to vas_rx_win_open() by the the driver. Signed-off-by:Haren Myneni ---

[RFC PATCH 09/13] powerpc/vas: Add and use tgid in vas_window to close window

2019-10-19 Thread Haren Myneni
In multi-thread applications, child can open a window but release FD will not be called upon its exit. NX Send window will be closed with release function. Parent thread will be closing it later upon its exit. The parent can also send NX requests with this window and NX can generate page

[RFC PATCH 08/13] powerpc/vas: Print CRB and FIFO values

2019-10-19 Thread Haren Myneni
Dump FIFO values if could not find send window and print CRB for debugging. Signed-off-by: Sukadev Bhattiprolu Signed-off-by: Haren Myneni --- arch/powerpc/platforms/powernv/vas-fault.c | 40 ++ 1 file changed, 40 insertions(+) diff --git

[RFC PATCH 07/13] powerpc/vas: Update CSB and notify process for fault CRBs

2019-10-19 Thread Haren Myneni
For each fault CRB, update fault address in CRB (fault_storage_addr) and translation error status in CSB. If the actual fault is in CSB, send signal to process with SIGSEGV. Process can send new request by touching the fault address. Signed-off-by: Sukadev Bhattiprolu Signed-off-by: Haren

[RFC PATCH 06/13] powerpc/vas: Read and process fault CRBs

2019-10-19 Thread Haren Myneni
NX pastes CRB in fault FIFO and generates interrupt whenever faults on CRB. OS reads CRBs from fault FIFO and process them by setting faulting address in fault_storge_addr in CRB and update CSB. When CSB status is changed, process sends NX request after touching the fault address.

[RFC PATCH 05/13] powerpc/vas: Setup fault handler per VAS instance

2019-10-19 Thread Haren Myneni
Fault handler is created as kernel thread for each VAS instance and invoked whenever NX generates page fault. This thread reads CRBs from fault FIFO and process them. Signed-off-by: Sukadev Bhattiprolu Signed-off-by: Haren Myneni --- arch/powerpc/platforms/powernv/vas-fault.c | 53