[PATCH v2] IMA: support for duplicate data measurement

2021-02-16 Thread Tushar Sugandhi
asurement of duplicate data, driven by a Kconfig option - IMA_DISABLE_HTABLE. Signed-off-by: Tushar Sugandhi --- Change Log v2: - Incorporated feedback from Mimi on v1. - The fix is not just applicable to measurement of critical data, it now applies to other buffers and file data as well.

Re: [PATCH v3] IMA: support for duplicate measurement records

2021-02-23 Thread Tushar Sugandhi
Hello Petr, On 2021-02-23 4:18 p.m., Petr Vorel wrote: Hi Tushar, Change Log v3: - Incorporated feedback from Mimi on v2. - Updated patch title and description to make it generic. - Changed config description word 'data' to 'records'. - Tested use cases for boot param "ima_policy=tcb".

Re: [PATCH v2] IMA: support for duplicate data measurement

2021-02-17 Thread Tushar Sugandhi
Thanks for the feedback Mimi. Appreciate it. On 2021-02-17 7:03 a.m., Mimi Zohar wrote: Hi Tushar, The Subject line could be improved. Perhaps something like - "IMA: support for duplicate measurement records" Will do. On Tue, 2021-02-16 at 18:46 -0800, Tushar Sugandhi wrote: IM

Re: [PATCH v2] IMA: support for duplicate data measurement

2021-02-17 Thread Tushar Sugandhi
On 2021-02-17 12:39 p.m., Mimi Zohar wrote: On Wed, 2021-02-17 at 10:53 -0800, Tushar Sugandhi wrote: Thanks for the feedback Mimi. Appreciate it. On 2021-02-17 7:03 a.m., Mimi Zohar wrote: Hi Tushar, The Subject line could be improved. Perhaps something like - "IMA: suppor

Re: [PATCH v2] IMA: support for duplicate data measurement

2021-02-18 Thread Tushar Sugandhi
Hi Mimi, On 2021-02-17 12:49 p.m., Tushar Sugandhi wrote: On 2021-02-17 12:39 p.m., Mimi Zohar wrote: On Wed, 2021-02-17 at 10:53 -0800, Tushar Sugandhi wrote: Thanks for the feedback Mimi. Appreciate it. On 2021-02-17 7:03 a.m., Mimi Zohar wrote: Hi Tushar, The Subject line could be

[PATCH v3] IMA: support for duplicate measurement records

2021-02-18 Thread Tushar Sugandhi
e measurement log. This limits the ability of the attestation service to accurately determine the current state of the system, because it would be interpreted as the system having 'val#2' for the given record. Update ima_add_template_entry() to support measurement of duplicate records, driven by a

[PATCH 2/3] IMA: update functions to read allow_dup policy condition

2021-01-29 Thread Tushar Sugandhi
data. Signed-off-by: Tushar Sugandhi --- security/integrity/ima/ima.h | 4 ++-- security/integrity/ima/ima_api.c | 6 -- security/integrity/ima/ima_appraise.c | 2 +- security/integrity/ima/ima_main.c | 6 +++--- security/integrity/ima/ima_policy.c | 7 ++- 5 files

[PATCH 3/3] IMA: add support to measure duplicate buffer for critical data hook

2021-01-29 Thread Tushar Sugandhi
buffer entry for integrity critical data should be measured. Signed-off-by: Tushar Sugandhi --- security/integrity/ima/ima.h | 4 ++-- security/integrity/ima/ima_api.c | 9 + security/integrity/ima/ima_init.c | 2 +- security/integrity/ima/ima_main.c | 5 +++-- security/integrity

[PATCH 1/3] IMA: add policy condition to measure duplicate critical data

2021-01-30 Thread Tushar Sugandhi
IMA policy condition, for the IMA func CRITICAL_DATA to allow duplicate buffer measurement of integrity critical data. Limit the ability to measure duplicate buffer data when action is "measure" and func is CRITICAL_DATA. Signed-off-by: Tushar Sugandhi --- Documentation/ABI/tes

[PATCH 0/3] support for duplicate measurement of integrity critical data

2021-01-30 Thread Tushar Sugandhi
ting commit b3f82afc1041 ("IMA: Measure kernel version in early boot") Tushar Sugandhi (3): IMA: add policy condition to measure duplicate critical data IMA: update functions to read allow_dup policy condition IMA: add support to measure duplicate buffer for critical data

Re: [PATCH 0/3] support for duplicate measurement of integrity critical data

2021-02-09 Thread Tushar Sugandhi
Thank you Mimi for reviewing this series. On 2021-02-08 1:10 p.m., Mimi Zohar wrote: Hi Tushar, On Mon, 2021-02-08 at 15:22 -0500, Mimi Zohar wrote: On Fri, 2021-01-29 at 16:45 -0800, Tushar Sugandhi wrote: IMA does not measure duplicate buffer data since TPM extend is a very expensive

Re: [PATCH 1/3] IMA: add policy condition to measure duplicate critical data

2021-02-09 Thread Tushar Sugandhi
On 2021-02-08 12:45 p.m., Mimi Zohar wrote: Hi Tushar, On Fri, 2021-01-29 at 16:45 -0800, Tushar Sugandhi wrote: IMA needs to support duplicate measurements of integrity critical data to accurately determine the current state of that data on the system. Further, since measurement of

