Re: [PATCH v2 5/7] selinux: Add support for unprivileged mounts from user namespaces

2015-10-13 Thread Stephen Smalley
task context into a form suitable for file objects, but also allow the policy writer to specify a different label through policy transition rules. Pieced together from code snippets provided by Stephen Smalley. Signed-off-by: Seth Forshee <seth.fors...@canonical.com> Acked-by: Stephen S

Re: [PATCH] security: selinux: Use a kmem_cache for allocation struct file_security_struct

2015-10-07 Thread Stephen Smalley
e | Slack Size | Allocation Count > --- > 770048 |192512| 577536 | 12032 > > At the result, this change reduce memory usage 42bytes per each > file_security_struct > > Signed-off-by: Sangwoo Acked-by: Stephen Smalley

Re: [PATCH] security: selinux: Use a kmem_cache for allocation struct file_security_struct

2015-10-07 Thread Stephen Smalley
e | Slack Size | Allocation Count > --- > 770048 |192512| 577536 | 12032 > > At the result, this change reduce memory usage 42bytes per each > file_security_struct > > Signed-off-by: Sangwoo <sangwoo2.p...

Re: [PATCH v2 1/2] security: Add hook to invalidate inode security labels

2015-10-06 Thread Stephen Smalley
On 10/05/2015 05:56 PM, Andreas Gruenbacher wrote: > On Mon, Oct 5, 2015 at 5:08 PM, Stephen Smalley wrote: >> Not fond of these magic initialized values. > > That should be a solvable problem. > >> Is it always safe to call inode_doinit() from all callers of >>

Re: [PATCH v2] x86/mm: warn on W+x mappings

2015-10-06 Thread Stephen Smalley
On 10/06/2015 03:32 AM, Ingo Molnar wrote: > > * Stephen Smalley wrote: > >> On 10/03/2015 07:27 AM, Ingo Molnar wrote: >>> >>> * Stephen Smalley wrote: >>> >>>> diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c >>>&

[tip:x86/mm] x86/mm: Warn on W^X mappings

2015-10-06 Thread tip-bot for Stephen Smalley
Commit-ID: e1a58320a38dfa72be48a0f1a3a92273663ba6db Gitweb: http://git.kernel.org/tip/e1a58320a38dfa72be48a0f1a3a92273663ba6db Author: Stephen Smalley AuthorDate: Mon, 5 Oct 2015 12:55:20 -0400 Committer: Ingo Molnar CommitDate: Tue, 6 Oct 2015 11:11:48 +0200 x86/mm: Warn on W^X

Re: [PATCH v2] x86/mm: warn on W+x mappings

2015-10-06 Thread Stephen Smalley
On 10/06/2015 03:32 AM, Ingo Molnar wrote: > > * Stephen Smalley <s...@tycho.nsa.gov> wrote: > >> On 10/03/2015 07:27 AM, Ingo Molnar wrote: >>> >>> * Stephen Smalley <s...@tycho.nsa.gov> wrote: >>> >>>> diff --git a/arch/x8

Re: [PATCH v2 1/2] security: Add hook to invalidate inode security labels

2015-10-06 Thread Stephen Smalley
On 10/05/2015 05:56 PM, Andreas Gruenbacher wrote: > On Mon, Oct 5, 2015 at 5:08 PM, Stephen Smalley <s...@tycho.nsa.gov> wrote: >> Not fond of these magic initialized values. > > That should be a solvable problem. > >> Is it always safe to call i

[tip:x86/mm] x86/mm: Warn on W^X mappings

2015-10-06 Thread tip-bot for Stephen Smalley
Commit-ID: e1a58320a38dfa72be48a0f1a3a92273663ba6db Gitweb: http://git.kernel.org/tip/e1a58320a38dfa72be48a0f1a3a92273663ba6db Author: Stephen Smalley <s...@tycho.nsa.gov> AuthorDate: Mon, 5 Oct 2015 12:55:20 -0400 Committer: Ingo Molnar <mi...@kernel.org> CommitDate: Tue, 6

Re: [PATCH v2] x86/mm: warn on W+x mappings

2015-10-05 Thread Stephen Smalley
On 10/03/2015 07:27 AM, Ingo Molnar wrote: > > * Stephen Smalley wrote: > >> diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c >> index 30564e2..f8b1573 100644 >> --- a/arch/x86/mm/init_64.c >> +++ b/arch/x86/mm/init_64.c >> @@ -115

[PATCH v3] x86/mm: warn on W+x mappings

2015-10-05 Thread Stephen Smalley
[] ptdump_walk_pgd_level_checkwx+0x17/0x20 [] mark_rodata_ro+0xf5/0x100 [] ? rest_init+0x80/0x80 [] kernel_init+0x1d/0xe0 [] ret_from_fork+0x3f/0x70 [] ? rest_init+0x80/0x80 ---[ end trace a1f23a1e42a2ac76 ]--- x86/mm: Checked W+X mappings: FAILED, 171 W+X pages found. Signed-off-by: Stephen

Re: [PATCH v2 1/2] security: Add hook to invalidate inode security labels

2015-10-05 Thread Stephen Smalley
Gruenbacher Cc: Paul Moore Cc: Stephen Smalley Cc: Eric Paris Cc: seli...@tycho.nsa.gov --- include/linux/lsm_hooks.h | 6 ++ include/linux/security.h | 5 + security/security.c | 8 security/selinux/hooks.c | 23

Re: [PATCH v2] x86/mm: warn on W+x mappings

2015-10-05 Thread Stephen Smalley
On 10/03/2015 07:27 AM, Ingo Molnar wrote: > > * Stephen Smalley <s...@tycho.nsa.gov> wrote: > >> diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c >> index 30564e2..f8b1573 100644 >> --- a/arch/x86/mm/init_64.c >> +++ b/arch/x86/mm/init_64.c >&

