[PATCH 0/2] ima: prevent dead lock when a file is opened for direct io (take 3)

2014-05-13 Thread Dmitry Kasatkin
+0x14d/0x1dc [ 38.280032] [8113498b] SyS_open+0x1e/0x20 [ 38.280032] [814fcf69] system_call_fastpath+0x16/0x1b --- Dmitry Kasatkin (2): ima: re-introduce own integrity cache lock ima: allocate user-space

[PATCH 2/2] ima: allocate user-space like memory for direct-io

2014-05-13 Thread Dmitry Kasatkin
. Signed-off-by: Dmitry Kasatkin d.kasat...@samsung.com --- security/integrity/ima/ima_crypto.c | 44 ++--- 1 file changed, 36 insertions(+), 8 deletions(-) diff --git a/security/integrity/ima/ima_crypto.c b/security/integrity/ima/ima_crypto.c index de5b974

[PATCH 1/2] ima: re-introduce own integrity cache lock

2014-05-13 Thread Dmitry Kasatkin
by introducing additional atomic iint-attr_flags to indicate calling of the hooks. The allowed locking order is to take the iint-mutex first and then the i_mutex. Signed-off-by: Dmitry Kasatkin d.kasat...@samsung.com --- security/integrity/iint.c | 10 -- security/integrity/ima

Re: IMA + O_DIRECT (Re: [PATCH 0/1] fix IMA + Apparmor kernel panic)

2014-05-10 Thread Dmitry Kasatkin
On 9 May 2014 23:07, J. R. Okajima wrote: > > Mimi Zohar: >> I assume so, as there wasn't any comment. As a temporary fix, would it >> make sense not to measure/appraise/audit files opened with the direct-io >> flag based policy? Define a new IMA policy option 'directio'. A sample >> rule

Re: IMA + O_DIRECT (Re: [PATCH 0/1] fix IMA + Apparmor kernel panic)

2014-05-10 Thread Dmitry Kasatkin
On 9 May 2014 23:07, J. R. Okajima hooanon...@gmail.com wrote: Mimi Zohar: I assume so, as there wasn't any comment. As a temporary fix, would it make sense not to measure/appraise/audit files opened with the direct-io flag based policy? Define a new IMA policy option 'directio'. A sample

Re: IMA + O_DIRECT (Re: [PATCH 0/1] fix IMA + Apparmor kernel panic)

2014-05-09 Thread Dmitry Kasatkin
On 09/05/14 06:10, J. R. Okajima wrote: > Dmitry Kasatkin: >> Following patch replaces IMA usage of kernel_read() with special >> version which skips security check that triggers kernel panic >> when Apparmor and IMA appraisal are enabled together. > I know t

Re: IMA + O_DIRECT (Re: [PATCH 0/1] fix IMA + Apparmor kernel panic)

2014-05-09 Thread Dmitry Kasatkin
On 09/05/14 06:10, J. R. Okajima wrote: Dmitry Kasatkin: Following patch replaces IMA usage of kernel_read() with special version which skips security check that triggers kernel panic when Apparmor and IMA appraisal are enabled together. I know this is related to exit(2), but this behaviour

[PATCH 0/1] fix IMA + Apparmor kernel panic

2014-05-08 Thread Dmitry Kasatkin
Hi, Following patch replaces IMA usage of kernel_read() with special version which skips security check that triggers kernel panic when Apparmor and IMA appraisal are enabled together. - Dmitry Dmitry Kasatkin (1): ima: introduce ima_kernel_read() security/integrity/ima/ima_crypto.c | 32

[PATCH 1/1] ima: introduce ima_kernel_read()

2014-05-08 Thread Dmitry Kasatkin
ces special version ima_kernel_read(), which skips security, mandatory locking checking and fsnotify. It prevents the kernel oops to happen. Suggested-by: Eric W. Biederman Signed-off-by: Dmitry Kasatkin --- security/integrity/ima/ima_crypto.c | 32 +++- 1 file changed, 31

[PATCH 1/1] ima: introduce ima_kernel_read()

2014-05-08 Thread Dmitry Kasatkin
-by: Eric W. Biederman ebied...@xmission.com Signed-off-by: Dmitry Kasatkin d.kasat...@samsung.com --- security/integrity/ima/ima_crypto.c | 32 +++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/security/integrity/ima/ima_crypto.c b/security/integrity/ima

[PATCH 0/1] fix IMA + Apparmor kernel panic

2014-05-08 Thread Dmitry Kasatkin
Hi, Following patch replaces IMA usage of kernel_read() with special version which skips security check that triggers kernel panic when Apparmor and IMA appraisal are enabled together. - Dmitry Dmitry Kasatkin (1): ima: introduce ima_kernel_read() security/integrity/ima/ima_crypto.c | 32

Re: IMA & truncate

2014-05-06 Thread Dmitry Kasatkin
On 6 May 2014 22:11, Al Viro wrote: > On Tue, May 06, 2014 at 02:39:17PM -0400, Mimi Zohar wrote: > >> Al, you're not going to like this, but ima_calc_file_hash() calls >> ima_calc_file_hash_tfm(), which already sets/unsets FMODE_READ in order >> to calculate the file hash. > > And if it happens

Re: IMA & truncate

2014-05-06 Thread Dmitry Kasatkin
On 6 May 2014 19:59, Al Viro wrote: > On Tue, May 06, 2014 at 04:32:27PM +0300, Dmitry Kasatkin wrote: >> Hi, >> >> I have discovered one IMA related issue. >> >> IMA file hash is re-calculate if needed on file close. >> >> It works with ftrun

