[PATCH v4 5/6] ima: require signature based appraisal

2014-11-05 Thread Dmitry Kasatkin
Signed-off-by: Dmitry Kasatkin d.kasat...@samsung.com --- security/integrity/ima/Kconfig | 7 +++ security/integrity/ima/ima_policy.c | 5 + 2 files changed, 12 insertions(+) diff --git a/security/integrity/ima/Kconfig b/security/integrity/ima/Kconfig index 8288edc..31b44b8 100644

[PATCH v4 1/6] integrity: define a new function integrity_read_file()

2014-11-05 Thread Dmitry Kasatkin
of kernel_read(), to integrity_kernel_read(). Changes in v3: * Patch descriptions improved (Mimi) Changes in v2: * configuration option removed * function declared as '__init' Signed-off-by: Dmitry Kasatkin d.kasat...@samsung.com --- security/integrity/iint.c | 78

[PATCH v4 2/6] integrity: provide a function to load x509 certificate from the kernel

2014-11-05 Thread Dmitry Kasatkin
Provide the function to load x509 certificates from the kernel into the integrity kernel keyring. Changes in v2: * configuration option removed * function declared as '__init' Signed-off-by: Dmitry Kasatkin d.kasat...@samsung.com --- security/integrity/digsig.c| 37

Re: [GIT PULL] Fix for Integrity subsystem null pointer deref

2014-10-29 Thread Dmitry Kasatkin
On 29 October 2014 23:22, Andy Lutomirski wrote: > On Oct 29, 2014 1:20 PM, "Mimi Zohar" wrote: >> >> On Wed, 2014-10-29 at 11:51 -0700, Andy Lutomirski wrote: >> > On Wed, Oct 29, 2014 at 11:36 AM, Dan Carpenter >> > wrote: >> > > On Wed, Oct 29, 2014 at 09:23:45AM -0700, Andy Lutomirski

Re: [GIT PULL] Fix for Integrity subsystem null pointer deref

2014-10-29 Thread Dmitry Kasatkin
On 29 October 2014 23:22, Andy Lutomirski l...@amacapital.net wrote: On Oct 29, 2014 1:20 PM, Mimi Zohar zo...@linux.vnet.ibm.com wrote: On Wed, 2014-10-29 at 11:51 -0700, Andy Lutomirski wrote: On Wed, Oct 29, 2014 at 11:36 AM, Dan Carpenter dan.carpen...@oracle.com wrote: On Wed, Oct

Re: [PATCH v3 3/3] evm: check xattr value length and type in evm_inode_setxattr()

2014-10-28 Thread Dmitry Kasatkin
Sorry, this was the wrong version of the patch. Please ignore this patch and use what is in the reply to this patch: [PATCH v3 1/1] evm: check xattr value length and type in evm_inode_setxattr() - Dmitry On 28/10/14 13:31, Dmitry Kasatkin wrote: > evm_inode_setxattr() can be called with no va

[PATCH v3 1/1] evm: check xattr value length and type in evm_inode_setxattr()

2014-10-28 Thread Dmitry Kasatkin
a/0x48 [ 1106.400020] RSP [ 1106.400020] CR2: [ 1106.428061] ---[ end trace ae08331628ba3050 ]--- Reported-by: Jan Kara Signed-off-by: Dmitry Kasatkin Cc: sta...@vger.kernel.org --- security/integrity/evm/evm_main.c | 9 ++--- 1 file changed, 6 insertions(+), 3 del

[PATCH v3 1/3] ima: check xattr value length and type in the ima_inode_setxattr()

2014-10-28 Thread Dmitry Kasatkin
a_inode_setxattr+0x3e/0x5a [ 261.564109] RSP [ 261.564109] CR2: [ 261.58] ---[ end trace 39a89a3fc267e652 ]--- Reported-by: Jan Kara Signed-off-by: Dmitry Kasatkin Cc: sta...@vger.kernel.org --- security/integrity/ima/ima_appraise.c | 2 ++ security/integrity/integr

[PATCH v3 2/3] ima: limit file hash setting by user to fix and log modes

2014-10-28 Thread Dmitry Kasatkin
File hashes are automatically set and updated and should not be manually set. This patch limits file hash setting to fix and log modes. Signed-off-by: Dmitry Kasatkin --- security/integrity/ima/ima_appraise.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/security

[PATCH v3 0/3] integrity: NULL pointer dereference fixes

2014-10-28 Thread Dmitry Kasatkin
patch fixes the oops and must go to the stable and the second patch limits setting of file hash to fix and log modes and may go to the next kernel version via normal process. - Dmitry Dmitry Kasatkin (3): ima: check xattr value length and type in the ima_inode_setxattr() ima: limit file hash

[PATCH v3 3/3] evm: check xattr value length and type in evm_inode_setxattr()

2014-10-28 Thread Dmitry Kasatkin
Signed-off-by: Dmitry Kasatkin Cc: sta...@vger.kernel.org --- security/integrity/evm/evm_main.c | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/security/integrity/evm/evm_main.c b/security/integrity/evm/evm_main.c index b392fe6..1384e4b 100644 --- a/security/integri

[PATCH v3 0/3] integrity: NULL pointer dereference fixes

2014-10-28 Thread Dmitry Kasatkin
patch fixes the oops and must go to the stable and the second patch limits setting of file hash to fix and log modes and may go to the next kernel version via normal process. - Dmitry Dmitry Kasatkin (3): ima: check xattr value length and type in the ima_inode_setxattr() ima: limit file hash

