23 Jan, 2019

1 commit

  • commit a5795fd38ee8194451ba3f281f075301a3696ce2 upstream.

    From: Casey Schaufler

    Check that the cred security blob has been set before trying
    to clean it up. There is a case during credential initialization
    that could result in this.

    Signed-off-by: Casey Schaufler
    Acked-by: John Johansen
    Signed-off-by: James Morris
    Reported-by: syzbot+69ca07954461f189e808@syzkaller.appspotmail.com
    Signed-off-by: Greg Kroah-Hartman

    James Morris
     

26 Sep, 2018

1 commit

  • [ Upstream commit 87ea58433208d17295e200d56be5e2a4fe4ce7d6 ]

    lsm_append() should return -ENOMEM if memory allocation failed.

    Fixes: d69dece5f5b6 ("LSM: Add /sys/kernel/security/lsm")
    Signed-off-by: Eric Biggers
    Signed-off-by: James Morris
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Eric Biggers
     

13 Sep, 2017

1 commit

  • Pull selinux updates from Paul Moore:
    "A relatively quiet period for SELinux, 11 patches with only two/three
    having any substantive changes.

    These noteworthy changes include another tweak to the NNP/nosuid
    handling, per-file labeling for cgroups, and an object class fix for
    AF_UNIX/SOCK_RAW sockets; the rest of the changes are minor tweaks or
    administrative updates (Stephen's email update explains the file
    explosion in the diffstat).

    Everything passes the selinux-testsuite"

    [ Also a couple of small patches from the security tree from Tetsuo
    Handa for Tomoyo and LSM cleanup. The separation of security policy
    updates wasn't all that clean - Linus ]

    * tag 'selinux-pr-20170831' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux:
    selinux: constify nf_hook_ops
    selinux: allow per-file labeling for cgroupfs
    lsm_audit: update my email address
    selinux: update my email address
    MAINTAINERS: update the NetLabel and Labeled Networking information
    selinux: use GFP_NOWAIT in the AVC kmem_caches
    selinux: Generalize support for NNP/nosuid SELinux domain transitions
    selinux: genheaders should fail if too many permissions are defined
    selinux: update the selinux info in MAINTAINERS
    credits: update Paul Moore's info
    selinux: Assign proper class to PF_UNIX/SOCK_RAW sockets
    tomoyo: Update URLs in Documentation/admin-guide/LSM/tomoyo.rst
    LSM: Remove security_task_create() hook.

    Linus Torvalds
     

02 Aug, 2017

1 commit

  • This removes the bprm_secureexec hook since the logic has been folded into
    the bprm_set_creds hook for all LSMs now.

    Cc: Eric W. Biederman
    Signed-off-by: Kees Cook
    Reviewed-by: John Johansen
    Acked-by: James Morris
    Acked-by: Serge Hallyn

    Kees Cook
     

18 Jul, 2017

1 commit


10 Jun, 2017

1 commit

  • When an NFSv4 client performs a mount operation, it first mounts the
    NFSv4 root and then does path walk to the exported path and performs a
    submount on that, cloning the security mount options from the root's
    superblock to the submount's superblock in the process.

    Unless the NFS server has an explicit fsid=0 export with the
    "security_label" option, the NFSv4 root superblock will not have
    SBLABEL_MNT set, and neither will the submount superblock after cloning
    the security mount options. As a result, setxattr's of security labels
    over NFSv4.2 will fail. In a similar fashion, NFSv4.2 mounts mounted
    with the context= mount option will not show the correct labels because
    the nfs_server->caps flags of the cloned superblock will still have
    NFS_CAP_SECURITY_LABEL set.

    Allowing the NFSv4 client to enable or disable SECURITY_LSM_NATIVE_LABELS
    behavior will ensure that the SBLABEL_MNT flag has the correct value
    when the client traverses from an exported path without the
    "security_label" option to one with the "security_label" option and
    vice versa. Similarly, checking to see if SECURITY_LSM_NATIVE_LABELS is
    set upon return from security_sb_clone_mnt_opts() and clearing
    NFS_CAP_SECURITY_LABEL if necessary will allow the correct labels to
    be displayed for NFSv4.2 mounts mounted with the context= mount option.

    Resolves: https://github.com/SELinuxProject/selinux-kernel/issues/35

    Signed-off-by: Scott Mayhew
    Reviewed-by: Stephen Smalley
    Tested-by: Stephen Smalley
    Signed-off-by: Paul Moore

    Scott Mayhew
     

24 May, 2017

3 commits

  • Allocate and free a security context when creating and destroying a MAD
    agent. This context is used for controlling access to PKeys and sending
    and receiving SMPs.

    When sending or receiving a MAD check that the agent has permission to
    access the PKey for the Subnet Prefix of the port.

    During MAD and snoop agent registration for SMI QPs check that the
    calling process has permission to access the manage the subnet and
    register a callback with the LSM to be notified of policy changes. When
    notificaiton of a policy change occurs recheck permission and set a flag
    indicating sending and receiving SMPs is allowed.

    When sending and receiving MADs check that the agent has access to the
    SMI if it's on an SMI QP. Because security policy can change it's
    possible permission was allowed when creating the agent, but no longer
    is.

    Signed-off-by: Daniel Jurgens
    Acked-by: Doug Ledford
    [PM: remove the LSM hook init code]
    Signed-off-by: Paul Moore

    Daniel Jurgens
     
  • Add a generic notificaiton mechanism in the LSM. Interested consumers
    can register a callback with the LSM and security modules can produce
    events.

    Because access to Infiniband QPs are enforced in the setup phase of a
    connection security should be enforced again if the policy changes.
    Register infiniband devices for policy change notification and check all
    QPs on that device when the notification is received.

    Add a call to the notification mechanism from SELinux when the AVC
    cache changes or setenforce is cleared.

    Signed-off-by: Daniel Jurgens
    Acked-by: James Morris
    Acked-by: Doug Ledford
    Signed-off-by: Paul Moore

    Daniel Jurgens
     
  • Add new LSM hooks to allocate and free security contexts and check for
    permission to access a PKey.

    Allocate and free a security context when creating and destroying a QP.
    This context is used for controlling access to PKeys.

    When a request is made to modify a QP that changes the port, PKey index,
    or alternate path, check that the QP has permission for the PKey in the
    PKey table index on the subnet prefix of the port. If the QP is shared
    make sure all handles to the QP also have access.

    Store which port and PKey index a QP is using. After the reset to init
    transition the user can modify the port, PKey index and alternate path
    independently. So port and PKey settings changes can be a merge of the
    previous settings and the new ones.

    In order to maintain access control if there are PKey table or subnet
    prefix change keep a list of all QPs are using each PKey index on
    each port. If a change occurs all QPs using that device and port must
    have access enforced for the new cache settings.

    These changes add a transaction to the QP modify process. Association
    with the old port and PKey index must be maintained if the modify fails,
    and must be removed if it succeeds. Association with the new port and
    PKey index must be established prior to the modify and removed if the
    modify fails.

    1. When a QP is modified to a particular Port, PKey index or alternate
    path insert that QP into the appropriate lists.

    2. Check permission to access the new settings.

    3. If step 2 grants access attempt to modify the QP.

    4a. If steps 2 and 3 succeed remove any prior associations.

    4b. If ether fails remove the new setting associations.

    If a PKey table or subnet prefix changes walk the list of QPs and
    check that they have permission. If not send the QP to the error state
    and raise a fatal error event. If it's a shared QP make sure all the
    QPs that share the real_qp have permission as well. If the QP that
    owns a security structure is denied access the security structure is
    marked as such and the QP is added to an error_list. Once the moving
    the QP to error is complete the security structure mark is cleared.

    Maintaining the lists correctly turns QP destroy into a transaction.
    The hardware driver for the device frees the ib_qp structure, so while
    the destroy is in progress the ib_qp pointer in the ib_qp_security
    struct is undefined. When the destroy process begins the ib_qp_security
    structure is marked as destroying. This prevents any action from being
    taken on the QP pointer. After the QP is destroyed successfully it
    could still listed on an error_list wait for it to be processed by that
    flow before cleaning up the structure.

    If the destroy fails the QPs port and PKey settings are reinserted into
    the appropriate lists, the destroying flag is cleared, and access control
    is enforced, in case there were any cache changes during the destroy
    flow.

    To keep the security changes isolated a new file is used to hold security
    related functionality.

    Signed-off-by: Daniel Jurgens
    Acked-by: Doug Ledford
    [PM: merge fixup in ib_verbs.h and uverbs_cmd.c]
    Signed-off-by: Paul Moore

    Daniel Jurgens
     

22 May, 2017

1 commit


15 May, 2017

1 commit

  • The commit d69dece5f5b6 ("LSM: Add /sys/kernel/security/lsm") extend
    security_add_hooks() with a new parameter to register the LSM name,
    which may be useful to make the list of currently loaded LSM available
    to userspace. However, there is no clean way for an LSM to split its
    hook declarations into multiple files, which may reduce the mess with
    all the included files (needed for LSM hook argument types) and make the
    source code easier to review and maintain.

    This change allows an LSM to register multiple times its hook while
    keeping a consistent list of LSM names as described in
    Documentation/security/LSM.txt . The list reflects the order in which
    checks are made. This patch only check for the last registered LSM. If
    an LSM register multiple times its hooks, interleaved with other LSM
    registrations (which should not happen), its name will still appear in
    the same order that the hooks are called, hence multiple times.

    To sum up, "capability,selinux,foo,foo" will be replaced with
    "capability,selinux,foo", however "capability,foo,selinux,foo" will
    remain as is.

    Signed-off-by: Mickaël Salaün
    Acked-by: Kees Cook
    Acked-by: Casey Schaufler
    Signed-off-by: James Morris

    Mickaël Salaün
     

03 May, 2017

1 commit

  • Pull security subsystem updates from James Morris:
    "Highlights:

    IMA:
    - provide ">" and " of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security: (98 commits)
    tpm: Fix reference count to main device
    tpm_tis: convert to using locality callbacks
    tpm: fix handling of the TPM 2.0 event logs
    tpm_crb: remove a cruft constant
    keys: select CONFIG_CRYPTO when selecting DH / KDF
    apparmor: Make path_max parameter readonly
    apparmor: fix parameters so that the permission test is bypassed at boot
    apparmor: fix invalid reference to index variable of iterator line 836
    apparmor: use SHASH_DESC_ON_STACK
    security/apparmor/lsm.c: set debug messages
    apparmor: fix boolreturn.cocci warnings
    Smack: Use GFP_KERNEL for smk_netlbl_mls().
    smack: fix double free in smack_parse_opts_str()
    KEYS: add SP800-56A KDF support for DH
    KEYS: Keyring asymmetric key restrict method with chaining
    KEYS: Restrict asymmetric key linkage using a specific keychain
    KEYS: Add a lookup_restriction function for the asymmetric key type
    KEYS: Add KEYCTL_RESTRICT_KEYRING
    KEYS: Consistent ordering for __key_link_begin and restrict check
    KEYS: Add an optional lookup_restriction hook to key_type
    ...

    Linus Torvalds
     

03 Apr, 2017

1 commit

  • ./lib/string.c:134: WARNING: Inline emphasis start-string without end-string.
    ./mm/filemap.c:522: WARNING: Inline interpreted text or phrase reference start-string without end-string.
    ./mm/filemap.c:1283: ERROR: Unexpected indentation.
    ./mm/filemap.c:3003: WARNING: Inline interpreted text or phrase reference start-string without end-string.
    ./mm/vmalloc.c:1544: WARNING: Inline emphasis start-string without end-string.
    ./mm/page_alloc.c:4245: ERROR: Unexpected indentation.
    ./ipc/util.c:676: ERROR: Unexpected indentation.
    ./drivers/pci/irq.c:35: WARNING: Block quote ends without a blank line; unexpected unindent.
    ./security/security.c:109: ERROR: Unexpected indentation.
    ./security/security.c:110: WARNING: Definition list ends without a blank line; unexpected unindent.
    ./block/genhd.c:275: WARNING: Inline strong start-string without end-string.
    ./block/genhd.c:283: WARNING: Inline strong start-string without end-string.
    ./include/linux/clk.h:134: WARNING: Inline emphasis start-string without end-string.
    ./include/linux/clk.h:134: WARNING: Inline emphasis start-string without end-string.
    ./ipc/util.c:477: ERROR: Unknown target name: "s".

    Signed-off-by: Mauro Carvalho Chehab
    Acked-by: Bjorn Helgaas
    Signed-off-by: Jonathan Corbet

    mchehab@s-opensource.com
     

28 Mar, 2017

1 commit

  • We switched from "struct task_struct"->security to "struct cred"->security
    in Linux 2.6.29. But not all LSM modules were happy with that change.
    TOMOYO LSM module is an example which want to use per "struct task_struct"
    security blob, for TOMOYO's security context is defined based on "struct
    task_struct" rather than "struct cred". AppArmor LSM module is another
    example which want to use it, for AppArmor is currently abusing the cred
    a little bit to store the change_hat and setexeccon info. Although
    security_task_free() hook was revived in Linux 3.4 because Yama LSM module
    wanted to release per "struct task_struct" security blob,
    security_task_alloc() hook and "struct task_struct"->security field were
    not revived. Nowadays, we are getting proposals of lightweight LSM modules
    which want to use per "struct task_struct" security blob.

    We are already allowing multiple concurrent LSM modules (up to one fully
    armored module which uses "struct cred"->security field or exclusive hooks
    like security_xfrm_state_pol_flow_match(), plus unlimited number of
    lightweight modules which do not use "struct cred"->security nor exclusive
    hooks) as long as they are built into the kernel. But this patch does not
    implement variable length "struct task_struct"->security field which will
    become needed when multiple LSM modules want to use "struct task_struct"->
    security field. Although it won't be difficult to implement variable length
    "struct task_struct"->security field, let's think about it after we merged
    this patch.

    Signed-off-by: Tetsuo Handa
    Acked-by: John Johansen
    Acked-by: Serge Hallyn
    Acked-by: Casey Schaufler
    Tested-by: Djalal Harouni
    Acked-by: José Bollo
    Cc: Paul Moore
    Cc: Stephen Smalley
    Cc: Eric Paris
    Cc: Kees Cook
    Cc: James Morris
    Cc: José Bollo
    Signed-off-by: James Morris

    Tetsuo Handa
     

24 Mar, 2017

1 commit

  • "struct security_hook_heads" is an array of "struct list_head"
    where elements can be initialized just before registration.

    There is no need to waste 350+ lines for initialization. Let's
    initialize "struct security_hook_heads" just before registration.

    Signed-off-by: Tetsuo Handa
    Acked-by: Kees Cook
    Cc: John Johansen
    Cc: Kees Cook
    Cc: Paul Moore
    Cc: Stephen Smalley
    Cc: Casey Schaufler
    Cc: James Morris
    Signed-off-by: James Morris

    Tetsuo Handa
     

06 Mar, 2017

2 commits

  • Mark all of the registration hooks as __ro_after_init (via the
    __lsm_ro_after_init macro).

    Signed-off-by: James Morris
    Acked-by: Stephen Smalley
    Acked-by: Kees Cook

    James Morris
     
  • When SELinux was first added to the kernel, a process could only get
    and set its own resource limits via getrlimit(2) and setrlimit(2), so no
    MAC checks were required for those operations, and thus no security hooks
    were defined for them. Later, SELinux introduced a hook for setlimit(2)
    with a check if the hard limit was being changed in order to be able to
    rely on the hard limit value as a safe reset point upon context
    transitions.

    Later on, when prlimit(2) was added to the kernel with the ability to get
    or set resource limits (hard or soft) of another process, LSM/SELinux was
    not updated other than to pass the target process to the setrlimit hook.
    This resulted in incomplete control over both getting and setting the
    resource limits of another process.

    Add a new security_task_prlimit() hook to the check_prlimit_permission()
    function to provide complete mediation. The hook is only called when
    acting on another task, and only if the existing DAC/capability checks
    would allow access. Pass flags down to the hook to indicate whether the
    prlimit(2) call will read, write, or both read and write the resource
    limits of the target process.

    The existing security_task_setrlimit() hook is left alone; it continues
    to serve a purpose in supporting the ability to make decisions based on
    the old and/or new resource limit values when setting limits. This
    is consistent with the DAC/capability logic, where
    check_prlimit_permission() performs generic DAC/capability checks for
    acting on another task, while do_prlimit() performs a capability check
    based on a comparison of the old and new resource limits. Fix the
    inline documentation for the hook to match the code.

    Implement the new hook for SELinux. For setting resource limits, we
    reuse the existing setrlimit permission. Note that this does overload
    the setrlimit permission to mean the ability to set the resource limit
    (soft or hard) of another process or the ability to change one's own
    hard limit. For getting resource limits, a new getrlimit permission
    is defined. This was not originally defined since getrlimit(2) could
    only be used to obtain a process' own limits.

    Signed-off-by: Stephen Smalley
    Signed-off-by: James Morris

    Stephen Smalley
     

10 Feb, 2017

1 commit


19 Jan, 2017

1 commit

  • I am still tired of having to find indirect ways to determine
    what security modules are active on a system. I have added
    /sys/kernel/security/lsm, which contains a comma separated
    list of the active security modules. No more groping around
    in /proc/filesystems or other clever hacks.

    Unchanged from previous versions except for being updated
    to the latest security next branch.

    Signed-off-by: Casey Schaufler
    Acked-by: John Johansen
    Acked-by: Paul Moore
    Acked-by: Kees Cook
    Signed-off-by: James Morris

    Casey Schaufler
     

13 Jan, 2017

1 commit

  • As reported by yangshukui, a permission denial from security_task_wait()
    can lead to a soft lockup in zap_pid_ns_processes() since it only expects
    sys_wait4() to return 0 or -ECHILD. Further, security_task_wait() can
    in general lead to zombies; in the absence of some way to automatically
    reparent a child process upon a denial, the hook is not useful. Remove
    the security hook and its implementations in SELinux and Smack. Smack
    already removed its check from its hook.

    Reported-by: yangshukui
    Signed-off-by: Stephen Smalley
    Acked-by: Casey Schaufler
    Acked-by: Oleg Nesterov
    Signed-off-by: Paul Moore

    Stephen Smalley
     

09 Jan, 2017

1 commit

  • Processes can only alter their own security attributes via
    /proc/pid/attr nodes. This is presently enforced by each individual
    security module and is also imposed by the Linux credentials
    implementation, which only allows a task to alter its own credentials.
    Move the check enforcing this restriction from the individual
    security modules to proc_pid_attr_write() before calling the security hook,
    and drop the unnecessary task argument to the security hook since it can
    only ever be the current task.

    Signed-off-by: Stephen Smalley
    Acked-by: Casey Schaufler
    Acked-by: John Johansen
    Signed-off-by: Paul Moore

    Stephen Smalley
     

09 Aug, 2016

3 commits

  • During a new file creation we need to make sure new file is created with the
    right label. New file is created in upper/ so effectively file should get
    label as if task had created file in upper/.

    We switched to mounter's creds for actual file creation. Also if there is a
    whiteout present, then file will be created in work/ dir first and then
    renamed in upper. In none of the cases file will be labeled as we want it to
    be.

    This patch introduces a new hook dentry_create_files_as(), which determines
    the label/context dentry will get if it had been created by task in upper
    and modify passed set of creds appropriately. Caller makes use of these new
    creds for file creation.

    Signed-off-by: Vivek Goyal
    Acked-by: Stephen Smalley
    [PM: fix whitespace issues found with checkpatch.pl]
    [PM: changes to use stat->mode in ovl_create_or_link()]
    Signed-off-by: Paul Moore

    Vivek Goyal
     
  • Provide a security hook which is called when xattrs of a file are being
    copied up. This hook is called once for each xattr and LSM can return
    0 if the security module wants the xattr to be copied up, 1 if the
    security module wants the xattr to be discarded on the copy, -EOPNOTSUPP
    if the security module does not handle/manage the xattr, or a -errno
    upon an error.

    Signed-off-by: David Howells
    Signed-off-by: Vivek Goyal
    Acked-by: Stephen Smalley
    [PM: whitespace cleanup for checkpatch.pl]
    Signed-off-by: Paul Moore

    Vivek Goyal
     
  • Provide a security hook to label new file correctly when a file is copied
    up from lower layer to upper layer of a overlay/union mount.

    This hook can prepare a new set of creds which are suitable for new file
    creation during copy up. Caller will use new creds to create file and then
    revert back to old creds and release new creds.

    Signed-off-by: Vivek Goyal
    Acked-by: Stephen Smalley
    [PM: whitespace cleanup to appease checkpatch.pl]
    Signed-off-by: Paul Moore

    Vivek Goyal
     

06 Aug, 2016

1 commit

  • Pull qstr constification updates from Al Viro:
    "Fairly self-contained bunch - surprising lot of places passes struct
    qstr * as an argument when const struct qstr * would suffice; it
    complicates analysis for no good reason.

    I'd prefer to feed that separately from the assorted fixes (those are
    in #for-linus and with somewhat trickier topology)"

    * 'work.const-qstr' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
    qstr: constify instances in adfs
    qstr: constify instances in lustre
    qstr: constify instances in f2fs
    qstr: constify instances in ext2
    qstr: constify instances in vfat
    qstr: constify instances in procfs
    qstr: constify instances in fuse
    qstr constify instances in fs/dcache.c
    qstr: constify instances in nfs
    qstr: constify instances in ocfs2
    qstr: constify instances in autofs4
    qstr: constify instances in hfs
    qstr: constify instances in hfsplus
    qstr: constify instances in logfs
    qstr: constify dentry_init_security

    Linus Torvalds
     

21 Jul, 2016

1 commit


06 Jun, 2016

1 commit

  • Serge Hallyn pointed out that the current implementation of
    security_inode_getsecurity() works if there is only one hook
    provided for it, but will fail if there is more than one and
    the attribute requested isn't supplied by the first module.
    This isn't a problem today, since only SELinux and Smack
    provide this hook and there is (currently) no way to enable
    both of those modules at the same time. Serge, however, wants
    to introduce a capability attribute and an inode_getsecurity
    hook in the capability security module to handle it. This
    addresses that upcoming problem, will be required for "extreme
    stacking" and is just a better implementation.

    Signed-off-by: Casey Schaufler
    Acked-by: Serge Hallyn
    Signed-off-by: James Morris

    Casey Schaufler
     

20 May, 2016

1 commit

  • Pull security subsystem updates from James Morris:
    "Highlights:

    - A new LSM, "LoadPin", from Kees Cook is added, which allows forcing
    of modules and firmware to be loaded from a specific device (this
    is from ChromeOS, where the device as a whole is verified
    cryptographically via dm-verity).

    This is disabled by default but can be configured to be enabled by
    default (don't do this if you don't know what you're doing).

    - Keys: allow authentication data to be stored in an asymmetric key.
    Lots of general fixes and updates.

    - SELinux: add restrictions for loading of kernel modules via
    finit_module(). Distinguish non-init user namespace capability
    checks. Apply execstack check on thread stacks"

    * 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security: (48 commits)
    LSM: LoadPin: provide enablement CONFIG
    Yama: use atomic allocations when reporting
    seccomp: Fix comment typo
    ima: add support for creating files using the mknodat syscall
    ima: fix ima_inode_post_setattr
    vfs: forbid write access when reading a file into memory
    fs: fix over-zealous use of "const"
    selinux: apply execstack check on thread stacks
    selinux: distinguish non-init user namespace capability checks
    LSM: LoadPin for kernel file loading restrictions
    fs: define a string representation of the kernel_read_file_id enumeration
    Yama: consolidate error reporting
    string_helpers: add kstrdup_quotable_file
    string_helpers: add kstrdup_quotable_cmdline
    string_helpers: add kstrdup_quotable
    selinux: check ss_initialized before revalidating an inode label
    selinux: delay inode label lookup as long as possible
    selinux: don't revalidate an inode's label when explicitly setting it
    selinux: Change bool variable name to index.
    KEYS: Add KEYCTL_DH_COMPUTE command
    ...

    Linus Torvalds
     

18 May, 2016

1 commit

  • Pull 'struct path' constification update from Al Viro:
    "'struct path' is passed by reference to a bunch of Linux security
    methods; in theory, there's nothing to stop them from modifying the
    damn thing and LSM community being what it is, sooner or later some
    enterprising soul is going to decide that it's a good idea.

    Let's remove the temptation and constify all of those..."

    * 'work.const-path' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
    constify ima_d_path()
    constify security_sb_pivotroot()
    constify security_path_chroot()
    constify security_path_{link,rename}
    apparmor: remove useless checks for NULL ->mnt
    constify security_path_{mkdir,mknod,symlink}
    constify security_path_{unlink,rmdir}
    apparmor: constify common_perm_...()
    apparmor: constify aa_path_link()
    apparmor: new helper - common_path_perm()
    constify chmod_common/security_path_chmod
    constify security_sb_mount()
    constify chown_common/security_path_chown
    tomoyo: constify assorted struct path *
    apparmor_path_truncate(): path->mnt is never NULL
    constify vfs_truncate()
    constify security_path_truncate()
    [apparmor] constify struct path * in a bunch of helpers

    Linus Torvalds
     

23 Apr, 2016

1 commit

  • security_settime() uses a timespec, which is not year 2038 safe
    on 32bit systems. Thus this patch introduces the security_settime64()
    function with timespec64 type. We also convert the cap_settime() helper
    function to use the 64bit types.

    This patch then moves security_settime() to the header file as an
    inline helper function so that existing users can be iteratively
    converted.

    None of the existing hooks is using the timespec argument and therefor
    the patch is not making any functional changes.

    Cc: Serge Hallyn ,
    Cc: James Morris ,
    Cc: "Serge E. Hallyn" ,
    Cc: Paul Moore
    Cc: Stephen Smalley
    Cc: Kees Cook
    Cc: Prarit Bhargava
    Cc: Richard Cochran
    Cc: Thomas Gleixner
    Cc: Ingo Molnar
    Reviewed-by: James Morris
    Signed-off-by: Baolin Wang
    [jstultz: Reworded commit message]
    Signed-off-by: John Stultz

    Baolin Wang
     

21 Apr, 2016

1 commit

  • This LSM enforces that kernel-loaded files (modules, firmware, etc)
    must all come from the same filesystem, with the expectation that
    such a filesystem is backed by a read-only device such as dm-verity
    or CDROM. This allows systems that have a verified and/or unchangeable
    filesystem to enforce module and firmware loading restrictions without
    needing to sign the files individually.

    Signed-off-by: Kees Cook
    Acked-by: Serge Hallyn
    Signed-off-by: James Morris

    Kees Cook
     

11 Apr, 2016

1 commit

  • The skb_owned_by hook was added with the commit ca10b9e9a8ca
    ("selinux: add a skb_owned_by() hook") and later removed
    when said commit was reverted.

    Later on, when switching to list of hooks, a field named
    'skb_owned_by' was included into the security_hook_head struct,
    but without any users nor caller.

    This commit removes the said left-over field.

    Fixes: b1d9e6b0646d ("LSM: Switch to lists of hooks")
    Signed-off-by: Paolo Abeni
    Acked-by: Casey Schaufler
    Acked-by: Paul Moore
    Signed-off-by: James Morris

    Paolo Abeni
     

28 Mar, 2016

8 commits