Re: [PATCH v2 1/2] security: Add hook to invalidate inode security labels

2015-10-05 Thread Stephen Smalley
Gruenbacher <agrue...@redhat.com> Cc: Paul Moore <p...@paul-moore.com> Cc: Stephen Smalley <s...@tycho.nsa.gov> Cc: Eric Paris <epa...@parisplace.org> Cc: seli...@tycho.nsa.gov --- include/linux/lsm_hooks.h | 6 ++ include/linux/security.h | 5 +++

[PATCH v3] x86/mm: warn on W+x mappings

2015-10-05 Thread Stephen Smalley
[] ptdump_walk_pgd_level_checkwx+0x17/0x20 [] mark_rodata_ro+0xf5/0x100 [] ? rest_init+0x80/0x80 [] kernel_init+0x1d/0xe0 [] ret_from_fork+0x3f/0x70 [] ? rest_init+0x80/0x80 ---[ end trace a1f23a1e42a2ac76 ]--- x86/mm: Checked W+X mappings: FAILED, 171 W+X pages found. Signed-off-by: Stephen

[PATCH v2] x86/mm: warn on W+x mappings

2015-10-02 Thread Stephen Smalley
[] ptdump_walk_pgd_level_checkwx+0x17/0x20 [] mark_rodata_ro+0xf5/0x100 [] ? rest_init+0x80/0x80 [] kernel_init+0x1d/0xe0 [] ret_from_fork+0x3f/0x70 [] ? rest_init+0x80/0x80 ---[ end trace a1f23a1e42a2ac76 ]--- x86/mm: Checked W+X mappings: FAILED, 171 W+X pages found. Signed-off-by: Stephen

[tip:x86/urgent] x86/mm: Set NX on gap between __ex_table and rodata

2015-10-02 Thread tip-bot for Stephen Smalley
Commit-ID: ab76f7b4ab2397ffdd2f1eb07c55697d19991d10 Gitweb: http://git.kernel.org/tip/ab76f7b4ab2397ffdd2f1eb07c55697d19991d10 Author: Stephen Smalley AuthorDate: Thu, 1 Oct 2015 09:04:22 -0400 Committer: Ingo Molnar CommitDate: Fri, 2 Oct 2015 09:21:06 +0200 x86/mm: Set NX on gap

[PATCH v2] x86/mm: warn on W+x mappings

2015-10-02 Thread Stephen Smalley
[] ptdump_walk_pgd_level_checkwx+0x17/0x20 [] mark_rodata_ro+0xf5/0x100 [] ? rest_init+0x80/0x80 [] kernel_init+0x1d/0xe0 [] ret_from_fork+0x3f/0x70 [] ? rest_init+0x80/0x80 ---[ end trace a1f23a1e42a2ac76 ]--- x86/mm: Checked W+X mappings: FAILED, 171 W+X pages found. Signed-off-by: Stephen

[tip:x86/urgent] x86/mm: Set NX on gap between __ex_table and rodata

2015-10-02 Thread tip-bot for Stephen Smalley
Commit-ID: ab76f7b4ab2397ffdd2f1eb07c55697d19991d10 Gitweb: http://git.kernel.org/tip/ab76f7b4ab2397ffdd2f1eb07c55697d19991d10 Author: Stephen Smalley <s...@tycho.nsa.gov> AuthorDate: Thu, 1 Oct 2015 09:04:22 -0400 Committer: Ingo Molnar <mi...@kernel.org> CommitDate: Fri, 2

[RFC][PATCH] x86/mm: warn on W+x mappings

2015-10-01 Thread Stephen Smalley
Warn on any residual W+x mappings if X86_PTDUMP is enabled. Sample dmesg output: Checking for W+x mappings 0x81755000-0x8180 684K RW GLB x pte Found W+x mappings. Please fix. Signed-off-by: Stephen Smalley --- Not sure if this is the best place

[PATCH] x86/mm: Set NX on gap between __ex_table and rodata

2015-10-01 Thread Stephen Smalley
478M pmd Signed-off-by: Stephen Smalley --- arch/x86/mm/init_64.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c index 30564e2..df48430 100644 --- a/arch/x86/mm/init_64.c +++ b/arch/x86/mm/init_64.c

[PATCH] x86/mm: Set NX on gap between __ex_table and rodata

2015-10-01 Thread Stephen Smalley
478M pmd Signed-off-by: Stephen Smalley <s...@tycho.nsa.gov> --- arch/x86/mm/init_64.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c index 30564e2..df48430 100644 --- a/arch/x86/mm/init_64.c

[RFC][PATCH] x86/mm: warn on W+x mappings

2015-10-01 Thread Stephen Smalley
Warn on any residual W+x mappings if X86_PTDUMP is enabled. Sample dmesg output: Checking for W+x mappings 0x81755000-0x8180 684K RW GLB x pte Found W+x mappings. Please fix. Signed-off-by: Stephen Smalley <s...@tycho.nsa.gov> --- No

Re: [PATCH 0/5] Security: Provide unioned file support