[PATCH v3 3/3] evm: check xattr value length and type in evm_inode_setxattr()

2014-10-28 Thread Dmitry Kasatkin
[ 1106.400020] RIP [812af7b8] evm_inode_setxattr+0x2a/0x48 [ 1106.400020] RSP 88002917fd50 [ 1106.400020] CR2: [ 1106.428061] ---[ end trace ae08331628ba3050 ]--- Reported-by: Jan Kara j...@suse.cz Signed-off-by: Dmitry Kasatkin d.kasat...@samsung.com Cc: sta

[PATCH v3 1/3] ima: check xattr value length and type in the ima_inode_setxattr()

2014-10-28 Thread Dmitry Kasatkin
[ 261.58] ---[ end trace 39a89a3fc267e652 ]--- Reported-by: Jan Kara j...@suse.cz Signed-off-by: Dmitry Kasatkin d.kasat...@samsung.com Cc: sta...@vger.kernel.org --- security/integrity/ima/ima_appraise.c | 2 ++ security/integrity/integrity.h| 1 + 2 files changed, 3 insertions(+) diff --git

[PATCH v3 2/3] ima: limit file hash setting by user to fix and log modes

2014-10-28 Thread Dmitry Kasatkin
File hashes are automatically set and updated and should not be manually set. This patch limits file hash setting to fix and log modes. Signed-off-by: Dmitry Kasatkin d.kasat...@samsung.com --- security/integrity/ima/ima_appraise.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions

[PATCH v3 1/1] evm: check xattr value length and type in evm_inode_setxattr()

2014-10-28 Thread Dmitry Kasatkin
] ---[ end trace ae08331628ba3050 ]--- Reported-by: Jan Kara j...@suse.cz Signed-off-by: Dmitry Kasatkin d.kasat...@samsung.com Cc: sta...@vger.kernel.org --- security/integrity/evm/evm_main.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/security/integrity/evm/evm_main.c

Re: [PATCH v3 3/3] evm: check xattr value length and type in evm_inode_setxattr()

2014-10-28 Thread Dmitry Kasatkin
Sorry, this was the wrong version of the patch. Please ignore this patch and use what is in the reply to this patch: [PATCH v3 1/1] evm: check xattr value length and type in evm_inode_setxattr() - Dmitry On 28/10/14 13:31, Dmitry Kasatkin wrote: evm_inode_setxattr() can be called with no value

Re: [PATCH v2 1/2] ima: check xattr value length in ima_inode_setxattr()

2014-10-24 Thread Dmitry Kasatkin
On 24/10/14 18:00, Dmitry Kasatkin wrote: > On 24/10/14 17:18, Mimi Zohar wrote: >> On Fri, 2014-10-24 at 10:07 +0300, Dmitry Kasatkin wrote: >>> ima_inode_setxattr() can be called with no value. Function does not >>> check the length so that following command can be

Re: [PATCH v2 1/2] ima: check xattr value length in ima_inode_setxattr()

2014-10-24 Thread Dmitry Kasatkin
On 24/10/14 17:18, Mimi Zohar wrote: > On Fri, 2014-10-24 at 10:07 +0300, Dmitry Kasatkin wrote: >> ima_inode_setxattr() can be called with no value. Function does not >> check the length so that following command can be used to produce >> kernel oops: setfattr -n securit

[PATCH v2 0/2] integrity fixes

2014-10-24 Thread Dmitry Kasatkin
Hi, At first I did not notice Mimi's email with suggestion to allow setting hash only in fix mode. Here is a next set with checking validity of xattr type and allowing setting hash only in permissive modes such as fix and log. - Dmitry Dmitry Kasatkin (2): ima: check xattr value length

[PATCH v2 2/2] evm: check xattr value length in evm_inode_setxattr()

2014-10-24 Thread Dmitry Kasatkin
ed-off-by: Dmitry Kasatkin --- security/integrity/evm/evm_main.c | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/security/integrity/evm/evm_main.c b/security/integrity/evm/evm_main.c index b392fe6..1384e4b 100644 --- a/security/integrity/evm/evm_main.c +++ b/security/int

[PATCH v2 1/2] ima: check xattr value length in ima_inode_setxattr()

2014-10-24 Thread Dmitry Kasatkin
trace 39a89a3fc267e652 ]--- Reported-by: Jan Kara Signed-off-by: Dmitry Kasatkin --- security/integrity/ima/ima_appraise.c | 13 +++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/security/integrity/ima/ima_appraise.c b/security/integrity/ima/ima_appraise.c index 9226854..e302cbf

[PATCH v2 1/2] ima: check xattr value length in ima_inode_setxattr()

2014-10-24 Thread Dmitry Kasatkin
68 40 0f 94 c6 e8 e1 f9 ff ff 89 d8 [ 261.564109] RIP [812af272] ima_inode_setxattr+0x3e/0x5a [ 261.564109] RSP 880042be3d50 [ 261.564109] CR2: [ 261.58] ---[ end trace 39a89a3fc267e652 ]--- Reported-by: Jan Kara j...@suse.cz Signed-off-by: Dmitry Kasatkin

[PATCH v2 2/2] evm: check xattr value length in evm_inode_setxattr()