IMA & truncate

2014-05-06 Thread Dmitry Kasatkin
Hi, I have discovered one IMA related issue. IMA file hash is re-calculate if needed on file close. It works with ftruncate(fd, length) syscall, because it operates on "opened" file. Recalculation is happening on file close. truncate(path, length) syscall works with path and no file open/close

Re: IMA truncate

2014-05-06 Thread Dmitry Kasatkin
On 6 May 2014 19:59, Al Viro v...@zeniv.linux.org.uk wrote: On Tue, May 06, 2014 at 04:32:27PM +0300, Dmitry Kasatkin wrote: Hi, I have discovered one IMA related issue. IMA file hash is re-calculate if needed on file close. It works with ftruncate(fd, length) syscall, because it operates

Re: IMA truncate

2014-05-06 Thread Dmitry Kasatkin
On 6 May 2014 22:11, Al Viro v...@zeniv.linux.org.uk wrote: On Tue, May 06, 2014 at 02:39:17PM -0400, Mimi Zohar wrote: Al, you're not going to like this, but ima_calc_file_hash() calls ima_calc_file_hash_tfm(), which already sets/unsets FMODE_READ in order to calculate the file hash. And

IMA truncate

2014-05-06 Thread Dmitry Kasatkin
Hi, I have discovered one IMA related issue. IMA file hash is re-calculate if needed on file close. It works with ftruncate(fd, length) syscall, because it operates on opened file. Recalculation is happening on file close. truncate(path, length) syscall works with path and no file open/close

Re: Kernel panic at Ubuntu: IMA + Apparmor

2014-04-26 Thread Dmitry Kasatkin
On 26 April 2014 20:42, Al Viro wrote: > On Sat, Apr 26, 2014 at 07:54:47PM +0300, Dmitry Kasatkin wrote: >> On 26 April 2014 16:56, Al Viro wrote: >> > On Sat, Apr 26, 2014 at 11:58:45AM +0300, Dmitry Kasatkin wrote: >> > >> >> Conflict with Apparmor means

Re: Kernel panic at Ubuntu: IMA + Apparmor

2014-04-26 Thread Dmitry Kasatkin
On 26 April 2014 16:56, Al Viro wrote: > On Sat, Apr 26, 2014 at 11:58:45AM +0300, Dmitry Kasatkin wrote: > >> Conflict with Apparmor means with Ubuntu. >> >> But answering to your early question.. >> IMA does not want permission denied when measuring and r

Re: Kernel panic at Ubuntu: IMA + Apparmor

2014-04-26 Thread Dmitry Kasatkin
On 26 April 2014 01:38, Eric W. Biederman wrote: > Dmitry Kasatkin writes: > >> Is it really a show stopper to switch order of 2 functions as quick fix? >> It was like that before 3.10 and seemed ok... > > When that is the question. The answer is yes it is a show

Re: Kernel panic at Ubuntu: IMA + Apparmor

2014-04-26 Thread Dmitry Kasatkin
On 26 April 2014 01:11, Eric W. Biederman wrote: > Dmitry Kasatkin writes: > >> On 26 April 2014 00:27, Eric W. Biederman wrote: >>> Dmitry Kasatkin writes: >>> >>>> On 25 April 2014 23:45, Eric W. Biederman wrote: >>>>> Dmitry Ka

Re: Kernel panic at Ubuntu: IMA + Apparmor

2014-04-26 Thread Dmitry Kasatkin
On 26 April 2014 01:11, Eric W. Biederman ebied...@xmission.com wrote: Dmitry Kasatkin dmitry.kasat...@gmail.com writes: On 26 April 2014 00:27, Eric W. Biederman ebied...@xmission.com wrote: Dmitry Kasatkin dmitry.kasat...@gmail.com writes: On 25 April 2014 23:45, Eric W. Biederman ebied

Re: Kernel panic at Ubuntu: IMA + Apparmor

2014-04-26 Thread Dmitry Kasatkin
On 26 April 2014 01:38, Eric W. Biederman ebied...@xmission.com wrote: Dmitry Kasatkin dmitry.kasat...@gmail.com writes: Is it really a show stopper to switch order of 2 functions as quick fix? It was like that before 3.10 and seemed ok... When that is the question. The answer is yes

Re: Kernel panic at Ubuntu: IMA + Apparmor

2014-04-26 Thread Dmitry Kasatkin
On 26 April 2014 16:56, Al Viro v...@zeniv.linux.org.uk wrote: On Sat, Apr 26, 2014 at 11:58:45AM +0300, Dmitry Kasatkin wrote: Conflict with Apparmor means with Ubuntu. But answering to your early question.. IMA does not want permission denied when measuring and re-measuring files

Re: Kernel panic at Ubuntu: IMA + Apparmor

2014-04-26 Thread Dmitry Kasatkin
On 26 April 2014 20:42, Al Viro v...@zeniv.linux.org.uk wrote: On Sat, Apr 26, 2014 at 07:54:47PM +0300, Dmitry Kasatkin wrote: On 26 April 2014 16:56, Al Viro v...@zeniv.linux.org.uk wrote: On Sat, Apr 26, 2014 at 11:58:45AM +0300, Dmitry Kasatkin wrote: Conflict with Apparmor means

Re: Kernel panic at Ubuntu: IMA + Apparmor