2015-09-30 Thread Stephen Smalley
On 09/29/2015 05:03 PM, Stephen Smalley wrote: On 09/28/2015 04:00 PM, David Howells wrote: The attached patches provide security support for unioned files where the security involves an object-label-based LSM (such as SELinux) rather than a path-based LSM. [Note that a number of the bits

Re: [PATCH 0/5] Security: Provide unioned file support

2015-09-30 Thread Stephen Smalley
On 09/29/2015 05:03 PM, Stephen Smalley wrote: On 09/28/2015 04:00 PM, David Howells wrote: The attached patches provide security support for unioned files where the security involves an object-label-based LSM (such as SELinux) rather than a path-based LSM. [Note that a number of the bits

Re: [PATCH 0/5] Security: Provide unioned file support

2015-09-29 Thread Stephen Smalley
) in file_has_perm() rather than using the label on the lower inode. Now the steps I have outlined in (b) and (c) seem to be at odds with what Dan Walsh and Stephen Smalley want - but I'm not sure I follow what that is, let alone how to do it: Wanted to bring back the original

Re: [PATCH 1/2] selinux: ioctl_has_perm should be static

2015-09-29 Thread Stephen Smalley
On 09/27/2015 11:10 AM, Geliang Tang wrote: Fixes the following sparse warning: security/selinux/hooks.c:3242:5: warning: symbol 'ioctl_has_perm' was not declared. Should it be static? Signed-off-by: Geliang Tang Acked-by: Stephen Smalley --- security/selinux/hooks.c | 2 +- 1

Re: [PATCH 5/5] selinux: use sprintf return value

2015-09-29 Thread Stephen Smalley
On 09/25/2015 06:34 PM, Rasmus Villemoes wrote: sprintf returns the number of characters printed (excluding '\0'), so we can use that and avoid duplicating the length computation. Signed-off-by: Rasmus Villemoes Acked-by: Stephen Smalley --- security/selinux/ss/services.c | 5 + 1

Re: [PATCH 4/5] selinux: use kstrdup() in security_get_bools()

2015-09-29 Thread Stephen Smalley
On 09/25/2015 06:34 PM, Rasmus Villemoes wrote: This is much simpler. Signed-off-by: Rasmus Villemoes Acked-by: Stephen Smalley --- security/selinux/ss/services.c | 8 +--- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/security/selinux/ss/services.c b/security

Re: [PATCH 3/5] selinux: use kmemdup in security_sid_to_context_core()

2015-09-29 Thread Stephen Smalley
On 09/25/2015 06:34 PM, Rasmus Villemoes wrote: Signed-off-by: Rasmus Villemoes Acked-by: Stephen Smalley --- security/selinux/ss/services.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/security/selinux/ss/services.c b/security/selinux/ss/services.c index

Re: [PATCH 2/5] selinux: remove pointless cast in selinux_inode_setsecurity()

2015-09-29 Thread Stephen Smalley
On 09/25/2015 06:34 PM, Rasmus Villemoes wrote: security_context_to_sid() expects a const char* argument, so there's no point in casting away the const qualifier of value. Signed-off-by: Rasmus Villemoes Acked-by: Stephen Smalley --- security/selinux/hooks.c | 2 +- 1 file changed, 1

Re: [PATCH 1/5] selinux: introduce security_context_str_to_sid

2015-09-29 Thread Stephen Smalley
copying and the test for scontext_len being zero hint at that). Introduce the helper security_context_str_to_sid() to do the strlen() call and fix all callers. Signed-off-by: Rasmus Villemoes Acked-by: Stephen Smalley --- security/selinux/hooks.c| 12 security

Re: [PATCH 0/5] selinux: minor cleanup suggestions

2015-09-29 Thread Stephen Smalley
On 09/25/2015 06:34 PM, Rasmus Villemoes wrote: A few random things I stumbled on. While I'm pretty sure of the change in 1/5, I'm also confused, because the doc for the reverse security_sid_to_context state that @scontext_len is set to "the length of the string", which one would normally

Re: [PATCH 0/5] Security: Provide unioned file support

2015-09-29 Thread Stephen Smalley
) in file_has_perm() rather than using the label on the lower inode. Now the steps I have outlined in (b) and (c) seem to be at odds with what Dan Walsh and Stephen Smalley want - but I'm not sure I follow what that is, let alone how to do it: Wanted to bring back the original

Re: [PATCH 4/5] selinux: use kstrdup() in security_get_bools()

2015-09-29 Thread Stephen Smalley
On 09/25/2015 06:34 PM, Rasmus Villemoes wrote: This is much simpler. Signed-off-by: Rasmus Villemoes <li...@rasmusvillemoes.dk> Acked-by: Stephen Smalley <s...@tycho.nsa.gov> --- security/selinux/ss/services.c | 8 +--- 1 file changed, 1 insertion(+), 7 deletions(-)

Re: [PATCH 1/5] selinux: introduce security_context_str_to_sid

2015-09-29 Thread Stephen Smalley
copying and the test for scontext_len being zero hint at that). Introduce the helper security_context_str_to_sid() to do the strlen() call and fix all callers. Signed-off-by: Rasmus Villemoes <li...@rasmusvillemoes.dk> Acked-by: Stephen Smalley <s...@tycho.nsa.gov> --- security/sel

Re: [PATCH 3/5] selinux: use kmemdup in security_sid_to_context_core()

2015-09-29 Thread Stephen Smalley
On 09/25/2015 06:34 PM, Rasmus Villemoes wrote: Signed-off-by: Rasmus Villemoes <li...@rasmusvillemoes.dk> Acked-by: Stephen Smalley <s...@tycho.nsa.gov> --- security/selinux/ss/services.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/securit

Re: [PATCH 5/5] selinux: use sprintf return value

2015-09-29 Thread Stephen Smalley
On 09/25/2015 06:34 PM, Rasmus Villemoes wrote: sprintf returns the number of characters printed (excluding '\0'), so we can use that and avoid duplicating the length computation. Signed-off-by: Rasmus Villemoes <li...@rasmusvillemoes.dk> Acked-by: Stephen Smalley <s...@tych

Re: [PATCH 0/5] selinux: minor cleanup suggestions

2015-09-29 Thread Stephen Smalley
On 09/25/2015 06:34 PM, Rasmus Villemoes wrote: A few random things I stumbled on. While I'm pretty sure of the change in 1/5, I'm also confused, because the doc for the reverse security_sid_to_context state that @scontext_len is set to "the length of the string", which one would normally

Re: [PATCH 2/5] selinux: remove pointless cast in selinux_inode_setsecurity()