2014-10-24 Thread Dmitry Kasatkin
] RIP [812af7b8] evm_inode_setxattr+0x2a/0x48 [ 1106.400020] RSP 88002917fd50 [ 1106.400020] CR2: [ 1106.428061] ---[ end trace ae08331628ba3050 ]--- Reported-by: Jan Kara j...@suse.cz Signed-off-by: Dmitry Kasatkin d.kasat...@samsung.com --- security/integrity/evm

[PATCH v2 0/2] integrity fixes

2014-10-24 Thread Dmitry Kasatkin
Hi, At first I did not notice Mimi's email with suggestion to allow setting hash only in fix mode. Here is a next set with checking validity of xattr type and allowing setting hash only in permissive modes such as fix and log. - Dmitry Dmitry Kasatkin (2): ima: check xattr value length

Re: [PATCH v2 1/2] ima: check xattr value length in ima_inode_setxattr()

2014-10-24 Thread Dmitry Kasatkin
On 24/10/14 17:18, Mimi Zohar wrote: On Fri, 2014-10-24 at 10:07 +0300, Dmitry Kasatkin wrote: ima_inode_setxattr() can be called with no value. Function does not check the length so that following command can be used to produce kernel oops: setfattr -n security.ima FOO. This patch fixes

Re: [PATCH v2 1/2] ima: check xattr value length in ima_inode_setxattr()

2014-10-24 Thread Dmitry Kasatkin
On 24/10/14 18:00, Dmitry Kasatkin wrote: On 24/10/14 17:18, Mimi Zohar wrote: On Fri, 2014-10-24 at 10:07 +0300, Dmitry Kasatkin wrote: ima_inode_setxattr() can be called with no value. Function does not check the length so that following command can be used to produce kernel oops: setfattr

Re: [PATCH 1/2] ima: check xattr value length in ima_inode_setxattr()

2014-10-23 Thread Dmitry Kasatkin
On 23 October 2014 18:40, Jan Kara wrote: > On Thu 23-10-14 16:47:17, Dmitry Kasatkin wrote: >> ima_inode_setxattr() can be called with no value. Function does not >> check the length so that following command can be used to produce >> kernel oops: setfattr -n security.ima

[PATCH 0/2] integrity fixes

2014-10-23 Thread Dmitry Kasatkin
Hi, Here is couple of patches to fix bugs reported by Jan Kara to prevent kernel oopses when setxattr() is called without xattr values. - Dmitry Dmitry Kasatkin (2): ima: check xattr value length in ima_inode_setxattr() evm: check xattr value length in evm_inode_setxattr() security

[PATCH 2/2] evm: check xattr value length in evm_inode_setxattr()

2014-10-23 Thread Dmitry Kasatkin
02 74 0d 48 89 de 4c 89 e7 e8 5a fe ff ff eb 03 83 [ 1106.400020] RIP [] evm_inode_setxattr+0x2a/0x48 [ 1106.400020] RSP [ 1106.400020] CR2: [ 1106.428061] ---[ end trace ae08331628ba3050 ]--- Reported-by: Jan Kara Signed-off-by: Dmitry Kasatkin --- security/integrity/evm/evm_

[PATCH 1/2] ima: check xattr value length in ima_inode_setxattr()

2014-10-23 Thread Dmitry Kasatkin
03 49 8b 7c 24 68 40 0f 94 c6 e8 e1 f9 ff ff 89 d8 [ 261.564109] RIP [] ima_inode_setxattr+0x3e/0x5a [ 261.564109] RSP [ 261.564109] CR2: [ 261.58] ---[ end trace 39a89a3fc267e652 ]--- Reported-by: Jan Kara Signed-off-by: Dmitry Kasatkin --- security/integri

[PATCH 1/2] ima: check xattr value length in ima_inode_setxattr()

2014-10-23 Thread Dmitry Kasatkin
/0x5a [ 261.564109] RSP 880042be3d50 [ 261.564109] CR2: [ 261.58] ---[ end trace 39a89a3fc267e652 ]--- Reported-by: Jan Kara j...@suse.cz Signed-off-by: Dmitry Kasatkin d.kasat...@samsung.com --- security/integrity/ima/ima_appraise.c | 2 ++ 1 file changed, 2 insertions

[PATCH 2/2] evm: check xattr value length in evm_inode_setxattr()

2014-10-23 Thread Dmitry Kasatkin
/0x48 [ 1106.400020] RSP 88002917fd50 [ 1106.400020] CR2: [ 1106.428061] ---[ end trace ae08331628ba3050 ]--- Reported-by: Jan Kara j...@suse.cz Signed-off-by: Dmitry Kasatkin d.kasat...@samsung.com --- security/integrity/evm/evm_main.c | 9 ++--- 1 file changed, 6 insertions

[PATCH 0/2] integrity fixes

2014-10-23 Thread Dmitry Kasatkin
Hi, Here is couple of patches to fix bugs reported by Jan Kara to prevent kernel oopses when setxattr() is called without xattr values. - Dmitry Dmitry Kasatkin (2): ima: check xattr value length in ima_inode_setxattr() evm: check xattr value length in evm_inode_setxattr() security

Re: [PATCH 1/2] ima: check xattr value length in ima_inode_setxattr()

2014-10-23 Thread Dmitry Kasatkin
On 23 October 2014 18:40, Jan Kara j...@suse.cz wrote: On Thu 23-10-14 16:47:17, Dmitry Kasatkin wrote: ima_inode_setxattr() can be called with no value. Function does not check the length so that following command can be used to produce kernel oops: setfattr -n security.ima FOO. This patch