2014-04-25 Thread Dmitry Kasatkin
On 26 April 2014 00:46, Dmitry Kasatkin wrote: > On 26 April 2014 00:27, Eric W. Biederman wrote: >> Dmitry Kasatkin writes: >> >>> On 25 April 2014 23:45, Eric W. Biederman wrote: >>>> Dmitry Kasatkin writes: >>>> >>>>> On 25

Re: Kernel panic at Ubuntu: IMA + Apparmor

2014-04-25 Thread Dmitry Kasatkin
On 26 April 2014 00:27, Eric W. Biederman wrote: > Dmitry Kasatkin writes: > >> On 25 April 2014 23:45, Eric W. Biederman wrote: >>> Dmitry Kasatkin writes: >>> >>>> On 25 April 2014 23:01, Oleg Nesterov wrote: >>>>> On 04/25, Eri

Re: Kernel panic at Ubuntu: IMA + Apparmor

2014-04-25 Thread Dmitry Kasatkin
On 25 April 2014 23:45, Eric W. Biederman wrote: > Dmitry Kasatkin writes: > >> On 25 April 2014 23:01, Oleg Nesterov wrote: >>> On 04/25, Eric W. Biederman wrote: >>>> >>>> Oleg Nesterov writes: >>>> >>>> >

Re: Kernel panic at Ubuntu: IMA + Apparmor

2014-04-25 Thread Dmitry Kasatkin
On 25 April 2014 23:01, Oleg Nesterov wrote: > On 04/25, Eric W. Biederman wrote: >> >> Oleg Nesterov writes: >> >> > Well. I _think_ that __fput() and ima_file_free() in particular should not >> > depend on current and/or current->nsproxy. If nothing else, fput() can be >> > called by the

Re: [PATCH 15/20] ima: path based policy loading interface

2014-04-25 Thread Dmitry Kasatkin
On 25/04/14 00:03, Mimi Zohar wrote: > On Wed, 2014-04-23 at 16:30 +0300, Dmitry Kasatkin wrote: >> Currently policy is loaded by writing policy content to >> '/ima/policy' file. >> >> This patch extends policy loading meachanism with possibility >> t

Re: [PATCH 12/20] ima: provide buffer hash calculation function

2014-04-25 Thread Dmitry Kasatkin
On 25/04/14 00:04, Mimi Zohar wrote: > On Wed, 2014-04-23 at 16:30 +0300, Dmitry Kasatkin wrote: >> This patch provides convenient buffer hash calculation function. >> >> Signed-off-by: Dmitry Kasatkin > Where/how is it being used? We normally don't upstream a new fun

Re: Kernel panic at Ubuntu: IMA + Apparmor

2014-04-25 Thread Dmitry Kasatkin
On 25/04/14 16:00, Dmitry Kasatkin wrote: > Hello, > > I discovered a kernel panic on system running Ubuntu when IMA is enabled. > It happens on reboot. > > -- > [ 106.750100] NSPROXY is NULL: error.log (/var/log/mysql/error.log) > [ 106.750167] BUG:

Kernel panic at Ubuntu: IMA + Apparmor