2015-09-29 Thread Stephen Smalley
On 09/25/2015 06:34 PM, Rasmus Villemoes wrote: security_context_to_sid() expects a const char* argument, so there's no point in casting away the const qualifier of value. Signed-off-by: Rasmus Villemoes <li...@rasmusvillemoes.dk> Acked-by: Stephen Smalley <s...@tych

Re: [PATCH 1/2] selinux: ioctl_has_perm should be static

2015-09-29 Thread Stephen Smalley
On 09/27/2015 11:10 AM, Geliang Tang wrote: Fixes the following sparse warning: security/selinux/hooks.c:3242:5: warning: symbol 'ioctl_has_perm' was not declared. Should it be static? Signed-off-by: Geliang Tang <geliangt...@163.com> Acked-by: Stephen Smalley <s...@tych

Re: rwx mapping between ex_table and rodata

2015-09-28 Thread Stephen Smalley
On 09/24/2015 06:25 PM, Kees Cook wrote: > On Thu, Sep 24, 2015 at 1:26 PM, Stephen Smalley wrote: >> Hi, >> >> With the attached config and 4.3-rc2 on x86_64, I see the following in >> /sys/kernel/debug/kernel_page_tables: >> ... >> ---[ High Ke

Re: rwx mapping between ex_table and rodata

2015-09-28 Thread Stephen Smalley
On 09/24/2015 06:25 PM, Kees Cook wrote: > On Thu, Sep 24, 2015 at 1:26 PM, Stephen Smalley <s...@tycho.nsa.gov> wrote: >> Hi, >> >> With the attached config and 4.3-rc2 on x86_64, I see the following in >> /sys/kernel/debug/kernel_page_tables: &

Re: [PATCH 1/7] fs: Add user namesapace member to struct super_block

2015-08-06 Thread Stephen Smalley
On 08/06/2015 11:44 AM, Seth Forshee wrote: > On Thu, Aug 06, 2015 at 10:51:16AM -0400, Stephen Smalley wrote: >> On 08/06/2015 10:20 AM, Seth Forshee wrote: >>> On Wed, Aug 05, 2015 at 04:19:03PM -0500, Eric W. Biederman wrote: >>>> Seth Forshee writes: >>&g

Re: [PATCH 1/7] fs: Add user namesapace member to struct super_block

2015-08-06 Thread Stephen Smalley
On 08/06/2015 10:20 AM, Seth Forshee wrote: > On Wed, Aug 05, 2015 at 04:19:03PM -0500, Eric W. Biederman wrote: >> Seth Forshee writes: >> >>> On Wed, Jul 15, 2015 at 09:47:11PM -0500, Eric W. Biederman wrote: Seth Forshee writes: > Initially this will be used to eliminate the

Re: [PATCH 1/7] fs: Add user namesapace member to struct super_block

2015-08-06 Thread Stephen Smalley
On 08/06/2015 10:20 AM, Seth Forshee wrote: On Wed, Aug 05, 2015 at 04:19:03PM -0500, Eric W. Biederman wrote: Seth Forshee seth.fors...@canonical.com writes: On Wed, Jul 15, 2015 at 09:47:11PM -0500, Eric W. Biederman wrote: Seth Forshee seth.fors...@canonical.com writes: Initially this

Re: [PATCH 1/7] fs: Add user namesapace member to struct super_block

2015-08-06 Thread Stephen Smalley
On 08/06/2015 11:44 AM, Seth Forshee wrote: On Thu, Aug 06, 2015 at 10:51:16AM -0400, Stephen Smalley wrote: On 08/06/2015 10:20 AM, Seth Forshee wrote: On Wed, Aug 05, 2015 at 04:19:03PM -0500, Eric W. Biederman wrote: Seth Forshee seth.fors...@canonical.com writes: On Wed, Jul 15, 2015

Re: [PATCH 6/7] selinux: Ignore security labels on user namespace mounts

2015-07-30 Thread Stephen Smalley
On 07/24/2015 11:11 AM, Seth Forshee wrote: > On Thu, Jul 23, 2015 at 11:23:31AM -0500, Seth Forshee wrote: >> On Thu, Jul 23, 2015 at 11:36:03AM -0400, Stephen Smalley wrote: >>> On 07/23/2015 10:39 AM, Seth Forshee wrote: >>>> On Thu, Jul 23, 2015 at 09:57:20A

Re: [PATCH 6/7] selinux: Ignore security labels on user namespace mounts

2015-07-30 Thread Stephen Smalley
On 07/24/2015 11:11 AM, Seth Forshee wrote: On Thu, Jul 23, 2015 at 11:23:31AM -0500, Seth Forshee wrote: On Thu, Jul 23, 2015 at 11:36:03AM -0400, Stephen Smalley wrote: On 07/23/2015 10:39 AM, Seth Forshee wrote: On Thu, Jul 23, 2015 at 09:57:20AM -0400, Stephen Smalley wrote: On 07/22/2015

Re: [PATCH v2] ipc: Use private shmem or hugetlbfs inodes for shm segments.

2015-07-27 Thread Stephen Smalley
On 07/27/2015 03:32 PM, Hugh Dickins wrote: > On Fri, 24 Jul 2015, Stephen Smalley wrote: > >> The shm implementation internally uses shmem or hugetlbfs inodes >> for shm segments. As these inodes are never directly exposed to >> userspace and only accessed through

Re: [PATCH v2] ipc: Use private shmem or hugetlbfs inodes for shm segments.

2015-07-27 Thread Stephen Smalley
On 07/27/2015 03:32 PM, Hugh Dickins wrote: On Fri, 24 Jul 2015, Stephen Smalley wrote: The shm implementation internally uses shmem or hugetlbfs inodes for shm segments. As these inodes are never directly exposed to userspace and only accessed through the shm operations which are already

Re: [RFC][PATCH] ipc: Use private shmem or hugetlbfs inodes for shm segments.

2015-07-24 Thread Stephen Smalley
On 07/23/2015 08:11 PM, Dave Chinner wrote: > On Thu, Jul 23, 2015 at 12:28:33PM -0400, Stephen Smalley wrote: >> The shm implementation internally uses shmem or hugetlbfs inodes >> for shm segments. As these inodes are never directly exposed to >> userspace and only acc

[PATCH v2] ipc: Use private shmem or hugetlbfs inodes for shm segments.

2015-07-24 Thread Stephen Smalley
_64_fastpath+0x12/0x76 Reported-by: Morten Stevens Signed-off-by: Stephen Smalley --- This version only differs in the patch description, which restores the original lockdep trace from Morten Stevens. It was unfortunately mangled in the prior version. fs/hugetlbfs/inode.c | 2 ++ ipc/shm.c

[PATCH v2] ipc: Use private shmem or hugetlbfs inodes for shm segments.

2015-07-24 Thread Stephen Smalley
/0x180 Jul 22 14:36:40 fc23 kernel: [81386c25] SyS_shmdt+0xb5/0x180 Jul 22 14:36:40 fc23 kernel: [81871d2e] entry_SYSCALL_64_fastpath+0x12/0x76 Reported-by: Morten Stevens mstev...@fedoraproject.org Signed-off-by: Stephen Smalley s...@tycho.nsa.gov --- This version only differs

Re: [RFC][PATCH] ipc: Use private shmem or hugetlbfs inodes for shm segments.

2015-07-24 Thread Stephen Smalley
On 07/23/2015 08:11 PM, Dave Chinner wrote: On Thu, Jul 23, 2015 at 12:28:33PM -0400, Stephen Smalley wrote: The shm implementation internally uses shmem or hugetlbfs inodes for shm segments. As these inodes are never directly exposed to userspace and only accessed through the shm operations

[RFC][PATCH] ipc: Use private shmem or hugetlbfs inodes for shm segments.

2015-07-23 Thread Stephen Smalley
180 [] SyS_shmdt+0xb5/0x180 [] entry_SYSCALL_64_fastpath+0x12/0x76 Reported-by: Morten Stevens Signed-off-by: Stephen Smalley --- fs/hugetlbfs/inode.c | 2 ++ ipc/shm.c| 2 +- mm/shmem.c | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/fs/hugetlbfs/ino

Re: [PATCH 6/7] selinux: Ignore security labels on user namespace mounts

2015-07-23 Thread Stephen Smalley
On 07/23/2015 10:39 AM, Seth Forshee wrote: > On Thu, Jul 23, 2015 at 09:57:20AM -0400, Stephen Smalley wrote: >> On 07/22/2015 04:40 PM, Stephen Smalley wrote: >>> On 07/22/2015 04:25 PM, Stephen Smalley wrote: >>>> On 07/22/2015 12:14 PM, Seth Forshee wrote: >&

Re: [PATCH 6/7] selinux: Ignore security labels on user namespace mounts

2015-07-23 Thread Stephen Smalley
On 07/22/2015 04:40 PM, Stephen Smalley wrote: > On 07/22/2015 04:25 PM, Stephen Smalley wrote: >> On 07/22/2015 12:14 PM, Seth Forshee wrote: >>> On Wed, Jul 22, 2015 at 12:02:13PM -0400, Stephen Smalley wrote: >>>> On 07/16/2015 09:23 AM, Stephen Smalley wrote: >

Re: [PATCH 6/7] selinux: Ignore security labels on user namespace mounts

2015-07-23 Thread Stephen Smalley
On 07/22/2015 04:40 PM, Stephen Smalley wrote: On 07/22/2015 04:25 PM, Stephen Smalley wrote: On 07/22/2015 12:14 PM, Seth Forshee wrote: On Wed, Jul 22, 2015 at 12:02:13PM -0400, Stephen Smalley wrote: On 07/16/2015 09:23 AM, Stephen Smalley wrote: On 07/15/2015 03:46 PM, Seth Forshee wrote

Re: [PATCH 6/7] selinux: Ignore security labels on user namespace mounts

2015-07-23 Thread Stephen Smalley
On 07/23/2015 10:39 AM, Seth Forshee wrote: On Thu, Jul 23, 2015 at 09:57:20AM -0400, Stephen Smalley wrote: On 07/22/2015 04:40 PM, Stephen Smalley wrote: On 07/22/2015 04:25 PM, Stephen Smalley wrote: On 07/22/2015 12:14 PM, Seth Forshee wrote: On Wed, Jul 22, 2015 at 12:02:13PM -0400

[RFC][PATCH] ipc: Use private shmem or hugetlbfs inodes for shm segments.

2015-07-23 Thread Stephen Smalley
] remove_vma+0x45/0x80 [81222a30] do_munmap+0x2b0/0x460 [81386bbb] ? SyS_shmdt+0x4b/0x180 [81386c25] SyS_shmdt+0xb5/0x180 [81871d2e] entry_SYSCALL_64_fastpath+0x12/0x76 Reported-by: Morten Stevens mstev...@fedoraproject.org Signed-off-by: Stephen Smalley s