Re: [PATCH 0/3] MODSIGN: Use PKCS#7 cert to avoid SKIDs

2014-10-20 Thread Dmitry Kasatkin
On 16/10/14 15:31, David Howells wrote: > Dmitry Kasatkin wrote: > >> /tmp/ccgSFKJd.o: In function `display_openssl_errors': >> sign-file.c:(.text+0x4e): undefined reference to `ERR_peek_error' >> sign-file.c:(.text+0xa1): undefined reference to `ERR_error_string' >>

Re: [PATCH 0/3] MODSIGN: Use PKCS#7 cert to avoid SKIDs

2014-10-20 Thread Dmitry Kasatkin
On 16/10/14 15:31, David Howells wrote: Dmitry Kasatkin d.kasat...@samsung.com wrote: /tmp/ccgSFKJd.o: In function `display_openssl_errors': sign-file.c:(.text+0x4e): undefined reference to `ERR_peek_error' sign-file.c:(.text+0xa1): undefined reference to `ERR_error_string

Re: [PATCH v3 0/6] ima: provide signature based 'init' appraisal

2014-10-14 Thread Dmitry Kasatkin
Hi Mimi, Thanks for reply. I will fix your comments. I am on LinuxCon EU at the moment. Fixing as have a time :) - Dmitry On 13 October 2014 19:32, Mimi Zohar wrote: > On Fri, 2014-10-10 at 17:09 +0300, Dmitry Kasatkin wrote: >> Currently secure IMA/EVM initialization has to be

Re: [PATCH v3 0/6] ima: provide signature based 'init' appraisal

2014-10-14 Thread Dmitry Kasatkin
Hi Mimi, Thanks for reply. I will fix your comments. I am on LinuxCon EU at the moment. Fixing as have a time :) - Dmitry On 13 October 2014 19:32, Mimi Zohar zo...@linux.vnet.ibm.com wrote: On Fri, 2014-10-10 at 17:09 +0300, Dmitry Kasatkin wrote: Currently secure IMA/EVM initialization has

[PATCH v3 4/6] integrity: provide hook to load keys when rootfs is ready

2014-10-10 Thread Dmitry Kasatkin
-by: Dmitry Kasatkin --- include/linux/integrity.h | 6 ++ init/main.c | 6 +- security/integrity/iint.c | 11 +++ 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/include/linux/integrity.h b/include/linux/integrity.h index 83222ce..c2d6082 100644 --- a/include

[PATCH v3 0/6] ima: provide signature based 'init' appraisal

2014-10-10 Thread Dmitry Kasatkin
enabled. -Dmitry Dmitry Kasatkin (6): integrity: provide integrity_read_file() integrity: provide x509 certificate loading from the kernel ima: load x509 certificate from the kernel integrity: provide hook to load keys when rootfs is ready ima: require signature based appraisal VFS

Re: [PATCH v1 0/4] ima: require signed user-space initialization

2014-10-10 Thread Dmitry Kasatkin
Hello Andrew, I have just posted updated patchset. Please check patch description where I discuss your questions and related changes. Thanks, Dmitry On 30/07/14 00:37, Dmitry Kasatkin wrote: > On Wed, Jul 23, 2014 at 9:08 PM, Mimi Zohar wrote: >> On Wed, 2014-07-16 at 23:26 +030

[PATCH v3 2/6] integrity: provide x509 certificate loading from the kernel

2014-10-10 Thread Dmitry Kasatkin
Provide function to load x509 certificates from the kernel into the integrity kernel keyrings. Changes in v2: * configuration option removed * function declared as '__init' Signed-off-by: Dmitry Kasatkin --- security/integrity/digsig.c| 37 - security

[PATCH v3 6/6] VFS: refactor vfs_read()

2014-10-10 Thread Dmitry Kasatkin
integrity_kernel_read() duplicates the file read operations code in vfs_read(). This patch refactors vfs_read() code creating a helper function __vfs_read(). It is used by both vfs_read() and integrity_kernel_read(). Signed-off-by: Dmitry Kasatkin --- fs/read_write.c | 24

[PATCH v3 5/6] ima: require signature based appraisal

2014-10-10 Thread Dmitry Kasatkin
initialization script can initialize EVM key, update the IMA policy and change further requirement of everything to be signed. Changes in v2: * policy change of this patch separated from the key loading patch Signed-off-by: Dmitry Kasatkin --- security/integrity/ima/Kconfig | 7 +++ security

[PATCH v3 3/6] ima: load x509 certificate from the kernel

2014-10-10 Thread Dmitry Kasatkin
Signed-off-by: Dmitry Kasatkin --- security/integrity/ima/Kconfig| 15 +++ security/integrity/ima/ima_init.c | 17 + security/integrity/integrity.h| 8 3 files changed, 40 insertions(+) diff --git a/security/integrity/ima/Kconfig b/security/integrity

[PATCH v3 1/6] integrity: provide integrity_read_file()

2014-10-10 Thread Dmitry Kasatkin
as '__init' Signed-off-by: Dmitry Kasatkin --- security/integrity/iint.c | 78 + security/integrity/ima/ima_crypto.c | 35 ++--- security/integrity/integrity.h | 4 ++ 3 files changed, 85 insertions(+), 32 deletions(-) diff --git a/security

[PATCH v3 3/6] ima: load x509 certificate from the kernel