Re: [PATCH 3/3] IMA: add support to measure duplicate buffer for critical data hook

2021-02-09 Thread Tushar Sugandhi
On 2021-02-08 12:24 p.m., Mimi Zohar wrote: Hi Tushar, On Fri, 2021-01-29 at 16:45 -0800, Tushar Sugandhi wrote: diff --git a/security/integrity/ima/ima_queue.c b/security/integrity/ima/ima_queue.c index c096ef8945c7..fbf359495fa8 100644 --- a/security/integrity/ima/ima_queue.c +++ b

Re: [PATCH 0/3] support for duplicate measurement of integrity critical data

2021-02-09 Thread Tushar Sugandhi
On 2021-02-09 10:53 a.m., Mimi Zohar wrote: On Tue, 2021-02-09 at 10:23 -0800, Tushar Sugandhi wrote: On Mon, 2021-02-08 at 15:22 -0500, Mimi Zohar wrote: On Fri, 2021-01-29 at 16:45 -0800, Tushar Sugandhi wrote: IMA does not measure duplicate buffer data since TPM extend is a very

[PATCH 3/3] IMA: define IMA hook to measure critical data from kernel components

2020-08-12 Thread Tushar Sugandhi
return the status code of the operation. Signed-off-by: Tushar Sugandhi --- include/linux/ima.h | 9 security/integrity/ima/ima.h | 8 +++ security/integrity/ima/ima_main.c | 37 --- 3 files changed, 42 insertions(+), 12 deletions

[PATCH 0/3] IMA: Infrastructure for measurement of critical kernel data

2020-08-12 Thread Tushar Sugandhi
epo: https://git.kernel.org/pub/scm/linux/kernel/git/zohar/linux-integrity.git branch: next-integrity This series also has a dependency on the following patch series: https://patchwork.kernel.org/patch/11709527/ Tushar Sugandhi (3): IMA: generalize keyring specific measurement constructs

[PATCH 2/3] IMA: add policy to support measuring critical data from kernel components

2020-08-12 Thread Tushar Sugandhi
enlightened for IMA measurement. Signed-off-by: Tushar Sugandhi --- Documentation/ABI/testing/ima_policy | 6 +- security/integrity/ima/ima.h | 1 + security/integrity/ima/ima_api.c | 2 +- security/integrity/ima/ima_policy.c | 84 ++-- 4 files changed, 74

[PATCH 1/3] IMA: generalize keyring specific measurement constructs

2020-08-12 Thread Tushar Sugandhi
measurement constructs to be generic and reusable in other measurement scenarios. Rename the parameter "size" in process_buffer_measurement() to "buf_len" to indicate it is the length of the buffer pointed by the parameter "buf". Signed-off-by: Tushar Sugandhi ---

Re: [PATCH v7 1/8] IMA: generalize keyring specific measurement constructs

2020-12-10 Thread Tushar Sugandhi
On 2020-12-10 2:14 p.m., Tyler Hicks wrote: On 2020-12-09 11:42:05, Tushar Sugandhi wrote: IMA functions such as ima_match_keyring(), process_buffer_measurement(), ima_match_policy() etc. handle data specific to keyrings. Currently, these constructs are not generic to handle any func

Re: [PATCH v7 2/8] IMA: add support to measure buffer data hash

2020-12-10 Thread Tushar Sugandhi
On 2020-12-10 2:38 p.m., Tyler Hicks wrote: On 2020-12-09 11:42:06, Tushar Sugandhi wrote: The original IMA buffer data measurement sizes were small (e.g. boot command line), but the new buffer data measurement use cases have data sizes that are a lot larger. Just as IMA measures the file

Re: [PATCH v7 6/8] IMA: extend critical data hook to limit the measurement based on a label

2020-12-10 Thread Tushar Sugandhi
On 2020-12-10 3:19 p.m., Tyler Hicks wrote: On 2020-12-09 11:42:10, Tushar Sugandhi wrote: The IMA hook ima_measure_critical_data() does not support a way to specify the source of the critical data provider. Thus, the data measurement cannot be constrained based on the data source label in

Re: [PATCH v7 7/8] IMA: define a builtin critical data measurement policy

2020-12-10 Thread Tushar Sugandhi
On 2020-12-10 3:22 p.m., Tyler Hicks wrote: On 2020-12-09 11:42:11, Tushar Sugandhi wrote: From: Lakshmi Ramasubramanian Define a new critical data builtin policy to allow measuring early kernel integrity critical data before a custom IMA policy is loaded. Add critical data to built-in

Re: [PATCH v7 3/8] IMA: define a hook to measure kernel integrity critical data

2020-12-10 Thread Tushar Sugandhi
On 2020-12-10 3:02 p.m., Tyler Hicks wrote: On 2020-12-09 11:42:07, Tushar Sugandhi wrote: IMA provides capabilities to measure file data, and in-memory buffer data. However, various data structures, policies, and states stored in kernel memory also impact the integrity of the system

Re: [PATCH v7 4/8] IMA: add policy rule to measure critical data

2020-12-10 Thread Tushar Sugandhi
On 2020-12-10 3:10 p.m., Tyler Hicks wrote: On 2020-12-09 11:42:08, Tushar Sugandhi wrote: A new IMA policy rule is needed for the IMA hook ima_measure_critical_data() and the corresponding func CRITICAL_DATA for measuring the input buffer. The policy rule should ensure the buffer would get