Re: mm: shmem_zero_setup skip security check and lockdep conflict with XFS

2015-07-22 Thread Stephen Smalley
On 07/22/2015 08:46 AM, Morten Stevens wrote: > 2015-06-17 13:45 GMT+02:00 Morten Stevens : >> 2015-06-15 8:09 GMT+02:00 Daniel Wagner : >>> On 06/14/2015 06:48 PM, Hugh Dickins wrote: It appears that, at some point last year, XFS made directory handling changes which bring it into

Re: [PATCH 6/7] selinux: Ignore security labels on user namespace mounts

2015-07-22 Thread Stephen Smalley
On 07/22/2015 04:25 PM, Stephen Smalley wrote: > On 07/22/2015 12:14 PM, Seth Forshee wrote: >> On Wed, Jul 22, 2015 at 12:02:13PM -0400, Stephen Smalley wrote: >>> On 07/16/2015 09:23 AM, Stephen Smalley wrote: >>>> On 07/15/2015 03:46 PM, Seth Forshee wrote: &

Re: [PATCH 6/7] selinux: Ignore security labels on user namespace mounts

2015-07-22 Thread Stephen Smalley
On 07/22/2015 12:14 PM, Seth Forshee wrote: > On Wed, Jul 22, 2015 at 12:02:13PM -0400, Stephen Smalley wrote: >> On 07/16/2015 09:23 AM, Stephen Smalley wrote: >>> On 07/15/2015 03:46 PM, Seth Forshee wrote: >>>> Unprivileged users should not be able to supply secur