2014-10-10 Thread Dmitry Kasatkin
Signed-off-by: Dmitry Kasatkin d.kasat...@samsung.com --- security/integrity/ima/Kconfig| 15 +++ security/integrity/ima/ima_init.c | 17 + security/integrity/integrity.h| 8 3 files changed, 40 insertions(+) diff --git a/security/integrity/ima

[PATCH v3 1/6] integrity: provide integrity_read_file()

2014-10-10 Thread Dmitry Kasatkin
as '__init' Signed-off-by: Dmitry Kasatkin d.kasat...@samsung.com --- security/integrity/iint.c | 78 + security/integrity/ima/ima_crypto.c | 35 ++--- security/integrity/integrity.h | 4 ++ 3 files changed, 85 insertions(+), 32 deletions

[PATCH v3 5/6] ima: require signature based appraisal

2014-10-10 Thread Dmitry Kasatkin
initialization script can initialize EVM key, update the IMA policy and change further requirement of everything to be signed. Changes in v2: * policy change of this patch separated from the key loading patch Signed-off-by: Dmitry Kasatkin d.kasat...@samsung.com --- security/integrity/ima/Kconfig | 7

[PATCH v3 6/6] VFS: refactor vfs_read()

2014-10-10 Thread Dmitry Kasatkin
integrity_kernel_read() duplicates the file read operations code in vfs_read(). This patch refactors vfs_read() code creating a helper function __vfs_read(). It is used by both vfs_read() and integrity_kernel_read(). Signed-off-by: Dmitry Kasatkin d.kasat...@samsung.com --- fs/read_write.c

[PATCH v3 2/6] integrity: provide x509 certificate loading from the kernel

2014-10-10 Thread Dmitry Kasatkin
Provide function to load x509 certificates from the kernel into the integrity kernel keyrings. Changes in v2: * configuration option removed * function declared as '__init' Signed-off-by: Dmitry Kasatkin d.kasat...@samsung.com --- security/integrity/digsig.c| 37

Re: [PATCH v1 0/4] ima: require signed user-space initialization

2014-10-10 Thread Dmitry Kasatkin
Hello Andrew, I have just posted updated patchset. Please check patch description where I discuss your questions and related changes. Thanks, Dmitry On 30/07/14 00:37, Dmitry Kasatkin wrote: On Wed, Jul 23, 2014 at 9:08 PM, Mimi Zohar zo...@linux.vnet.ibm.com wrote: On Wed, 2014-07-16 at 23

[PATCH v3 0/6] ima: provide signature based 'init' appraisal

2014-10-10 Thread Dmitry Kasatkin
enabled. -Dmitry Dmitry Kasatkin (6): integrity: provide integrity_read_file() integrity: provide x509 certificate loading from the kernel ima: load x509 certificate from the kernel integrity: provide hook to load keys when rootfs is ready ima: require signature based appraisal VFS

[PATCH v3 4/6] integrity: provide hook to load keys when rootfs is ready

2014-10-10 Thread Dmitry Kasatkin
-by: Dmitry Kasatkin d.kasat...@samsung.com --- include/linux/integrity.h | 6 ++ init/main.c | 6 +- security/integrity/iint.c | 11 +++ 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/include/linux/integrity.h b/include/linux/integrity.h index 83222ce..c2d6082

Re: [PATCH v2 02/17] security: make security_file_set_fowner, f_setown and __f_setown void return

2014-10-07 Thread Dmitry Kasatkin
On 7 October 2014 20:17, Christoph Hellwig wrote: > On Tue, Oct 07, 2014 at 08:11:42PM +0300, Dmitry Kasatkin wrote: >> If file_set_fowner op is now type of "void", how you can actually >> return the value? >> I think compiler must give error. How could you compil

Re: [PATCH v2 02/17] security: make security_file_set_fowner, f_setown and __f_setown void return

2014-10-07 Thread Dmitry Kasatkin
On 4 September 2014 15:38, Jeff Layton wrote: > security_file_set_fowner always returns 0, so make it f_setown and > __f_setown void return functions and fix up the error handling in the > callers. > > Cc: linux-security-mod...@vger.kernel.org > Cc: Christoph Hellwig > Signed-off-by: Jeff Layton

Re: [PATCH v2 02/17] security: make security_file_set_fowner, f_setown and __f_setown void return

2014-10-07 Thread Dmitry Kasatkin
On 4 September 2014 15:38, Jeff Layton jlay...@primarydata.com wrote: security_file_set_fowner always returns 0, so make it f_setown and __f_setown void return functions and fix up the error handling in the callers. Cc: linux-security-mod...@vger.kernel.org Cc: Christoph Hellwig

Re: [PATCH v2 02/17] security: make security_file_set_fowner, f_setown and __f_setown void return

2014-10-07 Thread Dmitry Kasatkin
On 7 October 2014 20:17, Christoph Hellwig h...@infradead.org wrote: On Tue, Oct 07, 2014 at 08:11:42PM +0300, Dmitry Kasatkin wrote: If file_set_fowner op is now type of void, how you can actually return the value? I think compiler must give error. How could you compile it? Returning void

Re: [PATCH 3/4] module: search the key only by keyid

2014-10-06 Thread Dmitry Kasatkin
On 06/10/14 15:44, James Morris wrote: > On Fri, 3 Oct 2014, David Howells wrote: > >> Dmitry Kasatkin wrote: >> >>> BTW. But actually why signer is needed to find the key? >>> Every key has unique fingerprint. >> The SKID is by no means guaranteed uniqu

Re: [PATCH 0/3] MODSIGN: Use PKCS#7 cert to avoid SKIDs

