1. 28 2月, 2019 2 次提交
    • A
      introduce cloning of fs_context · 0b52075e
      Al Viro 提交于
      new primitive: vfs_dup_fs_context().  Comes with fs_context
      method (->dup()) for copying the filesystem-specific parts
      of fs_context, along with LSM one (->fs_context_dup()) for
      doing the same to LSM parts.
      
      [needs better commit message, and change of Author:, anyway]
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      0b52075e
    • D
      vfs: Add LSM hooks for the new mount API · da2441fd
      David Howells 提交于
      Add LSM hooks for use by the new mount API and filesystem context code.
      This includes:
      
       (1) Hooks to handle allocation, duplication and freeing of the security
           record attached to a filesystem context.
      
       (2) A hook to snoop source specifications.  There may be multiple of these
           if the filesystem supports it.  They will to be local files/devices if
           fs_context::source_is_dev is true and will be something else, possibly
           remote server specifications, if false.
      
       (3) A hook to snoop superblock configuration options in key[=val] form.
           If the LSM decides it wants to handle it, it can suppress the option
           being passed to the filesystem.  Note that 'val' may include commas
           and binary data with the fsopen patch.
      
       (4) A hook to perform validation and allocation after the configuration
           has been done but before the superblock is allocated and set up.
      
       (5) A hook to transfer the security from the context to a newly created
           superblock.
      
       (6) A hook to rule on whether a path point can be used as a mountpoint.
      
      These are intended to replace:
      
      	security_sb_copy_data
      	security_sb_kern_mount
      	security_sb_mount
      	security_sb_set_mnt_opts
      	security_sb_clone_mnt_opts
      	security_sb_parse_opts_str
      
      [AV -- some of the methods being replaced are already gone, some of the
      methods are not added for the lack of need]
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      cc: linux-security-module@vger.kernel.org
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      da2441fd
  2. 01 2月, 2019 1 次提交
  3. 19 1月, 2019 1 次提交
  4. 11 1月, 2019 1 次提交
  5. 09 1月, 2019 14 次提交
  6. 22 12月, 2018 6 次提交
  7. 11 10月, 2018 3 次提交
  8. 03 10月, 2018 1 次提交
    • E
      signal: Distinguish between kernel_siginfo and siginfo · ae7795bc
      Eric W. Biederman 提交于
      Linus recently observed that if we did not worry about the padding
      member in struct siginfo it is only about 48 bytes, and 48 bytes is
      much nicer than 128 bytes for allocating on the stack and copying
      around in the kernel.
      
      The obvious thing of only adding the padding when userspace is
      including siginfo.h won't work as there are sigframe definitions in
      the kernel that embed struct siginfo.
      
      So split siginfo in two; kernel_siginfo and siginfo.  Keeping the
      traditional name for the userspace definition.  While the version that
      is used internally to the kernel and ultimately will not be padded to
      128 bytes is called kernel_siginfo.
      
      The definition of struct kernel_siginfo I have put in include/signal_types.h
      
      A set of buildtime checks has been added to verify the two structures have
      the same field offsets.
      
      To make it easy to verify the change kernel_siginfo retains the same
      size as siginfo.  The reduction in size comes in a following change.
      Signed-off-by: N"Eric W. Biederman" <ebiederm@xmission.com>
      ae7795bc
  9. 17 7月, 2018 1 次提交
  10. 12 7月, 2018 1 次提交
  11. 05 5月, 2018 1 次提交
    • D
      security: add hook for socketpair() · aae7cfcb
      David Herrmann 提交于
      Right now the LSM labels for socketpairs are always uninitialized,
      since there is no security hook for the socketpair() syscall. This
      patch adds the required hooks so LSMs can properly label socketpairs.
      This allows SO_PEERSEC to return useful information on those sockets.
      
      Note that the behavior of socketpair() can be emulated by creating a
      listener socket, connecting to it, and then discarding the initial
      listener socket. With this workaround, SO_PEERSEC would return the
      caller's security context. However, with socketpair(), the uninitialized
      context is returned unconditionally. This is unexpected and makes
      socketpair() less useful in situations where the security context is
      crucial to the application.
      
      With the new socketpair-hook this disparity can be solved by making
      socketpair() return the expected security context.
      Acked-by: NSerge Hallyn <serge@hallyn.com>
      Signed-off-by: NTom Gundersen <teg@jklm.no>
      Signed-off-by: NDavid Herrmann <dh.herrmann@gmail.com>
      Signed-off-by: NJames Morris <james.morris@microsoft.com>
      aae7cfcb
  12. 31 3月, 2018 1 次提交
  13. 23 3月, 2018 4 次提交
  14. 07 3月, 2018 1 次提交
  15. 23 2月, 2018 1 次提交
  16. 20 10月, 2017 1 次提交
    • C
      security: bpf: Add LSM hooks for bpf object related syscall · afdb09c7
      Chenbo Feng 提交于
      Introduce several LSM hooks for the syscalls that will allow the
      userspace to access to eBPF object such as eBPF programs and eBPF maps.
      The security check is aimed to enforce a per object security protection
      for eBPF object so only processes with the right priviliges can
      read/write to a specific map or use a specific eBPF program. Besides
      that, a general security hook is added before the multiplexer of bpf
      syscall to check the cmd and the attribute used for the command. The
      actual security module can decide which command need to be checked and
      how the cmd should be checked.
      Signed-off-by: NChenbo Feng <fengc@google.com>
      Acked-by: NJames Morris <james.l.morris@oracle.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      afdb09c7