Re: [PATCH 6/7] selinux: Ignore security labels on user namespace mounts

2015-07-22 Thread Stephen Smalley
On 07/16/2015 09:23 AM, Stephen Smalley wrote: > On 07/15/2015 03:46 PM, Seth Forshee wrote: >> Unprivileged users should not be able to supply security labels >> in filesystems, nor should they be able to supply security >> contexts in unprivileged mounts. For any

Re: [PATCH 6/7] selinux: Ignore security labels on user namespace mounts

2015-07-22 Thread Stephen Smalley
On 07/16/2015 09:23 AM, Stephen Smalley wrote: On 07/15/2015 03:46 PM, Seth Forshee wrote: Unprivileged users should not be able to supply security labels in filesystems, nor should they be able to supply security contexts in unprivileged mounts. For any mount where s_user_ns

Re: [PATCH 6/7] selinux: Ignore security labels on user namespace mounts

2015-07-22 Thread Stephen Smalley
On 07/22/2015 12:14 PM, Seth Forshee wrote: On Wed, Jul 22, 2015 at 12:02:13PM -0400, Stephen Smalley wrote: On 07/16/2015 09:23 AM, Stephen Smalley wrote: On 07/15/2015 03:46 PM, Seth Forshee wrote: Unprivileged users should not be able to supply security labels in filesystems, nor should

Re: [PATCH 6/7] selinux: Ignore security labels on user namespace mounts

2015-07-22 Thread Stephen Smalley
On 07/22/2015 04:25 PM, Stephen Smalley wrote: On 07/22/2015 12:14 PM, Seth Forshee wrote: On Wed, Jul 22, 2015 at 12:02:13PM -0400, Stephen Smalley wrote: On 07/16/2015 09:23 AM, Stephen Smalley wrote: On 07/15/2015 03:46 PM, Seth Forshee wrote: Unprivileged users should not be able

Re: mm: shmem_zero_setup skip security check and lockdep conflict with XFS

2015-07-22 Thread Stephen Smalley
On 07/22/2015 08:46 AM, Morten Stevens wrote: 2015-06-17 13:45 GMT+02:00 Morten Stevens mstev...@fedoraproject.org: 2015-06-15 8:09 GMT+02:00 Daniel Wagner w...@monom.org: On 06/14/2015 06:48 PM, Hugh Dickins wrote: It appears that, at some point last year, XFS made directory handling changes

Re: [PATCH 6/7] selinux: Ignore security labels on user namespace mounts

2015-07-16 Thread Stephen Smalley
On 07/15/2015 03:46 PM, Seth Forshee wrote: > Unprivileged users should not be able to supply security labels > in filesystems, nor should they be able to supply security > contexts in unprivileged mounts. For any mount where s_user_ns is > not init_user_ns, force the use of SECURITY_FS_USE_NONE

Re: [PATCH 0/7] Initial support for user namespace owned mounts

2015-07-16 Thread Stephen Smalley
On 07/15/2015 09:05 PM, Andy Lutomirski wrote: > On Jul 15, 2015 3:34 PM, "Eric W. Biederman" wrote: >> >> Seth Forshee writes: >> >>> On Wed, Jul 15, 2015 at 04:06:35PM -0500, Eric W. Biederman wrote: Casey Schaufler writes: > On 7/15/2015 12:46 PM, Seth Forshee wrote: >>

Re: [PATCH 6/7] selinux: Ignore security labels on user namespace mounts

2015-07-16 Thread Stephen Smalley
On 07/15/2015 03:46 PM, Seth Forshee wrote: Unprivileged users should not be able to supply security labels in filesystems, nor should they be able to supply security contexts in unprivileged mounts. For any mount where s_user_ns is not init_user_ns, force the use of SECURITY_FS_USE_NONE

Re: [PATCH 0/7] Initial support for user namespace owned mounts

2015-07-16 Thread Stephen Smalley
On 07/15/2015 09:05 PM, Andy Lutomirski wrote: On Jul 15, 2015 3:34 PM, Eric W. Biederman ebied...@xmission.com wrote: Seth Forshee seth.fors...@canonical.com writes: On Wed, Jul 15, 2015 at 04:06:35PM -0500, Eric W. Biederman wrote: Casey Schaufler ca...@schaufler-ca.com writes: On

Re: [RFC 5/8] kdbus: use LSM hooks in kdbus code

2015-07-10 Thread Stephen Smalley
On 07/08/2015 09:37 AM, Stephen Smalley wrote: > On 07/08/2015 06:25 AM, Paul Osmialowski wrote: >> Originates from: >> >> https://github.com/lmctl/kdbus.git (branch: kdbus-lsm-v4.for-systemd-v212) >> commit: aa0885489d19be92fa41c6f0a71df28763228a40 >> &g

Re: kdbus: credential faking

