Re: [RFC PATCH] selinux: add a fallback to defcontext for native labeling

2018-10-02 Thread Stephen Smalley
On 10/02/2018 02:48 PM, Taras Kondratiuk wrote: Quoting Stephen Smalley (2018-09-21 07:40:58) If we set the inode sid to the superblock def_sid on an invalid context, then we lose the association to the original context value. The support for deferred mapping of contexts requires allocating a

Re: [RFC PATCH] selinux: add a fallback to defcontext for native labeling

2018-10-02 Thread Taras Kondratiuk via Selinux
Quoting Stephen Smalley (2018-09-21 07:40:58) > If we set the inode sid to the superblock def_sid on an invalid > context, then we lose the association to the original context value. > The support for deferred mapping of contexts requires allocating a new > SID for the invalid context and storing

Re: [PATCH] selinux: fix race when removing selinuxfs entries

2018-10-02 Thread Al Viro
On Tue, Oct 02, 2018 at 01:18:30PM +0200, Ondrej Mosnacek wrote: No. With the side of Hell, No. The bug is real, but this is not the way to fix it. First of all, it's still broken - e.g. mount something on a subdirectory and watch what that thing will do to it. And anyone who has permission

Re: [PATCH 21/19] LSM: Cleanup and fixes from Tetsuo Handa

2018-10-02 Thread Kees Cook
On Wed, Sep 26, 2018 at 2:57 PM, Casey Schaufler wrote: > lsm_early_cred()/lsm_early_task() are called from only __init functions. > > lsm_cred_alloc()/lsm_file_alloc() are called from only security/security.c . > > lsm_early_inode() should be avoided because it is not appropriate to > call

Re: [PATCH security-next v3 07/29] LSM: Convert security_initcall() into DEFINE_LSM()

2018-10-02 Thread John Johansen
On 09/24/2018 05:18 PM, Kees Cook wrote: > Instead of using argument-based initializers, switch to defining the > contents of struct lsm_info on a per-LSM basis. This also drops > the final use of the now inaccurate "initcall" naming. > > Cc: John Johansen > Cc: James Morris > Cc: "Serge E.

Re: [PATCH v4 20/19] LSM: Correct file blob free empty blob check

2018-10-02 Thread Kees Cook
On Wed, Sep 26, 2018 at 2:57 PM, Casey Schaufler wrote: > Instead of checking if the kmem_cache for file blobs > has been initialized check if the blob is NULL. This > allows non-blob using modules to do other kinds of > clean up in the security_file_free hooks. > > Signed-off-by: Casey Schaufler

[PATCH] selinux: fix race when removing selinuxfs entries

2018-10-02 Thread Ondrej Mosnacek
Letting the following set of commands run long enough on a multi-core machine causes soft lockups in the kernel: (cd /sys/fs/selinux/; while true; do find >/dev/null 2>&1; done) & (cd /sys/fs/selinux/; while true; do find >/dev/null 2>&1; done) & (cd /sys/fs/selinux/; while true; do