2014-10-06 Thread Dmitry Kasatkin
Hi David, I just applied these 3 patches, but got build problems.. sign-file.c cannot be build. Log attached... Any ideas? Thanks - Dmitry On 03/10/14 17:30, David Howells wrote: > Hi Rusty, > > In the current module signing code, we try to use the subject and subjKeyId > fields from X.509

Re: [PATCH 0/3] MODSIGN: Use PKCS#7 cert to avoid SKIDs

2014-10-06 Thread Dmitry Kasatkin
Hi David, I just applied these 3 patches, but got build problems.. sign-file.c cannot be build. Log attached... Any ideas? Thanks - Dmitry On 03/10/14 17:30, David Howells wrote: Hi Rusty, In the current module signing code, we try to use the subject and subjKeyId fields from X.509

Re: [PATCH 3/4] module: search the key only by keyid

2014-10-06 Thread Dmitry Kasatkin
On 06/10/14 15:44, James Morris wrote: On Fri, 3 Oct 2014, David Howells wrote: Dmitry Kasatkin d.kasat...@samsung.com wrote: BTW. But actually why signer is needed to find the key? Every key has unique fingerprint. The SKID is by no means guaranteed unique, is not mandatory and has

Re: [PATCH 3/4] module: search the key only by keyid

2014-10-03 Thread Dmitry Kasatkin
On 03/10/14 16:40, David Howells wrote: > Dmitry Kasatkin wrote: > >> BTW. But actually why signer is needed to find the key? >> Every key has unique fingerprint. > The SKID is by no means guaranteed unique, is not mandatory and has no defined > algorithm for generating i

Re: [PATCH 3/4] module: search the key only by keyid

2014-10-03 Thread Dmitry Kasatkin
On 03/10/14 15:53, Dmitry Kasatkin wrote: > On 03/10/14 15:49, Dmitry Kasatkin wrote: >> On 03/10/14 15:46, David Howells wrote: >>> Dmitry Kasatkin wrote: >>> >>>> Latest KEYS code change the way keys identified and module >>>> signi

Re: [PATCH 3/4] module: search the key only by keyid

2014-10-03 Thread Dmitry Kasatkin
On 03/10/14 15:49, Dmitry Kasatkin wrote: > On 03/10/14 15:46, David Howells wrote: >> Dmitry Kasatkin wrote: >> >>> Latest KEYS code change the way keys identified and module >>> signing keys are not searchable anymore with original id. >>> >>>

Re: [PATCH 3/4] module: search the key only by keyid

2014-10-03 Thread Dmitry Kasatkin
On 03/10/14 15:46, David Howells wrote: > Dmitry Kasatkin wrote: > >> Latest KEYS code change the way keys identified and module >> signing keys are not searchable anymore with original id. >> >> This patch fixes this problem without change module signature &g

Re: [PATCH 08/13] KEYS: Overhaul key identification when searching for asymmetric keys

2014-10-03 Thread Dmitry Kasatkin
On 03/10/14 15:13, David Howells wrote: > Dmitry Kasatkin wrote: > >> [ 132.820302] CR2: ffea > Looks like I leaked an error number somewhere. > > David > Yes... I found.. Check patches I posted. Also here http://git.kernel.org/cgit/linux/kernel/git/kasatkin

Re: [PATCH 08/13] KEYS: Overhaul key identification when searching for asymmetric keys

2014-10-03 Thread Dmitry Kasatkin
On 03/10/14 15:12, David Howells wrote: > Dmitry Kasatkin wrote: > >> Also I noticed that output of 'keyctl show' and 'cat /proc/keys' output >> also has changed in respect of certificate ids.. >> >> Those ids does not look any close to my kernel X509 X509v3 Su

[PATCH v2 4/4] ima: use atomic bit operations to protect policy update interface

2014-10-03 Thread Dmitry Kasatkin
sysfs entry as in original design Signed-off-by: Dmitry Kasatkin --- security/integrity/ima/ima_fs.c | 23 --- security/integrity/ima/ima_policy.c | 23 ++- 2 files changed, 18 insertions(+), 28 deletions(-) diff --git a/security/integrity/ima/ima_fs.c b

[PATCH v2 2/4] ima: no need to allocate entry for comment

2014-10-03 Thread Dmitry Kasatkin
If rule is a comment, there is no need to allocate entry. Move checking for comment before allocating entry. Signed-off-by: Dmitry Kasatkin --- security/integrity/ima/ima_policy.c | 14 ++ 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/security/integrity/ima

[PATCH v2 0/4] ima: few policy loading improvements

2014-10-03 Thread Dmitry Kasatkin
Hi, Here is few policy loading interface improvements. Refer to the patches descriptions for details. - Dmitry Dmitry Kasatkin (4): ima: report policy load status ima: no need to allocate entry for comment ima: ignore empty and with whitespaces policy lines ima: use atomic bit

[PATCH v2 3/4] ima: ignore empty and with whitespaces policy lines

2014-10-03 Thread Dmitry Kasatkin
Empty policy lines cause parsing failures which is, especially for new users, hard to spot. This patch prevents it. It is now possible to 'cat policy > /ima/policy'. Changes in v2: * strip leading blanks and tabs in rules to prevent parsing failures Signed-off-by: Dmitry Kasatkin --- secur

[PATCH v2 1/4] ima: report policy load status