2015-07-10 Thread Stephen Smalley
On 07/10/2015 12:48 PM, David Herrmann wrote: > Hi > > On Fri, Jul 10, 2015 at 4:47 PM, Stephen Smalley wrote: >> On 07/10/2015 09:43 AM, David Herrmann wrote: >>> On Fri, Jul 10, 2015 at 3:25 PM, Stephen Smalley wrote: >>>> On 07/09/2015 06:22 PM, Da

Re: [RFC 5/8] kdbus: use LSM hooks in kdbus code

2015-07-10 Thread Stephen Smalley
On 07/08/2015 09:37 AM, Stephen Smalley wrote: > On 07/08/2015 06:25 AM, Paul Osmialowski wrote: >> Originates from: >> >> https://github.com/lmctl/kdbus.git (branch: kdbus-lsm-v4.for-systemd-v212) >> commit: aa0885489d19be92fa41c6f0a71df28763228a40 >> &g

Re: kdbus: credential faking

2015-07-10 Thread Stephen Smalley
On 07/10/2015 09:43 AM, David Herrmann wrote: > Hi > > On Fri, Jul 10, 2015 at 3:25 PM, Stephen Smalley wrote: >> On 07/09/2015 06:22 PM, David Herrmann wrote: >>> To be clear, faking metadata has one use-case, and one use-case only: >>> dbus1 compatibility

[PATCH] selinux: fix mprotect PROT_EXEC regression caused by mm change

2015-07-10 Thread Stephen Smalley
and ashmem. Signed-off-by: Stephen Smalley --- security/selinux/hooks.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c index 6231081..564079c 100644 --- a/security/selinux/hooks.c +++ b/security/selinux/hooks.c @@ -3283

Re: kdbus: credential faking

2015-07-10 Thread Stephen Smalley
On 07/10/2015 05:05 AM, David Herrmann wrote: > Hi > > On Fri, Jul 10, 2015 at 12:56 AM, Casey Schaufler > wrote: >> On 7/9/2015 3:22 PM, David Herrmann wrote: >>> Regarding requiring CAP_SYS_ADMIN, I don't really see the point. In >>> the kdbus security model, if you don't trust the

Re: kdbus: credential faking

2015-07-10 Thread Stephen Smalley
On 07/09/2015 06:22 PM, David Herrmann wrote: > Hi > > On Thu, Jul 9, 2015 at 8:26 PM, Stephen Smalley wrote: >> Hi, >> >> I have a concern with the support for faked credentials in kdbus, but >> don't know enough about the original motivation or intended use

Re: mm: shmem_zero_setup skip security check and lockdep conflict with XFS

2015-07-10 Thread Stephen Smalley
On 07/10/2015 03:48 AM, Hugh Dickins wrote: > On Thu, 9 Jul 2015, Stephen Smalley wrote: >> On 07/09/2015 04:23 AM, Hugh Dickins wrote: >>> On Wed, 8 Jul 2015, Stephen Smalley wrote: >>>> On 07/08/2015 09:13 AM, Stephen Smalley wrote: >>>>> On Sun,

Re: mm: shmem_zero_setup skip security check and lockdep conflict with XFS

2015-07-10 Thread Stephen Smalley
On 07/10/2015 03:48 AM, Hugh Dickins wrote: On Thu, 9 Jul 2015, Stephen Smalley wrote: On 07/09/2015 04:23 AM, Hugh Dickins wrote: On Wed, 8 Jul 2015, Stephen Smalley wrote: On 07/08/2015 09:13 AM, Stephen Smalley wrote: On Sun, Jun 14, 2015 at 12:48 PM, Hugh Dickins hu...@google.com wrote

Re: kdbus: credential faking

2015-07-10 Thread Stephen Smalley
On 07/10/2015 05:05 AM, David Herrmann wrote: Hi On Fri, Jul 10, 2015 at 12:56 AM, Casey Schaufler ca...@schaufler-ca.com wrote: On 7/9/2015 3:22 PM, David Herrmann wrote: Regarding requiring CAP_SYS_ADMIN, I don't really see the point. In the kdbus security model, if you don't trust the

[PATCH] selinux: fix mprotect PROT_EXEC regression caused by mm change

2015-07-10 Thread Stephen Smalley
. Signed-off-by: Stephen Smalley s...@tycho.nsa.gov --- security/selinux/hooks.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c index 6231081..564079c 100644 --- a/security/selinux/hooks.c +++ b/security/selinux/hooks.c @@ -3283,7

Re: kdbus: credential faking

2015-07-10 Thread Stephen Smalley
On 07/10/2015 09:43 AM, David Herrmann wrote: Hi On Fri, Jul 10, 2015 at 3:25 PM, Stephen Smalley s...@tycho.nsa.gov wrote: On 07/09/2015 06:22 PM, David Herrmann wrote: To be clear, faking metadata has one use-case, and one use-case only: dbus1 compatibility In dbus1, clients connect

Re: kdbus: credential faking

2015-07-10 Thread Stephen Smalley
On 07/09/2015 06:22 PM, David Herrmann wrote: Hi On Thu, Jul 9, 2015 at 8:26 PM, Stephen Smalley s...@tycho.nsa.gov wrote: Hi, I have a concern with the support for faked credentials in kdbus, but don't know enough about the original motivation or intended use case to evaluate

Re: kdbus: credential faking

2015-07-10 Thread Stephen Smalley
On 07/10/2015 12:48 PM, David Herrmann wrote: Hi On Fri, Jul 10, 2015 at 4:47 PM, Stephen Smalley s...@tycho.nsa.gov wrote: On 07/10/2015 09:43 AM, David Herrmann wrote: On Fri, Jul 10, 2015 at 3:25 PM, Stephen Smalley s...@tycho.nsa.gov wrote: On 07/09/2015 06:22 PM, David Herrmann wrote

Re: [RFC 5/8] kdbus: use LSM hooks in kdbus code

