1. 13 3月, 2019 1 次提交
  2. 22 2月, 2019 1 次提交
  3. 06 2月, 2019 1 次提交
  4. 01 2月, 2019 1 次提交
  5. 29 1月, 2019 1 次提交
  6. 26 1月, 2019 3 次提交
  7. 19 1月, 2019 1 次提交
  8. 11 1月, 2019 6 次提交
    • O
      selinux: do not override context on context mounts · 53e0c2aa
      Ondrej Mosnacek 提交于
      Ignore all selinux_inode_notifysecctx() calls on mounts with SBLABEL_MNT
      flag unset. This is achived by returning -EOPNOTSUPP for this case in
      selinux_inode_setsecurtity() (because that function should not be called
      in such case anyway) and translating this error to 0 in
      selinux_inode_notifysecctx().
      
      This fixes behavior of kernfs-based filesystems when mounted with the
      'context=' option. Before this patch, if a node's context had been
      explicitly set to a non-default value and later the filesystem has been
      remounted with the 'context=' option, then this node would show up as
      having the manually-set context and not the mount-specified one.
      
      Steps to reproduce:
          # mount -t cgroup2 cgroup2 /sys/fs/cgroup/unified
          # chcon unconfined_u:object_r:user_home_t:s0 /sys/fs/cgroup/unified/cgroup.stat
          # ls -lZ /sys/fs/cgroup/unified
          total 0
          -r--r--r--. 1 root root system_u:object_r:cgroup_t:s0        0 Dec 13 10:41 cgroup.controllers
          -rw-r--r--. 1 root root system_u:object_r:cgroup_t:s0        0 Dec 13 10:41 cgroup.max.depth
          -rw-r--r--. 1 root root system_u:object_r:cgroup_t:s0        0 Dec 13 10:41 cgroup.max.descendants
          -rw-r--r--. 1 root root system_u:object_r:cgroup_t:s0        0 Dec 13 10:41 cgroup.procs
          -r--r--r--. 1 root root unconfined_u:object_r:user_home_t:s0 0 Dec 13 10:41 cgroup.stat
          -rw-r--r--. 1 root root system_u:object_r:cgroup_t:s0        0 Dec 13 10:41 cgroup.subtree_control
          -rw-r--r--. 1 root root system_u:object_r:cgroup_t:s0        0 Dec 13 10:41 cgroup.threads
          # umount /sys/fs/cgroup/unified
          # mount -o context=system_u:object_r:tmpfs_t:s0 -t cgroup2 cgroup2 /sys/fs/cgroup/unified
      
      Result before:
          # ls -lZ /sys/fs/cgroup/unified
          total 0
          -r--r--r--. 1 root root system_u:object_r:tmpfs_t:s0         0 Dec 13 10:41 cgroup.controllers
          -rw-r--r--. 1 root root system_u:object_r:tmpfs_t:s0         0 Dec 13 10:41 cgroup.max.depth
          -rw-r--r--. 1 root root system_u:object_r:tmpfs_t:s0         0 Dec 13 10:41 cgroup.max.descendants
          -rw-r--r--. 1 root root system_u:object_r:tmpfs_t:s0         0 Dec 13 10:41 cgroup.procs
          -r--r--r--. 1 root root unconfined_u:object_r:user_home_t:s0 0 Dec 13 10:41 cgroup.stat
          -rw-r--r--. 1 root root system_u:object_r:tmpfs_t:s0         0 Dec 13 10:41 cgroup.subtree_control
          -rw-r--r--. 1 root root system_u:object_r:tmpfs_t:s0         0 Dec 13 10:41 cgroup.threads
      
      Result after:
          # ls -lZ /sys/fs/cgroup/unified
          total 0
          -r--r--r--. 1 root root system_u:object_r:tmpfs_t:s0 0 Dec 13 10:41 cgroup.controllers
          -rw-r--r--. 1 root root system_u:object_r:tmpfs_t:s0 0 Dec 13 10:41 cgroup.max.depth
          -rw-r--r--. 1 root root system_u:object_r:tmpfs_t:s0 0 Dec 13 10:41 cgroup.max.descendants
          -rw-r--r--. 1 root root system_u:object_r:tmpfs_t:s0 0 Dec 13 10:41 cgroup.procs
          -r--r--r--. 1 root root system_u:object_r:tmpfs_t:s0 0 Dec 13 10:41 cgroup.stat
          -rw-r--r--. 1 root root system_u:object_r:tmpfs_t:s0 0 Dec 13 10:41 cgroup.subtree_control
          -rw-r--r--. 1 root root system_u:object_r:tmpfs_t:s0 0 Dec 13 10:41 cgroup.threads
      Signed-off-by: NOndrej Mosnacek <omosnace@redhat.com>
      Reviewed-by: NStephen Smalley <sds@tycho.nsa.gov>
      Signed-off-by: NPaul Moore <paul@paul-moore.com>
      53e0c2aa
    • O
      selinux: never allow relabeling on context mounts · a83d6dda
      Ondrej Mosnacek 提交于
      In the SECURITY_FS_USE_MNTPOINT case we never want to allow relabeling
      files/directories, so we should never set the SBLABEL_MNT flag. The
      'special handling' in selinux_is_sblabel_mnt() is only intended for when
      the behavior is set to SECURITY_FS_USE_GENFS.
      
      While there, make the logic in selinux_is_sblabel_mnt() more explicit
      and add a BUILD_BUG_ON() to make sure that introducing a new
      SECURITY_FS_USE_* forces a review of the logic.
      
      Fixes: d5f3a5f6 ("selinux: add security in-core xattr support for pstore and debugfs")
      Signed-off-by: NOndrej Mosnacek <omosnace@redhat.com>
      Reviewed-by: NStephen Smalley <sds@tycho.nsa.gov>
      Signed-off-by: NPaul Moore <paul@paul-moore.com>
      a83d6dda
    • S
      selinux: stop passing MAY_NOT_BLOCK to the AVC upon follow_link · e46e01ee
      Stephen Smalley 提交于
      commit bda0be7a ("security: make inode_follow_link RCU-walk aware")
      switched selinux_inode_follow_link() to use avc_has_perm_flags() and
      pass down the MAY_NOT_BLOCK flag if called during RCU walk.  However,
      the only test of MAY_NOT_BLOCK occurs during slow_avc_audit()
      and only if passing an inode as audit data (LSM_AUDIT_DATA_INODE).  Since
      selinux_inode_follow_link() passes a dentry directly, passing MAY_NOT_BLOCK
      here serves no purpose.  Switch selinux_inode_follow_link() to use
      avc_has_perm() and drop avc_has_perm_flags() since there are no other
      users.
      Signed-off-by: NStephen Smalley <sds@tycho.nsa.gov>
      Signed-off-by: NPaul Moore <paul@paul-moore.com>
      e46e01ee
    • S
      selinux: avoid silent denials in permissive mode under RCU walk · 3a28cff3
      Stephen Smalley 提交于
      commit 0dc1ba24 ("SELINUX: Make selinux cache VFS RCU walks safe")
      results in no audit messages at all if in permissive mode because the
      cache is updated during the rcu walk and thus no denial occurs on
      the subsequent ref walk.  Fix this by not updating the cache when
      performing a non-blocking permission check.  This only affects search
      and symlink read checks during rcu walk.
      
      Fixes: 0dc1ba24 ("SELINUX: Make selinux cache VFS RCU walks safe")
      Reported-by: NBMK <bmktuwien@gmail.com>
      Signed-off-by: NStephen Smalley <sds@tycho.nsa.gov>
      Signed-off-by: NPaul Moore <paul@paul-moore.com>
      3a28cff3
    • S
      selinux: fix GPF on invalid policy · 5b0e7310
      Stephen Smalley 提交于
      levdatum->level can be NULL if we encounter an error while loading
      the policy during sens_read prior to initializing it.  Make sure
      sens_destroy handles that case correctly.
      
      Reported-by: syzbot+6664500f0f18f07a5c0e@syzkaller.appspotmail.com
      Signed-off-by: NStephen Smalley <sds@tycho.nsa.gov>
      Signed-off-by: NPaul Moore <paul@paul-moore.com>
      5b0e7310
    • M
      LSM: generalize flag passing to security_capable · c1a85a00
      Micah Morton 提交于
      This patch provides a general mechanism for passing flags to the
      security_capable LSM hook. It replaces the specific 'audit' flag that is
      used to tell security_capable whether it should log an audit message for
      the given capability check. The reason for generalizing this flag
      passing is so we can add an additional flag that signifies whether
      security_capable is being called by a setid syscall (which is needed by
      the proposed SafeSetID LSM).
      Signed-off-by: NMicah Morton <mortonm@chromium.org>
      Reviewed-by: NKees Cook <keescook@chromium.org>
      Signed-off-by: NJames Morris <james.morris@microsoft.com>
      c1a85a00
  9. 09 1月, 2019 15 次提交
  10. 22 12月, 2018 10 次提交