2014-10-03 Thread Dmitry Kasatkin
Audit messages are rate limited and often policy update info is not visible. Report policy loading status also using pr_info. Changes in v2: * reporting moved to ima_release_policy to notice parsing errors * reporting both completed and failed status Signed-off-by: Dmitry Kasatkin --- security

Re: [PATCH 0/4] KEYS fixes

2014-10-03 Thread Dmitry Kasatkin
Hi David, I slightly update what I posted and added one fix and one suggestion on the top. Here is those patches on the top of Jame's tree... http://git.kernel.org/cgit/linux/kernel/git/kasatkin/linux-digsig.git/log/?h=keys-fixes - Dmitry On 03/10/14 12:09, Dmitry Kasatkin wrote: > I repor

[PATCH 3/4] module: search the key only by keyid

2014-10-03 Thread Dmitry Kasatkin
Latest KEYS code change the way keys identified and module signing keys are not searchable anymore with original id. This patch fixes this problem without change module signature data. Signed-off-by: Dmitry Kasatkin --- kernel/module_signing.c | 16 +--- 1 file changed, 5

[PATCH 0/4] KEYS fixes

2014-10-03 Thread Dmitry Kasatkin
I reported yesterday problems with new KEYS. Module signature verification is broken, integrity subsystem verification is broken, kernel oopses. Here is few fixes. - Dmitry Dmitry Kasatkin (4): KEYS: handle error code encoded in pointer KEYS: provide pure subject key identifier (fingerprint

[PATCH 1/4] KEYS: handle error code encoded in pointer

2014-10-03 Thread Dmitry Kasatkin
] [] ima_appraise_measurement+0x160/0x370 [ 132.820302] [] ? d_absolute_path+0x5b/0x7a [ 132.820302] [] process_measurement+0x322/0x404 Reported-by: Dmitry Kasatkin Signed-off-by: Dmitry Kasatkin --- crypto/asymmetric_keys/asymmetric_type.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff

[PATCH 4/4] integrity: do zero padding of the key id

2014-10-03 Thread Dmitry Kasatkin
Latest KEYS code return error if hexadecimal string length id odd. Fix it. Signed-off-by: Dmitry Kasatkin --- security/integrity/digsig_asymmetric.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/integrity/digsig_asymmetric.c b/security/integrity

[PATCH 2/4] KEYS: provide pure subject key identifier (fingerprint) as key id

2014-10-03 Thread Dmitry Kasatkin
Earlier KEYs code used pure subject key identifies for searching keys. Latest merged code removed that and broke compatibility with integrity subsytem signatures and original format of module signatures. This patch returns back fingerprint and partial matching. Reported-by: Dmitry Kasatkin

[PATCH 2/4] KEYS: provide pure subject key identifier (fingerprint) as key id

2014-10-03 Thread Dmitry Kasatkin
Earlier KEYs code used pure subject key identifies for searching keys. Latest merged code removed that and broke compatibility with integrity subsytem signatures and original format of module signatures. This patch returns back fingerprint and partial matching. Reported-by: Dmitry Kasatkin

[PATCH 4/4] integrity: do zero padding of the key id

2014-10-03 Thread Dmitry Kasatkin
Latest KEYS code return error if hexadecimal string length id odd. Fix it. Signed-off-by: Dmitry Kasatkin d.kasat...@samsung.com --- security/integrity/digsig_asymmetric.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/integrity/digsig_asymmetric.c b/security

[PATCH 1/4] KEYS: handle error code encoded in pointer

2014-10-03 Thread Dmitry Kasatkin
+0x6a/0x7a [ 132.820302] [812b0390] ima_appraise_measurement+0x160/0x370 [ 132.820302] [81161db2] ? d_absolute_path+0x5b/0x7a [ 132.820302] [812ada30] process_measurement+0x322/0x404 Reported-by: Dmitry Kasatkin d.kasat...@samsung.com Signed-off-by: Dmitry Kasatkin d.kasat

[PATCH 0/4] KEYS fixes