2015-07-10 Thread Stephen Smalley
On 07/08/2015 09:37 AM, Stephen Smalley wrote: On 07/08/2015 06:25 AM, Paul Osmialowski wrote: Originates from: https://github.com/lmctl/kdbus.git (branch: kdbus-lsm-v4.for-systemd-v212) commit: aa0885489d19be92fa41c6f0a71df28763228a40 Signed-off-by: Karol Lewandowski k.lewando

Re: [RFC 5/8] kdbus: use LSM hooks in kdbus code

2015-07-10 Thread Stephen Smalley
On 07/08/2015 09:37 AM, Stephen Smalley wrote: On 07/08/2015 06:25 AM, Paul Osmialowski wrote: Originates from: https://github.com/lmctl/kdbus.git (branch: kdbus-lsm-v4.for-systemd-v212) commit: aa0885489d19be92fa41c6f0a71df28763228a40 Signed-off-by: Karol Lewandowski k.lewando

kdbus: credential faking

2015-07-09 Thread Stephen Smalley
Hi, I have a concern with the support for faked credentials in kdbus, but don't know enough about the original motivation or intended use case to evaluate it concretely. I raised this issue during the "kdbus for 4.1-rc1" thread a while back but none of the kdbus maintainers responded, and the

Re: mm: shmem_zero_setup skip security check and lockdep conflict with XFS

2015-07-09 Thread Stephen Smalley
On 07/09/2015 04:23 AM, Hugh Dickins wrote: > On Wed, 8 Jul 2015, Stephen Smalley wrote: >> On 07/08/2015 09:13 AM, Stephen Smalley wrote: >>> On Sun, Jun 14, 2015 at 12:48 PM, Hugh Dickins wrote: >>>> It appears that, at some point last year, XFS made directory han

kdbus: credential faking

2015-07-09 Thread Stephen Smalley
Hi, I have a concern with the support for faked credentials in kdbus, but don't know enough about the original motivation or intended use case to evaluate it concretely. I raised this issue during the kdbus for 4.1-rc1 thread a while back but none of the kdbus maintainers responded, and the one

Re: mm: shmem_zero_setup skip security check and lockdep conflict with XFS

2015-07-09 Thread Stephen Smalley
On 07/09/2015 04:23 AM, Hugh Dickins wrote: On Wed, 8 Jul 2015, Stephen Smalley wrote: On 07/08/2015 09:13 AM, Stephen Smalley wrote: On Sun, Jun 14, 2015 at 12:48 PM, Hugh Dickins hu...@google.com wrote: It appears that, at some point last year, XFS made directory handling changes which

Re: Linux 4.2-rc1

2015-07-08 Thread Stephen Smalley
On 07/08/2015 01:47 PM, Casey Schaufler wrote: > On 7/8/2015 10:29 AM, Linus Torvalds wrote: >> On Wed, Jul 8, 2015 at 10:17 AM, Linus Torvalds >> wrote: >>> Decoding the "Code:" line shows that this is the "->fw_id" dereference in >>> >>> if (add_uevent_var(env, "FIRMWARE=%s",

Re: mm: shmem_zero_setup skip security check and lockdep conflict with XFS

2015-07-08 Thread Stephen Smalley
On 07/08/2015 09:13 AM, Stephen Smalley wrote: > On Sun, Jun 14, 2015 at 12:48 PM, Hugh Dickins wrote: >> It appears that, at some point last year, XFS made directory handling >> changes which bring it into lockdep conflict with shmem_zero_setup(): >> it is surprising

Re: [RFC 4/8] lsm: smack: smack callbacks for kdbus security hooks

2015-07-08 Thread Stephen Smalley
On 07/08/2015 06:25 AM, Paul Osmialowski wrote: > This adds implementation of three smack callbacks sitting behind kdbus > security hooks as proposed by Karol Lewandowski. > > Originates from: > > git://git.infradead.org/users/pcmoore/selinux (branch: working-kdbus) > commit:

Re: [RFC 5/8] kdbus: use LSM hooks in kdbus code

2015-07-08 Thread Stephen Smalley
On 07/08/2015 06:25 AM, Paul Osmialowski wrote: > Originates from: > > https://github.com/lmctl/kdbus.git (branch: kdbus-lsm-v4.for-systemd-v212) > commit: aa0885489d19be92fa41c6f0a71df28763228a40 > > Signed-off-by: Karol Lewandowski > Signed-off-by: Paul Osmialowski > --- > ipc/kdbus/bus.c

Re: mm: shmem_zero_setup skip security check and lockdep conflict with XFS

2015-07-08 Thread Stephen Smalley
On Sun, Jun 14, 2015 at 12:48 PM, Hugh Dickins wrote: > It appears that, at some point last year, XFS made directory handling > changes which bring it into lockdep conflict with shmem_zero_setup(): > it is surprising that mmap() can clone an inode while holding mmap_sem, > but that has been so

Re: [RFC 5/8] kdbus: use LSM hooks in kdbus code

2015-07-08 Thread Stephen Smalley
On 07/08/2015 06:25 AM, Paul Osmialowski wrote: Originates from: https://github.com/lmctl/kdbus.git (branch: kdbus-lsm-v4.for-systemd-v212) commit: aa0885489d19be92fa41c6f0a71df28763228a40 Signed-off-by: Karol Lewandowski k.lewando...@samsung.com Signed-off-by: Paul Osmialowski

Re: mm: shmem_zero_setup skip security check and lockdep conflict with XFS

2015-07-08 Thread Stephen Smalley
On Sun, Jun 14, 2015 at 12:48 PM, Hugh Dickins hu...@google.com wrote: It appears that, at some point last year, XFS made directory handling changes which bring it into lockdep conflict with shmem_zero_setup(): it is surprising that mmap() can clone an inode while holding mmap_sem, but that

<    1   2   3   4   5   6   7   8   9   10   >