Re: [PATCH v7 5/8] IMA: limit critical data measurement based on a label

2020-12-10 Thread Tushar Sugandhi
On 2020-12-10 3:15 p.m., Tyler Hicks wrote: On 2020-12-09 11:42:09, Tushar Sugandhi wrote: System administrators should be able to limit which kernel subsystems they want to measure the critical data for. To enable that, an IMA policy condition to choose specific kernel subsystems is needed

Re: [PATCH v7 3/8] IMA: define a hook to measure kernel integrity critical data

2020-12-11 Thread Tushar Sugandhi
+ */ +void ima_measure_critical_data(const char *event_name, + const void *buf, int buf_len, + bool measure_buf_hash) +{ + if (!event_name || !buf || !buf_len) { + pr_err("Invalid arguments passed to %s().\n", __func_

[PATCH v8 1/8] IMA: generalize keyring specific measurement constructs

2020-12-11 Thread Tushar Sugandhi
specific measurement constructs to be generic and reusable in other measurement scenarios. Signed-off-by: Tushar Sugandhi Reviewed-by: Tyler Hicks --- security/integrity/ima/ima.h| 6 ++-- security/integrity/ima/ima_api.c| 6 ++-- security/integrity/ima/ima_main.c | 6 ++-- security

[PATCH v8 0/8] IMA: support for measuring kernel integrity critical data

2020-12-11 Thread Tushar Sugandhi
ritical data measurement policy selinux: include a consumer of the new IMA critical data hook Tushar Sugandhi (6): IMA: generalize keyring specific measurement constructs IMA: add support to measure buffer data hash IMA: define a hook to measure kernel integrity critical data IMA: add pol

[PATCH v8 5/8] IMA: limit critical data measurement based on a label

2020-12-11 Thread Tushar Sugandhi
:=". Limit the measurement to the labels that are specified in the IMA policy - CRITICAL_DATA+"data_source:=". If "data_sources:=" is not provided with the func CRITICAL_DATA, the data from all the supported kernel subsystems is measured. Signed-off-by: Tushar Sugandhi --- D

[PATCH v8 6/8] IMA: extend critical data hook to limit the measurement based on a label

2020-12-11 Thread Tushar Sugandhi
source label as an input parameter, so that the policy rule can be used to limit the measurements based on the label. Signed-off-by: Tushar Sugandhi Reviewed-by: Tyler Hicks --- include/linux/ima.h | 6 -- security/integrity/ima/ima_main.c | 11 --- 2 files changed, 12

[PATCH v8 2/8] IMA: add support to measure buffer data hash

2020-12-11 Thread Tushar Sugandhi
ments are only stored in the IMA log, since the buffer has no extended attributes associated with it. Introduce a boolean parameter measure_buf_hash to support measuring hash of a buffer, which would be much smaller, instead of the buffer itself. Signed-off-by: Tushar Sugandhi --- security/inte

[PATCH v8 3/8] IMA: define a hook to measure kernel integrity critical data

2020-12-11 Thread Tushar Sugandhi
the integrity of a device. Currently, IMA does not provide a generic function for kernel subsystems to measure their integrity critical data. Define a new IMA hook - ima_measure_critical_data to measure kernel integrity critical data. Signed-off-by: Tushar Sugandhi --- include/linux/ima.h

[PATCH v8 4/8] IMA: add policy rule to measure critical data

2020-12-11 Thread Tushar Sugandhi
necessary constraints (flags etc.) for integrity critical buffer data measurements. Add a policy rule to define the constraints for restricting integrity critical data measurements. Signed-off-by: Tushar Sugandhi --- Documentation/ABI/testing/ima_policy | 2 +- security/integrity/ima/ima_policy.c

[PATCH v8 8/8] selinux: include a consumer of the new IMA critical data hook

2020-12-11 Thread Tushar Sugandhi
From: Lakshmi Ramasubramanian SELinux stores the active policy in memory, so the changes to this data at runtime would have an impact on the security guarantees provided by SELinux. Measuring in-memory SELinux policy through IMA subsystem provides a secure way for the attestation service to remot

[PATCH v8 7/8] IMA: define a builtin critical data measurement policy

2020-12-11 Thread Tushar Sugandhi
From: Lakshmi Ramasubramanian Define a new critical data builtin policy to allow measuring early kernel integrity critical data before a custom IMA policy is loaded. Add critical data to built-in IMA rules if the kernel command line contains "ima_policy=critical_data". Update the documentation

Re: [PATCH v8 4/8] IMA: add policy rule to measure critical data

2020-12-11 Thread Tushar Sugandhi
On 2020-12-11 4:25 p.m., Tyler Hicks wrote: On 2020-12-11 15:58:03, Tushar Sugandhi wrote: A new IMA policy rule is needed for the IMA hook ima_measure_critical_data() and the corresponding func CRITICAL_DATA for measuring the input buffer. The policy rule should ensure the buffer would get

Re: [PATCH v8 4/8] IMA: add policy rule to measure critical data

2020-12-12 Thread Tushar Sugandhi
+ case CRITICAL_DATA: + if (!rule->data_source) + return true; + + opt_list = rule->data_source; + break; I guess this case should unconditionally return true in this patch and then the include this additional logic in the

[PATCH v9 1/8] IMA: generalize keyring specific measurement constructs

2020-12-12 Thread Tushar Sugandhi
specific measurement constructs to be generic and reusable in other measurement scenarios. Signed-off-by: Tushar Sugandhi Reviewed-by: Tyler Hicks --- security/integrity/ima/ima.h| 6 ++-- security/integrity/ima/ima_api.c| 6 ++-- security/integrity/ima/ima_main.c | 6 ++-- security

[PATCH v9 6/8] IMA: extend critical data hook to limit the measurement based on a label

2020-12-12 Thread Tushar Sugandhi
source label as an input parameter, so that the policy rule can be used to limit the measurements based on the label. Signed-off-by: Tushar Sugandhi Reviewed-by: Tyler Hicks --- include/linux/ima.h | 6 -- security/integrity/ima/ima_main.c | 11 --- 2 files changed, 12

[PATCH v9 5/8] IMA: limit critical data measurement based on a label

2020-12-12 Thread Tushar Sugandhi
:=". Limit the measurement to the labels that are specified in the IMA policy - CRITICAL_DATA+"data_source:=". If "data_sources:=" is not provided with the func CRITICAL_DATA, the data from all the supported kernel subsystems is measured. Signed-off-by: Tushar Sugandhi --- D

[PATCH v9 2/8] IMA: add support to measure buffer data hash

2020-12-12 Thread Tushar Sugandhi
ments are only stored in the IMA log, since the buffer has no extended attributes associated with it. Introduce a boolean parameter measure_buf_hash to support measuring hash of a buffer, which would be much smaller, instead of the buffer itself. Signed-off-by: Tushar Sugandhi Reviewed-by: Tyler

[PATCH v9 0/8] IMA: support for measuring kernel integrity critical data

2020-12-12 Thread Tushar Sugandhi
a mandatory policy option for func=CRITICAL_DATA anymore. If not present, all the data sources specified in __ima_supported_kernel_data_sources will be measured. Lakshmi Ramasubramanian (2): IMA: define a builtin critical data measurement policy selinux: include a consumer of the new IMA

[PATCH v9 7/8] IMA: define a builtin critical data measurement policy

2020-12-12 Thread Tushar Sugandhi
From: Lakshmi Ramasubramanian Define a new critical data builtin policy to allow measuring early kernel integrity critical data before a custom IMA policy is loaded. Add critical data to built-in IMA rules if the kernel command line contains "ima_policy=critical_data". Update the documentation

[PATCH v9 8/8] selinux: include a consumer of the new IMA critical data hook

2020-12-12 Thread Tushar Sugandhi
From: Lakshmi Ramasubramanian SELinux stores the active policy in memory, so the changes to this data at runtime would have an impact on the security guarantees provided by SELinux. Measuring in-memory SELinux policy through IMA subsystem provides a secure way for the attestation service to remot

[PATCH v9 3/8] IMA: define a hook to measure kernel integrity critical data

2020-12-12 Thread Tushar Sugandhi
the integrity of a device. Currently, IMA does not provide a generic function for kernel subsystems to measure their integrity critical data. Define a new IMA hook - ima_measure_critical_data to measure kernel integrity critical data. Signed-off-by: Tushar Sugandhi Reviewed-by: Tyler Hicks

[PATCH v9 4/8] IMA: add policy rule to measure critical data

2020-12-12 Thread Tushar Sugandhi
necessary constraints (flags etc.) for integrity critical buffer data measurements. Add a policy rule to define the constraints for restricting integrity critical data measurements. Signed-off-by: Tushar Sugandhi --- Documentation/ABI/testing/ima_policy | 2 +- security/integrity/ima/ima_policy.c

Re: [PATCH v9 4/8] IMA: add policy rule to measure critical data

2020-12-12 Thread Tushar Sugandhi
On 2020-12-12 11:20 a.m., Tyler Hicks wrote: On 2020-12-12 10:02:47, Tushar Sugandhi wrote: A new IMA policy rule is needed for the IMA hook ima_measure_critical_data() and the corresponding func CRITICAL_DATA for measuring the input buffer. The policy rule should ensure the buffer would get

Re: [PATCH v9 5/8] IMA: limit critical data measurement based on a label

2020-12-12 Thread Tushar Sugandhi
On 2020-12-12 11:20 a.m., Tyler Hicks wrote: On 2020-12-12 10:02:48, Tushar Sugandhi wrote: System administrators should be able to limit which kernel subsystems they want to measure the critical data for. To enable that, an IMA policy condition to choose specific kernel subsystems is needed

[PATCH v10 2/8] IMA: add support to measure buffer data hash

2021-01-07 Thread Tushar Sugandhi
hash. Introduce a boolean parameter to support measuring buffer data hash, which would be much smaller, instead of the buffer itself. Signed-off-by: Tushar Sugandhi Reviewed-by: Tyler Hicks --- security/integrity/ima/ima.h | 3 +- security/integrity/ima/ima_appraise.c

[PATCH v10 0/8] IMA: support for measuring kernel integrity critical data

2021-01-07 Thread Tushar Sugandhi
ot a mandatory policy option for func=CRITICAL_DATA anymore. If not present, all the data sources specified in __ima_supported_kernel_data_sources will be measured. Lakshmi Ramasubramanian (2): IMA: define a builtin critical data measurement policy selinux: include a consumer of the new IMA critical d

[PATCH v10 4/8] IMA: add policy rule to measure critical data

2021-01-07 Thread Tushar Sugandhi
necessary constraints (flags etc.) for integrity critical buffer data measurements. Add policy rule support for measuring integrity critical data. Signed-off-by: Tushar Sugandhi Reviewed-by: Tyler Hicks Reviewed-by: Mimi Zohar --- Documentation/ABI/testing/ima_policy | 2 +- security/integrity

[PATCH v10 3/8] IMA: define a hook to measure kernel integrity critical data

2021-01-07 Thread Tushar Sugandhi
of the system. Currently, IMA does not provide a generic function for measuring kernel integrity critical data. Define ima_measure_critical_data, a new IMA hook, to measure kernel integrity critical data. Signed-off-by: Tushar Sugandhi Reviewed-by: Tyler Hicks --- include/linux/ima.h

[PATCH v10 6/8] IMA: extend critical data hook to limit the measurement based on a label

2021-01-07 Thread Tushar Sugandhi
source label as an input parameter, so that the policy rule can be used to limit the measurements based on the label. Signed-off-by: Tushar Sugandhi Reviewed-by: Tyler Hicks --- include/linux/ima.h | 7 +-- security/integrity/ima/ima_main.c | 8 +--- 2 files changed, 10

[PATCH v10 1/8] IMA: generalize keyring specific measurement constructs

2021-01-07 Thread Tushar Sugandhi
specific measurement constructs to be generic and reusable in other measurement scenarios. Signed-off-by: Tushar Sugandhi Reviewed-by: Tyler Hicks --- security/integrity/ima/ima.h| 6 ++-- security/integrity/ima/ima_api.c| 6 ++-- security/integrity/ima/ima_main.c | 6

[PATCH v10 7/8] IMA: define a builtin critical data measurement policy

2021-01-07 Thread Tushar Sugandhi
From: Lakshmi Ramasubramanian Define a new critical data builtin policy to allow measuring early kernel integrity critical data before a custom IMA policy is loaded. Update the documentation on kernel parameters to document the new critical data builtin policy. Signed-off-by: Lakshmi Ramasubram

[PATCH v10 8/8] selinux: include a consumer of the new IMA critical data hook

2021-01-07 Thread Tushar Sugandhi
From: Lakshmi Ramasubramanian SELinux stores the active policy in memory, so the changes to this data at runtime would have an impact on the security guarantees provided by SELinux. Measuring in-memory SELinux policy through IMA subsystem provides a secure way for the attestation service to remo

[PATCH v10 5/8] IMA: limit critical data measurement based on a label

2021-01-07 Thread Tushar Sugandhi
is not provided with the func CRITICAL_DATA, measure all the input integrity critical data. Signed-off-by: Tushar Sugandhi Reviewed-by: Tyler Hicks --- Documentation/ABI/testing/ima_policy | 2 ++ security/integrity/ima/ima_policy.c | 37 +--- 2 files changed, 36 insertions(+)

Re: [PATCH v10 5/8] IMA: limit critical data measurement based on a label

2021-01-14 Thread Tushar Sugandhi
On 2021-01-13 6:09 p.m., Mimi Zohar wrote: On Thu, 2021-01-07 at 20:07 -0800, Tushar Sugandhi wrote: Integrity critical data may belong to a single subsystem or it may arise from cross subsystem interaction. Currently there is no mechanism to group or limit the data based on certain label

[PATCH v7 2/8] IMA: add support to measure buffer data hash

2020-12-09 Thread Tushar Sugandhi
ments are only stored in the IMA log, since the buffer has no extended attributes associated with it. Introduce a boolean parameter measure_buf_hash to support measuring hash of a buffer, which would be much smaller, instead of the buffer itself. Signed-off-by: Tushar Sugandhi --- security/inte

[PATCH v7 7/8] IMA: define a builtin critical data measurement policy

2020-12-09 Thread Tushar Sugandhi
From: Lakshmi Ramasubramanian Define a new critical data builtin policy to allow measuring early kernel integrity critical data before a custom IMA policy is loaded. Add critical data to built-in IMA rules if the kernel command line contains "ima_policy=critical_data". Update the documentation

[PATCH v7 8/8] selinux: include a consumer of the new IMA critical data hook

2020-12-09 Thread Tushar Sugandhi
From: Lakshmi Ramasubramanian IMA measures files and buffer data such as keys, command line arguments passed to the kernel on kexec system call, etc. While these measurements enable monitoring and validating the integrity of the system, it is not sufficient. Various data structures, policies and

[PATCH v7 6/8] IMA: extend critical data hook to limit the measurement based on a label

2020-12-09 Thread Tushar Sugandhi
source label as an input parameter, so that the policy rule can be used to limit the measurements based on the label. Signed-off-by: Tushar Sugandhi --- include/linux/ima.h | 6 -- security/integrity/ima/ima_main.c | 11 --- 2 files changed, 12 insertions(+), 5 deletions

[PATCH v7 5/8] IMA: limit critical data measurement based on a label

2020-12-09 Thread Tushar Sugandhi
:=". Limit the measurement to the labels that are specified in the IMA policy - CRITICAL_DATA+"data_source:=". If "data_sources:=" is not provided with the func CRITICAL_DATA, the data from all the supported kernel subsystems is measured. Signed-off-by: Tushar Sugandhi --- D

[PATCH v7 4/8] IMA: add policy rule to measure critical data

2020-12-09 Thread Tushar Sugandhi
necessary constraints (flags etc.) for integrity critical buffer data measurements. Add a policy rule to define the constraints for restricting integrity critical data measurements. Signed-off-by: Tushar Sugandhi --- security/integrity/ima/ima_policy.c | 35 + 1 file

[PATCH v7 1/8] IMA: generalize keyring specific measurement constructs

2020-12-09 Thread Tushar Sugandhi
specific measurement constructs to be generic and reusable in other measurement scenarios. Signed-off-by: Tushar Sugandhi --- security/integrity/ima/ima.h| 6 ++-- security/integrity/ima/ima_api.c| 6 ++-- security/integrity/ima/ima_main.c | 6 ++-- security/integrity/ima/ima_policy.c

[PATCH v7 3/8] IMA: define a hook to measure kernel integrity critical data

2020-12-09 Thread Tushar Sugandhi
the integrity of a device. Currently, IMA does not provide a generic function for kernel subsystems to measure their integrity critical data. Define a new IMA hook - ima_measure_critical_data to measure kernel integrity critical data. Signed-off-by: Tushar Sugandhi --- Documentation/ABI/testing

[PATCH v7 0/8] IMA: support for measuring kernel integrity critical data

2020-12-09 Thread Tushar Sugandhi
al data measurement policy selinux: include a consumer of the new IMA critical data hook Tushar Sugandhi (6): IMA: generalize keyring specific measurement constructs IMA: add support to measure buffer data hash IMA: define a hook to measure kernel integrity critical data IMA: add policy

[PATCH v6 0/8] IMA: support for measuring kernel integrity critical data

2020-11-19 Thread Tushar Sugandhi
ted_kernel_data_sources will be measured. Lakshmi Ramasubramanian (2): IMA: add a built-in policy rule for critical data measurement selinux: measure state and hash of the policy using IMA Tushar Sugandhi (6): IMA: generalize keyring specific measurement constructs IMA: add support to measur

[PATCH v6 6/8] IMA: add support to critical data hook to limit data sources for measurement

2020-11-19 Thread Tushar Sugandhi
source name as an input parameter, so that the policy rule can be used to limit data sources being measured. Signed-off-by: Tushar Sugandhi --- include/linux/ima.h | 6 -- security/integrity/ima/ima_main.c | 11 --- 2 files changed, 12 insertions(+), 5 deletions(-) diff

[PATCH v6 3/8] IMA: define a hook to measure kernel integrity critical data

2020-11-19 Thread Tushar Sugandhi
integrity critical data. Signed-off-by: Tushar Sugandhi --- Documentation/ABI/testing/ima_policy | 2 +- include/linux/ima.h | 6 + security/integrity/ima/ima.h | 1 + security/integrity/ima/ima_api.c | 2 +- security/integrity/ima/ima_main.c| 36

[PATCH v6 4/8] IMA: add policy rule to measure critical data

2020-11-19 Thread Tushar Sugandhi
necessary constraints (flags etc.) for integrity critical buffer data measurements. Add a policy rule to define the constraints for restricting integrity critical data measurements. Signed-off-by: Tushar Sugandhi --- security/integrity/ima/ima_policy.c | 35 + 1 file

[PATCH v6 5/8] IMA: extend policy to add data sources as a critical data measurement constraint

2020-11-19 Thread Tushar Sugandhi
imit the measurement to the subsystems that are specified in the IMA policy - CRITICAL_DATA+"data_sources:=". If "data_sources:=" is not provided with the func CRITICAL_DATA, the data from all the supported kernel subsystems is measured. Signed-off-by: Tushar Sugandhi --- D

[PATCH v6 8/8] selinux: measure state and hash of the policy using IMA

2020-11-19 Thread Tushar Sugandhi
From: Lakshmi Ramasubramanian IMA measures files and buffer data such as keys, command line arguments passed to the kernel on kexec system call, etc. While these measurements enable monitoring and validating the integrity of the system, it is not sufficient. In-memory data structures maintained b

[PATCH v6 2/8] IMA: add support to measure buffer data hash

2020-11-19 Thread Tushar Sugandhi
ments are only stored in the IMA log, since the buffer has no extended attributes associated with it. Introduce a boolean parameter measure_buf_hash to support measuring hash of a buffer, which would be much smaller, instead of the buffer itself. Signed-off-by: Tushar Sugandhi --- security/inte

[PATCH v6 7/8] IMA: add a built-in policy rule for critical data measurement

2020-11-19 Thread Tushar Sugandhi
From: Lakshmi Ramasubramanian The IMA hook to measure kernel critical data, namely ima_measure_critical_data(), could be called before a custom IMA policy is loaded. Define a new critical data builtin policy to allow measuring early kernel integrity critical data before a custom IMA policy is loa

[PATCH v6 1/8] IMA: generalize keyring specific measurement constructs

2020-11-19 Thread Tushar Sugandhi
specific measurement constructs to be generic and reusable in other measurement scenarios. Signed-off-by: Tushar Sugandhi --- security/integrity/ima/ima.h| 6 ++-- security/integrity/ima/ima_api.c| 6 ++-- security/integrity/ima/ima_main.c | 6 ++-- security/integrity/ima/ima_policy.c

Re: [PATCH v6 8/8] selinux: measure state and hash of the policy using IMA

2020-11-23 Thread Tushar Sugandhi
Hi James, On 2020-11-20 6:05 p.m., James Morris wrote: On Thu, 19 Nov 2020, Tushar Sugandhi wrote: an impact on the security guarantees provided by SELinux. Measuring such in-memory data structures through IMA subsystem provides a secure way for a remote attestation service to know the state

Re: [PATCH v10 0/8] IMA: support for measuring kernel integrity critical data

2021-01-15 Thread Tushar Sugandhi
On 2021-01-15 4:54 a.m., Mimi Zohar wrote: On Thu, 2021-01-07 at 20:07 -0800, Tushar Sugandhi wrote: IMA measures files and buffer data such as keys, command-line arguments passed to the kernel on kexec system call, etc. While these measurements are necessary for monitoring and validating

Re: [PATCH v9 1/8] IMA: generalize keyring specific measurement constructs

2021-01-05 Thread Tushar Sugandhi
Hello Mimi, Sorry for the late response. I was on vacation last week. On 2020-12-24 5:06 a.m., Mimi Zohar wrote: On Sat, 2020-12-12 at 10:02 -0800, Tushar Sugandhi wrote: diff --git a/security/integrity/ima/ima_main.c b/security/integrity/ima/ima_main.c index 68956e884403..e76ef4bfd0f4

Re: [PATCH v9 2/8] IMA: add support to measure buffer data hash

2021-01-05 Thread Tushar Sugandhi
On 2020-12-23 4:03 p.m., Mimi Zohar wrote: On Sat, 2020-12-12 at 10:02 -0800, Tushar Sugandhi wrote: The original IMA buffer data measurement sizes were small (e.g. boot command line), but the new buffer data measurement use cases have data sizes that are a lot larger. Just as IMA measures

Re: [PATCH v9 3/8] IMA: define a hook to measure kernel integrity critical data

2021-01-05 Thread Tushar Sugandhi
On 2020-12-24 5:04 a.m., Mimi Zohar wrote: On Sat, 2020-12-12 at 10:02 -0800, Tushar Sugandhi wrote: IMA provides capabilities to measure file data, and in-memory buffer No need for the comma here. Up to this patch set, all the patches refer to "buffer data", not "in- mem

Re: [PATCH v9 4/8] IMA: add policy rule to measure critical data

2021-01-05 Thread Tushar Sugandhi
On 2020-12-24 5:48 a.m., Mimi Zohar wrote: Hi Tushar, Please update the Subject line as, "Add policy rule support for measuring critical data". On Sat, 2020-12-12 at 10:02 -0800, Tushar Sugandhi wrote: A new IMA policy rule is needed for the IMA hook ima_measure_critical_data

Re: [PATCH v9 3/8] IMA: define a hook to measure kernel integrity critical data

2021-01-05 Thread Tushar Sugandhi
On 2021-01-05 12:16 p.m., Mimi Zohar wrote: On Tue, 2021-01-05 at 12:01 -0800, Tushar Sugandhi wrote: data. However, various data structures, policies, and states Here and everywhere else, there are two blanks after a period. I checked this patch file in multiple text editors, but

Re: [PATCH v9 5/8] IMA: limit critical data measurement based on a label

2021-01-05 Thread Tushar Sugandhi
On 2020-12-24 6:29 a.m., Mimi Zohar wrote: Hi Tushar, On Sat, 2020-12-12 at 10:02 -0800, Tushar Sugandhi wrote: System administrators should be able to limit which kernel subsystems they want to measure the critical data for. To enable that, an IMA policy condition to choose specific kernel

Re: [PATCH v9 7/8] IMA: define a builtin critical data measurement policy

2021-01-05 Thread Tushar Sugandhi
On 2020-12-24 6:41 a.m., Mimi Zohar wrote: On Sat, 2020-12-12 at 10:02 -0800, Tushar Sugandhi wrote: From: Lakshmi Ramasubramanian Define a new critical data builtin policy to allow measuring early kernel integrity critical data before a custom IMA policy is loaded. Add critical data to

Re: [PATCH v9 2/8] IMA: add support to measure buffer data hash

2021-01-05 Thread Tushar Sugandhi
  void process_buffer_measurement(struct inode *inode, const void *buf, int size,   const char *eventname, enum ima_hooks func, -    int pcr, const char *func_data); +    int pcr, const char *func_data, +    bool measure_buf_hash); Please a

Re: [PATCH v6 0/8] IMA: support for measuring kernel integrity critical data

2020-11-22 Thread Tushar Sugandhi
Thanks Pavel for looking at this series. On 2020-11-20 4:46 a.m., Pavel Machek wrote: On Thu 2020-11-19 15:26:03, Tushar Sugandhi wrote: Kernel integrity critical data can be defined as the in-memory kernel data which if accidentally or maliciously altered, can compromise the integrity of the

Re: [PATCH v2 2/3] IMA: add policy to support measuring critical data from kernel components

2020-08-25 Thread Tushar Sugandhi
On 2020-08-24 3:46 p.m., Mimi Zohar wrote: On Fri, 2020-08-21 at 11:21 -0700, Tushar Sugandhi wrote: There would be several candidate kernel components suitable for IMA measurement. Not all of them would have support for IMA measurement. Also, system administrators may not want to measure

Re: [PATCH v2 2/3] IMA: add policy to support measuring critical data from kernel components

2020-08-25 Thread Tushar Sugandhi
On 2020-08-25 1:43 p.m., Mimi Zohar wrote: On Tue, 2020-08-25 at 10:32 -0700, Tushar Sugandhi wrote: On 2020-08-24 3:46 p.m., Mimi Zohar wrote: On Fri, 2020-08-21 at 11:21 -0700, Tushar Sugandhi wrote: There would be several candidate kernel components suitable for IMA measurement. Not

[PATCH v3 0/6] IMA: Infrastructure for measurement of critical kernel data

2020-08-27 Thread Tushar Sugandhi
'supported'. - Reverted the unnecessary rename of attribute size to buf_len. - Introduced a boolean parameter measure_buf_hash as per community feedback to support measuring hash of the buffer, instead of the buffer itself. Tushar Sugandhi (6): IMA: generalize keyring specific measu

[PATCH v3 1/6] IMA: generalize keyring specific measurement constructs

2020-08-27 Thread Tushar Sugandhi
measurement constructs to be generic and reusable in other measurement scenarios. Signed-off-by: Tushar Sugandhi --- security/integrity/ima/ima.h| 6 ++--- security/integrity/ima/ima_api.c| 6 ++--- security/integrity/ima/ima_main.c | 6 ++--- security/integrity/ima/ima_policy.c

[PATCH v3 5/6] IMA: add hook to measure critical data from kernel components

2020-08-27 Thread Tushar Sugandhi
TICAL_DATA+critical_kernel_data_sources. Signed-off-by: Tushar Sugandhi --- Documentation/ABI/testing/ima_policy | 8 ++- include/linux/ima.h | 11 + security/integrity/ima/ima.h | 1 + security/integrity/ima/ima_api.c | 2 +- security/integrity/ima/ima_main

[PATCH v3 4/6] IMA: add policy to measure critical data from kernel components

2020-08-27 Thread Tushar Sugandhi
upport IMA measurement. Signed-off-by: Tushar Sugandhi --- Documentation/ABI/testing/ima_policy | 3 +++ security/integrity/ima/ima_policy.c | 29 +++- 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/Documentation/ABI/testing/ima_policy b/Documentation/A

[PATCH v3 6/6] IMA: validate supported kernel data sources before measurement

2020-08-27 Thread Tushar Sugandhi
list at compile-time. Update ima_measure_critical_data() to validate, at run-time, that the data source is supported before measuring the data. Signed-off-by: Tushar Sugandhi --- security/integrity/ima/ima.h | 29 + security/integrity/ima/ima_main.c | 3 +++ 2 fi

[PATCH v3 3/6] IMA: update process_buffer_measurement to measure buffer hash

2020-08-27 Thread Tushar Sugandhi
. Signed-off-by: Tushar Sugandhi --- security/integrity/ima/ima.h | 3 +- security/integrity/ima/ima_appraise.c| 2 +- security/integrity/ima/ima_asymmetric_keys.c | 2 +- security/integrity/ima/ima_main.c| 29 ++-- security/integrity/ima

[PATCH v3 2/6] IMA: change process_buffer_measurement return type from void to int

2020-08-27 Thread Tushar Sugandhi
process_buffer_measurement() does not return the result of the operation. Therefore, the consumers of this function cannot act on it, if needed. Update return type of process_buffer_measurement() from void to int. Signed-off-by: Tushar Sugandhi --- security/integrity/ima/ima.h | 6

[PATCH v3 2/2] dm-crypt: collect data and submit to DM to measure

2020-08-28 Thread Tushar Sugandhi
453b4ee938cff2f0d2c869a0b743f59125c0a37f5bcd8f1dbbd911a78abaa 0 7:0 0 1 allow_discards Signed-off-by: Tushar Sugandhi --- drivers/md/dm-crypt.c | 171 + security/integrity/ima/Kconfig | 3 +- security/integrity/ima/ima.h | 1 + 3 files changed, 1

[PATCH v3 1/2] dm-devel: collect target data and submit to IMA to measure

2020-08-28 Thread Tushar Sugandhi
r measurements using dm_ima_append_measurement_list(), but gets destroyed before calling dm_ima_finalize_and_measure(). Signed-off-by: Tushar Sugandhi --- drivers/md/Makefile | 1 + drivers/md/dm-ima.c | 298 ++ include/linux/device-mapper.h | 60 +++ 3 files cha

[PATCH v3 0/2] dm-devel:dm-crypt: infrastructure for measurement of DM target data using IMA

2020-08-28 Thread Tushar Sugandhi
(2. above), which introduced a boolean parameter measure_buf_hash as per community feedback to support measuring hash of the buffer, instead of the buffer itself. - Taken dependency on the updated early boot measurement series (3. above). Tushar Sugandhi (2): dm-devel: collect target dat

Re: [PATCH 2/3] IMA: add policy to support measuring critical data from kernel components

2020-08-17 Thread Tushar Sugandhi
On 2020-08-17 1:43 p.m., Mimi Zohar wrote: On Wed, 2020-08-12 at 12:31 -0700, Tushar Sugandhi wrote: There would be several candidate kernel components suitable for IMA measurement. Not all of them would be enlightened for IMA measurement. Also, system administrators may not want to measure

  1   2   >