2014-04-25 Thread Dmitry Kasatkin
Hello, I discovered a kernel panic on system running Ubuntu when IMA is enabled. It happens on reboot. -- [ 106.750100] NSPROXY is NULL: error.log (/var/log/mysql/error.log) [ 106.750167] BUG: unable to handle kernel NULL pointer dereference at 0018 [

Kernel panic at Ubuntu: IMA + Apparmor

2014-04-25 Thread Dmitry Kasatkin
Hello, I discovered a kernel panic on system running Ubuntu when IMA is enabled. It happens on reboot. -- [ 106.750100] NSPROXY is NULL: error.log (/var/log/mysql/error.log) [ 106.750167] BUG: unable to handle kernel NULL pointer dereference at 0018 [

Re: Kernel panic at Ubuntu: IMA + Apparmor

2014-04-25 Thread Dmitry Kasatkin
On 25/04/14 16:00, Dmitry Kasatkin wrote: Hello, I discovered a kernel panic on system running Ubuntu when IMA is enabled. It happens on reboot. -- [ 106.750100] NSPROXY is NULL: error.log (/var/log/mysql/error.log) [ 106.750167] BUG: unable to handle kernel NULL

Re: [PATCH 12/20] ima: provide buffer hash calculation function

2014-04-25 Thread Dmitry Kasatkin
On 25/04/14 00:04, Mimi Zohar wrote: On Wed, 2014-04-23 at 16:30 +0300, Dmitry Kasatkin wrote: This patch provides convenient buffer hash calculation function. Signed-off-by: Dmitry Kasatkin d.kasat...@samsung.com Where/how is it being used? We normally don't upstream a new function

Re: [PATCH 15/20] ima: path based policy loading interface

2014-04-25 Thread Dmitry Kasatkin
On 25/04/14 00:03, Mimi Zohar wrote: On Wed, 2014-04-23 at 16:30 +0300, Dmitry Kasatkin wrote: Currently policy is loaded by writing policy content to 'securityfs/ima/policy' file. This patch extends policy loading meachanism with possibility to load signed policy using a path to the policy

Re: Kernel panic at Ubuntu: IMA + Apparmor

2014-04-25 Thread Dmitry Kasatkin
On 25 April 2014 23:01, Oleg Nesterov o...@redhat.com wrote: On 04/25, Eric W. Biederman wrote: Oleg Nesterov o...@redhat.com writes: Well. I _think_ that __fput() and ima_file_free() in particular should not depend on current and/or current-nsproxy. If nothing else, fput() can be called

Re: Kernel panic at Ubuntu: IMA + Apparmor

2014-04-25 Thread Dmitry Kasatkin
On 25 April 2014 23:45, Eric W. Biederman ebied...@xmission.com wrote: Dmitry Kasatkin dmitry.kasat...@gmail.com writes: On 25 April 2014 23:01, Oleg Nesterov o...@redhat.com wrote: On 04/25, Eric W. Biederman wrote: Oleg Nesterov o...@redhat.com writes: Well. I _think_ that __fput

Re: Kernel panic at Ubuntu: IMA + Apparmor

2014-04-25 Thread Dmitry Kasatkin
On 26 April 2014 00:27, Eric W. Biederman ebied...@xmission.com wrote: Dmitry Kasatkin dmitry.kasat...@gmail.com writes: On 25 April 2014 23:45, Eric W. Biederman ebied...@xmission.com wrote: Dmitry Kasatkin dmitry.kasat...@gmail.com writes: On 25 April 2014 23:01, Oleg Nesterov o

Re: Kernel panic at Ubuntu: IMA + Apparmor

2014-04-25 Thread Dmitry Kasatkin
On 26 April 2014 00:46, Dmitry Kasatkin dmitry.kasat...@gmail.com wrote: On 26 April 2014 00:27, Eric W. Biederman ebied...@xmission.com wrote: Dmitry Kasatkin dmitry.kasat...@gmail.com writes: On 25 April 2014 23:45, Eric W. Biederman ebied...@xmission.com wrote: Dmitry Kasatkin dmitry.kasat

Re: [PATCH 01/20] KEYS: verify a certificate is signed by a 'trusted' key

2014-04-24 Thread Dmitry Kasatkin
On 24 April 2014 19:53, Mimi Zohar wrote: > On Wed, 2014-04-23 at 16:30 +0300, Dmitry Kasatkin wrote: >> From: Mimi Zohar >> >> Only public keys, with certificates signed by an existing >> 'trusted' key on the system trusted keyring, should be added >> to a

Re: [PATCH 01/20] KEYS: verify a certificate is signed by a 'trusted' key

2014-04-24 Thread Dmitry Kasatkin
On 24 April 2014 19:53, Mimi Zohar zo...@linux.vnet.ibm.com wrote: On Wed, 2014-04-23 at 16:30 +0300, Dmitry Kasatkin wrote: From: Mimi Zohar zo...@linux.vnet.ibm.com Only public keys, with certificates signed by an existing 'trusted' key on the system trusted keyring, should be added

[PATCH 01/20] KEYS: verify a certificate is signed by a 'trusted' key

2014-04-23 Thread Dmitry Kasatkin
. Changes: - Flaged out the code to prevent build break if system keyring is not enabled (Dmitry). Signed-off-by: Mimi Zohar Signed-off-by: David Howells Signed-off-by: Dmitry Kasatkin --- crypto/asymmetric_keys/x509_public_key.c | 85 +++- 1 file changed, 84

[PATCH 11/20] ima: added kernel parameter for disabling IMA

2014-04-23 Thread Dmitry Kasatkin
. Distributions might want to compile IMA support, but leave for the user to decide if to enable or disable IMA functionality. This patch provides kernel parameter 'ima=off' that allows to disable IMA. Signed-off-by: Dmitry Kasatkin --- security/integrity/ima/ima_main.c | 12 +++- 1 file changed

[PATCH 02/20] integrity: initialize EVM before IMA

2014-04-23 Thread Dmitry Kasatkin
Initialize EVM before IMA to prevent appraisal failure when reading EVM X509 certificate and HMAC key. Signed-off-by: Dmitry Kasatkin --- security/integrity/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/security/integrity/Makefile b/security/integrity/Makefile

[PATCH 00/20] in-kernel IMA/EVM initialization

2014-04-23 Thread Dmitry Kasatkin
Dmitry Kasatkin (19): integrity: initialize EVM before IMA ima: move asymmetric keys config option integrity: move integrity subsystem options to a separate menu integrity: provide builtin 'trusted' keyrings ima: create '_ima' as a builtin 'trusted' keyring integrity: provide x509 certificate

[PATCH 10/20] evm: load x509 certificate from the kernel

2014-04-23 Thread Dmitry Kasatkin
Provide configuration option to load X509 certificate into the _evm kernel keyring. Signed-off-by: Dmitry Kasatkin --- security/integrity/evm/Kconfig| 9 + security/integrity/evm/evm_main.c | 1 + 2 files changed, 10 insertions(+) diff --git a/security/integrity/evm/Kconfig b

[PATCH 12/20] ima: provide buffer hash calculation function

2014-04-23 Thread Dmitry Kasatkin
This patch provides convenient buffer hash calculation function. Signed-off-by: Dmitry Kasatkin --- security/integrity/ima/ima.h| 1 + security/integrity/ima/ima_crypto.c | 11 +-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/security/integrity/ima/ima.h b

[PATCH 07/20] integrity: provide x509 certificate loading from the kernel

2014-04-23 Thread Dmitry Kasatkin
Provide API to load x509 certificates from the kernel into the integrity kernel keyrings. Signed-off-by: Dmitry Kasatkin --- security/integrity/Kconfig | 4 +++ security/integrity/digsig.c| 72 ++ security/integrity/integrity.h | 10 ++ 3

[PATCH 04/20] integrity: move integrity subsystem options to a separate menu

2014-04-23 Thread Dmitry Kasatkin
Integrity subsystem got lots of options and takes more than half of security menu. This patch moves integrity subsystem options to a separate menu. It does not affect existing configuration. Re-configuration is not needed. Signed-off-by: Dmitry Kasatkin --- security/integrity/Kconfig | 11

[PATCH 13/20] ima: replace opencount with bitop

2014-04-23 Thread Dmitry Kasatkin
will not be valid. This patch replaces usage of opencount with busy bit. Signed-off-by: Dmitry Kasatkin --- security/integrity/ima/ima_fs.c | 23 ++- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/security/integrity/ima/ima_fs.c b/security/integrity/ima/ima_fs.c

[PATCH 03/20] ima: move asymmetric keys config option

2014-04-23 Thread Dmitry Kasatkin
For better visual appearance it is better to co-locate asymmetric key option together with signature support. Signed-off-by: Dmitry Kasatkin --- security/integrity/Kconfig | 24 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/security/integrity/Kconfig b

[PATCH 14/20] ima: check if policy was set at open

2014-04-23 Thread Dmitry Kasatkin
IMA default behavior is to forbid more than one policy update. It easier to check at open phase if policy was already set, so it would not be necessary to perform useless policy parsing and removing of sysfs entry. Signed-off-by: Dmitry Kasatkin --- security/integrity/ima/ima.h| 1

[PATCH 16/20] ima: load policy from the kernel

2014-04-23 Thread Dmitry Kasatkin
This patch provide IMA policy loading from the kernel. When CONFIG_IMA_KERNEL_POLICY is enabled, kernel tries to load default /etc/ima_policy. Policy signature must be located in /etc/ima_policy.sig. Signed-off-by: Dmitry Kasatkin --- security/integrity/ima/Kconfig| 7 +++ security

[PATCH 05/20] integrity: provide builtin 'trusted' keyrings

2014-04-23 Thread Dmitry Kasatkin
Provide creation of trusted keyrings, which require all keys added to the keyrings be signed by an existing trusted key on the system trusted keyring. Signed-off-by: Dmitry Kasatkin --- security/integrity/Kconfig | 4 security/integrity/digsig.c| 31

[PATCH 15/20] ima: path based policy loading interface

2014-04-23 Thread Dmitry Kasatkin
> /sys/kernel/security/ima/policy Signed-off-by: Dmitry Kasatkin --- security/integrity/ima/Kconfig | 13 +++ security/integrity/ima/ima.h| 9 + security/integrity/ima/ima_fs.c | 2 +- security/integrity/ima/ima_policy.c | 74 + 4 fi

[PATCH 17/20] ima: make IMA policy replaceable at runtime

2014-04-23 Thread Dmitry Kasatkin
. Signed-off-by: Dmitry Kasatkin --- security/integrity/ima/Kconfig | 8 security/integrity/ima/ima_fs.c | 2 ++ security/integrity/ima/ima_policy.c | 23 +++ 3 files changed, 29 insertions(+), 4 deletions(-) diff --git a/security/integrity/ima/Kconfig b

[PATCH 08/20] ima: load x509 certificate from the kernel

2014-04-23 Thread Dmitry Kasatkin
Provide configuration option to load X509 certificate into the _ima kernel keyring. Signed-off-by: Dmitry Kasatkin --- security/integrity/ima/Kconfig| 9 + security/integrity/ima/ima_init.c | 1 + 2 files changed, 10 insertions(+) diff --git a/security/integrity/ima/Kconfig b

[PATCH 18/20] evm: added kernel parameter for disabling EVM

2014-04-23 Thread Dmitry Kasatkin
parameter 'evm=off' that allows to disable EVM. Signed-off-by: Dmitry Kasatkin --- security/integrity/evm/evm.h | 5 + security/integrity/evm/evm_main.c | 19 +-- security/integrity/evm/evm_secfs.c | 3 ++- 3 files changed, 20 insertions(+), 7 deletions(-) diff --git

[PATCH 19/20] evm: try enable EVM from the kernel

2014-04-23 Thread Dmitry Kasatkin
EVM key might be initialzed in the kernel by kernel module using HW specific way. For example such method would suite devices with ARM Trust Zone technology. This patch tries enable EVM by checking if evm-key already exists in the kernel keyring. Signed-off-by: Dmitry Kasatkin --- security

[PATCH 20/20] evm: read EVM key from the kernel

2014-04-23 Thread Dmitry Kasatkin
. However, it is recommended to use 'trusted' master key, because 'user' master key is in non-encrypted form. Signed-off-by: Dmitry Kasatkin --- security/integrity/evm/Kconfig | 8 security/integrity/evm/evm.h| 9 security/integrity/evm/evm_crypto.c | 96

[PATCH 06/20] ima: create '_ima' as a builtin 'trusted' keyring

2014-04-23 Thread Dmitry Kasatkin
Require all keys added to the IMA keyring be signed by an existing trusted key on the system trusted keyring. Signed-off-by: Dmitry Kasatkin --- security/integrity/ima/Kconfig| 9 + security/integrity/ima/ima_init.c | 1 + 2 files changed, 10 insertions(+) diff --git a/security

[PATCH 09/20] evm: create '_evm' as a builtin 'trusted' keyring

2014-04-23 Thread Dmitry Kasatkin
Require all keys added to the EVM keyring be signed by an existing trusted key on the system trusted keyring. Signed-off-by: Dmitry Kasatkin --- security/integrity/evm/Kconfig| 8 security/integrity/evm/evm_main.c | 2 ++ 2 files changed, 10 insertions(+) diff --git a/security

[PATCH 09/20] evm: create '_evm' as a builtin 'trusted' keyring

2014-04-23 Thread Dmitry Kasatkin
Require all keys added to the EVM keyring be signed by an existing trusted key on the system trusted keyring. Signed-off-by: Dmitry Kasatkin d.kasat...@samsung.com --- security/integrity/evm/Kconfig| 8 security/integrity/evm/evm_main.c | 2 ++ 2 files changed, 10 insertions

[PATCH 06/20] ima: create '_ima' as a builtin 'trusted' keyring

2014-04-23 Thread Dmitry Kasatkin
Require all keys added to the IMA keyring be signed by an existing trusted key on the system trusted keyring. Signed-off-by: Dmitry Kasatkin d.kasat...@samsung.com --- security/integrity/ima/Kconfig| 9 + security/integrity/ima/ima_init.c | 1 + 2 files changed, 10 insertions

[PATCH 20/20] evm: read EVM key from the kernel

2014-04-23 Thread Dmitry Kasatkin
. However, it is recommended to use 'trusted' master key, because 'user' master key is in non-encrypted form. Signed-off-by: Dmitry Kasatkin d.kasat...@samsung.com --- security/integrity/evm/Kconfig | 8 security/integrity/evm/evm.h| 9 security/integrity/evm/evm_crypto.c

[PATCH 19/20] evm: try enable EVM from the kernel

2014-04-23 Thread Dmitry Kasatkin
EVM key might be initialzed in the kernel by kernel module using HW specific way. For example such method would suite devices with ARM Trust Zone technology. This patch tries enable EVM by checking if evm-key already exists in the kernel keyring. Signed-off-by: Dmitry Kasatkin d.kasat

[PATCH 18/20] evm: added kernel parameter for disabling EVM

2014-04-23 Thread Dmitry Kasatkin
parameter 'evm=off' that allows to disable EVM. Signed-off-by: Dmitry Kasatkin d.kasat...@samsung.com --- security/integrity/evm/evm.h | 5 + security/integrity/evm/evm_main.c | 19 +-- security/integrity/evm/evm_secfs.c | 3 ++- 3 files changed, 20 insertions(+), 7

[PATCH 08/20] ima: load x509 certificate from the kernel

2014-04-23 Thread Dmitry Kasatkin
Provide configuration option to load X509 certificate into the _ima kernel keyring. Signed-off-by: Dmitry Kasatkin d.kasat...@samsung.com --- security/integrity/ima/Kconfig| 9 + security/integrity/ima/ima_init.c | 1 + 2 files changed, 10 insertions(+) diff --git a/security

[PATCH 17/20] ima: make IMA policy replaceable at runtime

2014-04-23 Thread Dmitry Kasatkin
. Signed-off-by: Dmitry Kasatkin d.kasat...@samsung.com --- security/integrity/ima/Kconfig | 8 security/integrity/ima/ima_fs.c | 2 ++ security/integrity/ima/ima_policy.c | 23 +++ 3 files changed, 29 insertions(+), 4 deletions(-) diff --git a/security

[PATCH 15/20] ima: path based policy loading interface

2014-04-23 Thread Dmitry Kasatkin
/ima/ima_policy /sys/kernel/security/ima/policy Signed-off-by: Dmitry Kasatkin d.kasat...@samsung.com --- security/integrity/ima/Kconfig | 13 +++ security/integrity/ima/ima.h| 9 + security/integrity/ima/ima_fs.c | 2 +- security/integrity/ima/ima_policy.c | 74

[PATCH 05/20] integrity: provide builtin 'trusted' keyrings

2014-04-23 Thread Dmitry Kasatkin
Provide creation of trusted keyrings, which require all keys added to the keyrings be signed by an existing trusted key on the system trusted keyring. Signed-off-by: Dmitry Kasatkin d.kasat...@samsung.com --- security/integrity/Kconfig | 4 security/integrity/digsig.c| 31

[PATCH 16/20] ima: load policy from the kernel

2014-04-23 Thread Dmitry Kasatkin
This patch provide IMA policy loading from the kernel. When CONFIG_IMA_KERNEL_POLICY is enabled, kernel tries to load default /etc/ima_policy. Policy signature must be located in /etc/ima_policy.sig. Signed-off-by: Dmitry Kasatkin d.kasat...@samsung.com --- security/integrity/ima/Kconfig| 7

[PATCH 14/20] ima: check if policy was set at open

2014-04-23 Thread Dmitry Kasatkin
IMA default behavior is to forbid more than one policy update. It easier to check at open phase if policy was already set, so it would not be necessary to perform useless policy parsing and removing of sysfs entry. Signed-off-by: Dmitry Kasatkin d.kasat...@samsung.com --- security/integrity/ima

[PATCH 13/20] ima: replace opencount with bitop

2014-04-23 Thread Dmitry Kasatkin
will not be valid. This patch replaces usage of opencount with busy bit. Signed-off-by: Dmitry Kasatkin d.kasat...@samsung.com --- security/integrity/ima/ima_fs.c | 23 ++- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/security/integrity/ima/ima_fs.c b/security

[PATCH 03/20] ima: move asymmetric keys config option

2014-04-23 Thread Dmitry Kasatkin
For better visual appearance it is better to co-locate asymmetric key option together with signature support. Signed-off-by: Dmitry Kasatkin d.kasat...@samsung.com --- security/integrity/Kconfig | 24 1 file changed, 12 insertions(+), 12 deletions(-) diff --git

[PATCH 07/20] integrity: provide x509 certificate loading from the kernel

2014-04-23 Thread Dmitry Kasatkin
Provide API to load x509 certificates from the kernel into the integrity kernel keyrings. Signed-off-by: Dmitry Kasatkin d.kasat...@samsung.com --- security/integrity/Kconfig | 4 +++ security/integrity/digsig.c| 72 ++ security/integrity

[PATCH 04/20] integrity: move integrity subsystem options to a separate menu

2014-04-23 Thread Dmitry Kasatkin
Integrity subsystem got lots of options and takes more than half of security menu. This patch moves integrity subsystem options to a separate menu. It does not affect existing configuration. Re-configuration is not needed. Signed-off-by: Dmitry Kasatkin d.kasat...@samsung.com --- security

[PATCH 12/20] ima: provide buffer hash calculation function

2014-04-23 Thread Dmitry Kasatkin
This patch provides convenient buffer hash calculation function. Signed-off-by: Dmitry Kasatkin d.kasat...@samsung.com --- security/integrity/ima/ima.h| 1 + security/integrity/ima/ima_crypto.c | 11 +-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/security

[PATCH 10/20] evm: load x509 certificate from the kernel

2014-04-23 Thread Dmitry Kasatkin
Provide configuration option to load X509 certificate into the _evm kernel keyring. Signed-off-by: Dmitry Kasatkin d.kasat...@samsung.com --- security/integrity/evm/Kconfig| 9 + security/integrity/evm/evm_main.c | 1 + 2 files changed, 10 insertions(+) diff --git a/security

[PATCH 01/20] KEYS: verify a certificate is signed by a 'trusted' key

2014-04-23 Thread Dmitry Kasatkin
pkcs7_request_asymmetric_key() patch. Changes: - Flaged out the code to prevent build break if system keyring is not enabled (Dmitry). Signed-off-by: Mimi Zohar zo...@linux.vnet.ibm.com Signed-off-by: David Howells dhowe...@redhat.com Signed-off-by: Dmitry Kasatkin d.kasat...@samsung.com --- crypto

[PATCH 11/20] ima: added kernel parameter for disabling IMA

2014-04-23 Thread Dmitry Kasatkin
. Distributions might want to compile IMA support, but leave for the user to decide if to enable or disable IMA functionality. This patch provides kernel parameter 'ima=off' that allows to disable IMA. Signed-off-by: Dmitry Kasatkin d.kasat...@samsung.com --- security/integrity/ima/ima_main.c | 12

[PATCH 02/20] integrity: initialize EVM before IMA

2014-04-23 Thread Dmitry Kasatkin
Initialize EVM before IMA to prevent appraisal failure when reading EVM X509 certificate and HMAC key. Signed-off-by: Dmitry Kasatkin d.kasat...@samsung.com --- security/integrity/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/security/integrity/Makefile b

[PATCH 00/20] in-kernel IMA/EVM initialization

2014-04-23 Thread Dmitry Kasatkin
Dmitry Kasatkin (19): integrity: initialize EVM before IMA ima: move asymmetric keys config option integrity: move integrity subsystem options to a separate menu integrity: provide builtin 'trusted' keyrings ima: create '_ima' as a builtin 'trusted' keyring integrity: provide x509 certificate

Re: [PATCH 8/8] evm: introduce EVM hmac xattr list

2014-03-05 Thread Dmitry Kasatkin
On Wed, Mar 5, 2014 at 6:04 PM, Mimi Zohar wrote: > On Wed, 2014-03-05 at 11:26 +0200, Dmitry Kasatkin wrote: >> On Tue, Mar 4, 2014 at 10:36 PM, Mimi Zohar wrote: >> > On Tue, 2014-03-04 at 16:18 +0200, Dmitry Kasatkin wrote: >> >> On Tue, Mar 4, 2014 at 5:2

Re: [PATCH 8/8] evm: introduce EVM hmac xattr list

2014-03-05 Thread Dmitry Kasatkin
On Tue, Mar 4, 2014 at 10:36 PM, Mimi Zohar wrote: > On Tue, 2014-03-04 at 16:18 +0200, Dmitry Kasatkin wrote: >> On Tue, Mar 4, 2014 at 5:21 AM, Mimi Zohar wrote: >> > On Mon, 2014-03-03 at 19:00 -0800, Casey Schaufler wrote: >> >> On 3/3/2014 6:39 PM, Mimi Zohar

Re: [PATCH 8/8] evm: introduce EVM hmac xattr list

2014-03-05 Thread Dmitry Kasatkin
On Tue, Mar 4, 2014 at 10:36 PM, Mimi Zohar zo...@linux.vnet.ibm.com wrote: On Tue, 2014-03-04 at 16:18 +0200, Dmitry Kasatkin wrote: On Tue, Mar 4, 2014 at 5:21 AM, Mimi Zohar zo...@linux.vnet.ibm.com wrote: On Mon, 2014-03-03 at 19:00 -0800, Casey Schaufler wrote: On 3/3/2014 6:39 PM, Mimi

Re: [PATCH 8/8] evm: introduce EVM hmac xattr list

2014-03-05 Thread Dmitry Kasatkin
On Wed, Mar 5, 2014 at 6:04 PM, Mimi Zohar zo...@linux.vnet.ibm.com wrote: On Wed, 2014-03-05 at 11:26 +0200, Dmitry Kasatkin wrote: On Tue, Mar 4, 2014 at 10:36 PM, Mimi Zohar zo...@linux.vnet.ibm.com wrote: On Tue, 2014-03-04 at 16:18 +0200, Dmitry Kasatkin wrote: On Tue, Mar 4, 2014 at 5

Re: [PATCH 7/8] evm: introduce EVM hmac attribute list

2014-03-04 Thread Dmitry Kasatkin
On Tue, Mar 4, 2014 at 4:09 AM, Mimi Zohar wrote: > On Fri, 2014-02-28 at 16:59 +0200, Dmitry Kasatkin wrote: >> This patch replaces using of hmac version configuration parameter >> with attribute list. It allows to build kernels which works with >> previously labeled filesys

Re: [PATCH 8/8] evm: introduce EVM hmac xattr list

2014-03-04 Thread Dmitry Kasatkin
On Tue, Mar 4, 2014 at 5:21 AM, Mimi Zohar wrote: > On Mon, 2014-03-03 at 19:00 -0800, Casey Schaufler wrote: >> On 3/3/2014 6:39 PM, Mimi Zohar wrote: >> > On Fri, 2014-02-28 at 16:59 +0200, Dmitry Kasatkin wrote: >> >> EVM currently uses source hard co

Re: [PATCH 6/8] evm: enable key retention service automatically

2014-03-04 Thread Dmitry Kasatkin
On Tue, Mar 4, 2014 at 4:02 AM, Mimi Zohar wrote: > On Fri, 2014-02-28 at 16:59 +0200, Dmitry Kasatkin wrote: >> If keys are not enabled, EVM is not visible in the configuration menu. >> It may be difficult to figure out what to do unless you really know. >> >> Ot

Re: [PATCH 6/8] evm: enable key retention service automatically

2014-03-04 Thread Dmitry Kasatkin
On Tue, Mar 4, 2014 at 4:02 AM, Mimi Zohar zo...@linux.vnet.ibm.com wrote: On Fri, 2014-02-28 at 16:59 +0200, Dmitry Kasatkin wrote: If keys are not enabled, EVM is not visible in the configuration menu. It may be difficult to figure out what to do unless you really know. Other subsystems

Re: [PATCH 8/8] evm: introduce EVM hmac xattr list

2014-03-04 Thread Dmitry Kasatkin
On Tue, Mar 4, 2014 at 5:21 AM, Mimi Zohar zo...@linux.vnet.ibm.com wrote: On Mon, 2014-03-03 at 19:00 -0800, Casey Schaufler wrote: On 3/3/2014 6:39 PM, Mimi Zohar wrote: On Fri, 2014-02-28 at 16:59 +0200, Dmitry Kasatkin wrote: EVM currently uses source hard coded list of xattrs which

Re: [PATCH 7/8] evm: introduce EVM hmac attribute list

2014-03-04 Thread Dmitry Kasatkin
On Tue, Mar 4, 2014 at 4:09 AM, Mimi Zohar zo...@linux.vnet.ibm.com wrote: On Fri, 2014-02-28 at 16:59 +0200, Dmitry Kasatkin wrote: This patch replaces using of hmac version configuration parameter with attribute list. It allows to build kernels which works with previously labeled filesystems

Re: [PATCH 2/8] integrity: fix checkpatch errors

2014-03-03 Thread Dmitry Kasatkin
On Mon, Mar 3, 2014 at 3:41 PM, Mimi Zohar wrote: > On Fri, 2014-02-28 at 16:59 +0200, Dmitry Kasatkin wrote: >> Unfixed checkpatch errors make it difficult to see new errors.. >> This patch fix them. > > A number of these errors are a result of inconsistencies between Lin

Re: [PATCH 2/8] integrity: fix checkpatch errors

2014-03-03 Thread Dmitry Kasatkin
On Mon, Mar 3, 2014 at 3:41 PM, Mimi Zohar zo...@linux.vnet.ibm.com wrote: On Fri, 2014-02-28 at 16:59 +0200, Dmitry Kasatkin wrote: Unfixed checkpatch errors make it difficult to see new errors.. This patch fix them. A number of these errors are a result of inconsistencies between Lindent

Re: [PATCH 2/8] integrity: fix checkpatch errors

2014-02-28 Thread Dmitry Kasatkin
This patch is on the top of Joe Perches patch. - Dmitry On 28/02/14 16:59, Dmitry Kasatkin wrote: > Unfixed checkpatch errors make it difficult to see new errors.. > This patch fix them. > Some lines with over 80 chars remained unchanged to improve > code readability. > > Sig

[RFC 1/2] ima: use ahash API for file hash calculation

2014-02-28 Thread Dmitry Kasatkin
line. Signed-off-by: Dmitry Kasatkin --- security/integrity/ima/ima_crypto.c | 180 +++- 1 file changed, 176 insertions(+), 4 deletions(-) diff --git a/security/integrity/ima/ima_crypto.c b/security/integrity/ima/ima_crypto.c index 1bde8e6..baf7a4d 100644

[RFC 2/2] ima: provide double buffering for hash calculation

2014-02-28 Thread Dmitry Kasatkin
Asynchronous hash API allows initiate hash calculation and perform other tasks while hash is calculated. This patch introduces using of double buffering for simultenous hashing and reading of the next chunk of data from storage. Signed-off-by: Dmitry Kasatkin --- security/integrity/ima

<    1   2   3   4   5   6   7   8   >