2014-10-03 Thread Dmitry Kasatkin
I reported yesterday problems with new KEYS. Module signature verification is broken, integrity subsystem verification is broken, kernel oopses. Here is few fixes. - Dmitry Dmitry Kasatkin (4): KEYS: handle error code encoded in pointer KEYS: provide pure subject key identifier (fingerprint

[PATCH 3/4] module: search the key only by keyid

2014-10-03 Thread Dmitry Kasatkin
Latest KEYS code change the way keys identified and module signing keys are not searchable anymore with original id. This patch fixes this problem without change module signature data. Signed-off-by: Dmitry Kasatkin d.kasat...@samsung.com --- kernel/module_signing.c | 16 +--- 1

Re: [PATCH 0/4] KEYS fixes

2014-10-03 Thread Dmitry Kasatkin
Hi David, I slightly update what I posted and added one fix and one suggestion on the top. Here is those patches on the top of Jame's tree... http://git.kernel.org/cgit/linux/kernel/git/kasatkin/linux-digsig.git/log/?h=keys-fixes - Dmitry On 03/10/14 12:09, Dmitry Kasatkin wrote: I reported

[PATCH v2 1/4] ima: report policy load status

2014-10-03 Thread Dmitry Kasatkin
Audit messages are rate limited and often policy update info is not visible. Report policy loading status also using pr_info. Changes in v2: * reporting moved to ima_release_policy to notice parsing errors * reporting both completed and failed status Signed-off-by: Dmitry Kasatkin d.kasat

[PATCH v2 0/4] ima: few policy loading improvements

2014-10-03 Thread Dmitry Kasatkin
Hi, Here is few policy loading interface improvements. Refer to the patches descriptions for details. - Dmitry Dmitry Kasatkin (4): ima: report policy load status ima: no need to allocate entry for comment ima: ignore empty and with whitespaces policy lines ima: use atomic bit

[PATCH v2 3/4] ima: ignore empty and with whitespaces policy lines

2014-10-03 Thread Dmitry Kasatkin
Empty policy lines cause parsing failures which is, especially for new users, hard to spot. This patch prevents it. It is now possible to 'cat policy securityfs/ima/policy'. Changes in v2: * strip leading blanks and tabs in rules to prevent parsing failures Signed-off-by: Dmitry Kasatkin

[PATCH v2 2/4] ima: no need to allocate entry for comment

2014-10-03 Thread Dmitry Kasatkin
If rule is a comment, there is no need to allocate entry. Move checking for comment before allocating entry. Signed-off-by: Dmitry Kasatkin d.kasat...@samsung.com --- security/integrity/ima/ima_policy.c | 14 ++ 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/security

[PATCH v2 4/4] ima: use atomic bit operations to protect policy update interface

2014-10-03 Thread Dmitry Kasatkin
sysfs entry as in original design Signed-off-by: Dmitry Kasatkin d.kasat...@samsung.com --- security/integrity/ima/ima_fs.c | 23 --- security/integrity/ima/ima_policy.c | 23 ++- 2 files changed, 18 insertions(+), 28 deletions(-) diff --git a/security

Re: [PATCH 08/13] KEYS: Overhaul key identification when searching for asymmetric keys

2014-10-03 Thread Dmitry Kasatkin
On 03/10/14 15:12, David Howells wrote: Dmitry Kasatkin d.kasat...@samsung.com wrote: Also I noticed that output of 'keyctl show' and 'cat /proc/keys' output also has changed in respect of certificate ids.. Those ids does not look any close to my kernel X509 X509v3 Subject Key Identifier

Re: [PATCH 08/13] KEYS: Overhaul key identification when searching for asymmetric keys

2014-10-03 Thread Dmitry Kasatkin
On 03/10/14 15:13, David Howells wrote: Dmitry Kasatkin d.kasat...@samsung.com wrote: [ 132.820302] CR2: ffea Looks like I leaked an error number somewhere. David Yes... I found.. Check patches I posted. Also here http://git.kernel.org/cgit/linux/kernel/git/kasatkin/linux

Re: [PATCH 3/4] module: search the key only by keyid

2014-10-03 Thread Dmitry Kasatkin
On 03/10/14 15:46, David Howells wrote: Dmitry Kasatkin d.kasat...@samsung.com wrote: Latest KEYS code change the way keys identified and module signing keys are not searchable anymore with original id. This patch fixes this problem without change module signature data. This isn't

Re: [PATCH 3/4] module: search the key only by keyid

2014-10-03 Thread Dmitry Kasatkin
On 03/10/14 15:49, Dmitry Kasatkin wrote: On 03/10/14 15:46, David Howells wrote: Dmitry Kasatkin d.kasat...@samsung.com wrote: Latest KEYS code change the way keys identified and module signing keys are not searchable anymore with original id. This patch fixes this problem without change

Re: [PATCH 3/4] module: search the key only by keyid

2014-10-03 Thread Dmitry Kasatkin
On 03/10/14 15:53, Dmitry Kasatkin wrote: On 03/10/14 15:49, Dmitry Kasatkin wrote: On 03/10/14 15:46, David Howells wrote: Dmitry Kasatkin d.kasat...@samsung.com wrote: Latest KEYS code change the way keys identified and module signing keys are not searchable anymore with original id

Re: [PATCH 3/4] module: search the key only by keyid

2014-10-03 Thread Dmitry Kasatkin
On 03/10/14 16:40, David Howells wrote: Dmitry Kasatkin d.kasat...@samsung.com wrote: BTW. But actually why signer is needed to find the key? Every key has unique fingerprint. The SKID is by no means guaranteed unique, is not mandatory and has no defined algorithm for generating it. SKID

Re: [PATCH 08/13] KEYS: Overhaul key identification when searching for asymmetric keys

2014-10-02 Thread Dmitry Kasatkin
On 2 October 2014 19:04, Dmitry Kasatkin wrote: > On 02/10/14 18:49, Dmitry Kasatkin wrote: >> Hi David, >> >> I just took latest #next branch from James's security tree which >> includes latest KEYs patches and noticed following: >> >> [9.812332] Re

Re: [PATCH 08/13] KEYS: Overhaul key identification when searching for asymmetric keys

2014-10-02 Thread Dmitry Kasatkin
On 02/10/14 18:49, Dmitry Kasatkin wrote: > Hi David, > > I just took latest #next branch from James's security tree which > includes latest KEYs patches and noticed following: > > [9.812332] Request for unknown module key 'Magrathea: Gla

Re: [PATCH 08/13] KEYS: Overhaul key identification when searching for asymmetric keys

2014-10-02 Thread Dmitry Kasatkin
Hi David, I just took latest #next branch from James's security tree which includes latest KEYs patches and noticed following: [9.812332] Request for unknown module key 'Magrathea: Glacier signing key: 926305d6dda66f47139eb4e3cb25a6adef527f08' err -11 Also I noticed that output of 'keyctl

<    1   2   3   4   5   6   7   8   >