06 Apr, 2019

1 commit

  • [ Upstream commit 53e0c2aa9a59a48e3798ef193d573ade85aa80f5 ]

    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: Ondrej Mosnacek
    Reviewed-by: Stephen Smalley
    Signed-off-by: Paul Moore
    Signed-off-by: Sasha Levin

    Ondrej Mosnacek
     

24 Mar, 2019

3 commits

  • commit 3815a245b50124f0865415dcb606a034e97494d4 upstream.

    In the case when we're reusing a superblock, selinux_sb_clone_mnt_opts()
    fails to set set_kern_flags, with the result that
    nfs_clone_sb_security() incorrectly clears NFS_CAP_SECURITY_LABEL.

    The result is that if you mount the same NFS filesystem twice, NFS
    security labels are turned off, even if they would work fine if you
    mounted the filesystem only once.

    ("fixes" may be not exactly the right tag, it may be more like
    "fixed-other-cases-but-missed-this-one".)

    Cc: Scott Mayhew
    Cc: stable@vger.kernel.org
    Fixes: 0b4d3452b8b4 "security/selinux: allow security_sb_clone_mnt_opts..."
    Signed-off-by: J. Bruce Fields
    Acked-by: Stephen Smalley
    Signed-off-by: Paul Moore
    Signed-off-by: Greg Kroah-Hartman

    J. Bruce Fields
     
  • commit 292c997a1970f8d1e1dfa354ed770a22f7b5a434 upstream.

    As does in __sctp_connect(), when checking addrs in a while loop, after
    get the addr len according to sa_family, it's necessary to do the check
    walk_size + af->sockaddr_len > addrs_size to make sure it won't access
    an out-of-bounds addr.

    The same thing is needed in selinux_sctp_bind_connect(), otherwise an
    out-of-bounds issue can be triggered:

    [14548.772313] BUG: KASAN: slab-out-of-bounds in selinux_sctp_bind_connect+0x1aa/0x1f0
    [14548.927083] Call Trace:
    [14548.938072] dump_stack+0x9a/0xe9
    [14548.953015] print_address_description+0x65/0x22e
    [14548.996524] kasan_report.cold.6+0x92/0x1a6
    [14549.015335] selinux_sctp_bind_connect+0x1aa/0x1f0
    [14549.036947] security_sctp_bind_connect+0x58/0x90
    [14549.058142] __sctp_setsockopt_connectx+0x5a/0x150 [sctp]
    [14549.081650] sctp_setsockopt.part.24+0x1322/0x3ce0 [sctp]

    Cc: stable@vger.kernel.org
    Fixes: d452930fd3b9 ("selinux: Add SCTP support")
    Reported-by: Chunyu Hu
    Signed-off-by: Xin Long
    Reviewed-by: Marcelo Ricardo Leitner
    Signed-off-by: Paul Moore
    Signed-off-by: Greg Kroah-Hartman

    Xin Long
     
  • [ Upstream commit 822ad64d7e46a8e2c8b8a796738d7b657cbb146d ]

    In the request_key() upcall mechanism there's a dependency loop by which if
    a key type driver overrides the ->request_key hook and the userspace side
    manages to lose the authorisation key, the auth key and the internal
    construction record (struct key_construction) can keep each other pinned.

    Fix this by the following changes:

    (1) Killing off the construction record and using the auth key instead.

    (2) Including the operation name in the auth key payload and making the
    payload available outside of security/keys/.

    (3) The ->request_key hook is given the authkey instead of the cons
    record and operation name.

    Changes (2) and (3) allow the auth key to naturally be cleaned up if the
    keyring it is in is destroyed or cleared or the auth key is unlinked.

    Fixes: 7ee02a316600 ("keys: Fix dependency loop between construction record and auth key")
    Signed-off-by: David Howells
    Signed-off-by: James Morris
    Signed-off-by: Sasha Levin

    David Howells
     

19 Mar, 2019

1 commit

  • [ Upstream commit ae3b564179bfd06f32d051b9e5d72ce4b2a07c37 ]

    Several u->addr and u->path users are not holding any locks in
    common with unix_bind(). unix_state_lock() is useless for those
    purposes.

    u->addr is assign-once and *(u->addr) is fully set up by the time
    we set u->addr (all under unix_table_lock). u->path is also
    set in the same critical area, also before setting u->addr, and
    any unix_sock with ->path filled will have non-NULL ->addr.

    So setting ->addr with smp_store_release() is all we need for those
    "lockless" users - just have them fetch ->addr with smp_load_acquire()
    and don't even bother looking at ->path if they see NULL ->addr.

    Users of ->addr and ->path fall into several classes now:
    1) ones that do smp_load_acquire(u->addr) and access *(u->addr)
    and u->path only if smp_load_acquire() has returned non-NULL.
    2) places holding unix_table_lock. These are guaranteed that
    *(u->addr) is seen fully initialized. If unix_sock is in one of the
    "bound" chains, so's ->path.
    3) unix_sock_destructor() using ->addr is safe. All places
    that set u->addr are guaranteed to have seen all stores *(u->addr)
    while holding a reference to u and unix_sock_destructor() is called
    when (atomic) refcount hits zero.
    4) unix_release_sock() using ->path is safe. unix_bind()
    is serialized wrt unix_release() (normally - by struct file
    refcount), and for the instances that had ->path set by unix_bind()
    unix_release_sock() comes from unix_release(), so they are fine.
    Instances that had it set in unix_stream_connect() either end up
    attached to a socket (in unix_accept()), in which case the call
    chain to unix_release_sock() and serialization are the same as in
    the previous case, or they never get accept'ed and unix_release_sock()
    is called when the listener is shut down and its queue gets purged.
    In that case the listener's queue lock provides the barriers needed -
    unix_stream_connect() shoves our unix_sock into listener's queue
    under that lock right after having set ->path and eventual
    unix_release_sock() caller picks them from that queue under the
    same lock right before calling unix_release_sock().
    5) unix_find_other() use of ->path is pointless, but safe -
    it happens with successful lookup by (abstract) name, so ->path.dentry
    is guaranteed to be NULL there.

    earlier-variant-reviewed-by: "Paul E. McKenney"
    Signed-off-by: Al Viro
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Al Viro
     

14 Mar, 2019

1 commit


27 Feb, 2019

2 commits

  • commit ede0fa98a900e657d1fcd80b50920efc896c1a4c upstream.

    syzbot hit the 'BUG_ON(index_key->desc_len == 0);' in __key_link_begin()
    called from construct_alloc_key() during sys_request_key(), because the
    length of the key description was never calculated.

    The problem is that we rely on ->desc_len being initialized by
    search_process_keyrings(), specifically by search_nested_keyrings().
    But, if the process isn't subscribed to any keyrings that never happens.

    Fix it by always initializing keyring_index_key::desc_len as soon as the
    description is set, like we already do in some places.

    The following program reproduces the BUG_ON() when it's run as root and
    no session keyring has been installed. If it doesn't work, try removing
    pam_keyinit.so from /etc/pam.d/login and rebooting.

    #include
    #include
    #include

    int main(void)
    {
    int id = add_key("keyring", "syz", NULL, 0, KEY_SPEC_USER_KEYRING);

    keyctl_setperm(id, KEY_OTH_WRITE);
    setreuid(5000, 5000);
    request_key("user", "desc", "", id);
    }

    Reported-by: syzbot+ec24e95ea483de0a24da@syzkaller.appspotmail.com
    Fixes: b2a4df200d57 ("KEYS: Expand the capacity of a keyring")
    Signed-off-by: Eric Biggers
    Signed-off-by: David Howells
    Cc: stable@vger.kernel.org
    Signed-off-by: James Morris
    Signed-off-by: Greg Kroah-Hartman

    Eric Biggers
     
  • commit a08bf91ce28ed3ae7b6fef35d843fef8dc8c2cd9 upstream.

    If the sysctl 'kernel.keys.maxkeys' is set to some number n, then
    actually users can only add up to 'n - 1' keys. Likewise for
    'kernel.keys.maxbytes' and the root_* versions of these sysctls. But
    these sysctls are apparently supposed to be *maximums*, as per their
    names and all documentation I could find -- the keyrings(7) man page,
    Documentation/security/keys/core.rst, and all the mentions of EDQUOT
    meaning that the key quota was *exceeded* (as opposed to reached).

    Thus, fix the code to allow reaching the quotas exactly.

    Fixes: 0b77f5bfb45c ("keys: make the keyring quotas controllable through /proc/sys")
    Cc: stable@vger.kernel.org
    Signed-off-by: Eric Biggers
    Signed-off-by: David Howells
    Signed-off-by: James Morris
    Signed-off-by: Greg Kroah-Hartman

    Eric Biggers
     

13 Feb, 2019

1 commit

  • [ Upstream commit 5b841bfab695e3b8ae793172a9ff7990f99cc3e2 ]

    Function smack_key_permission() only issues smack requests for the
    following operations:
    - KEY_NEED_READ (issues MAY_READ)
    - KEY_NEED_WRITE (issues MAY_WRITE)
    - KEY_NEED_LINK (issues MAY_WRITE)
    - KEY_NEED_SETATTR (issues MAY_WRITE)
    A blank smack request is issued in all other cases, resulting in
    smack access being granted if there is any rule defined between
    subject and object, or denied with -EACCES otherwise.

    Request MAY_READ access for KEY_NEED_SEARCH and KEY_NEED_VIEW.
    Fix the logic in the unlikely case when both MAY_READ and
    MAY_WRITE are needed. Validate access permission field for valid
    contents.

    Signed-off-by: Zoran Markovic
    Signed-off-by: Casey Schaufler
    Cc: Casey Schaufler
    Cc: James Morris
    Cc: "Serge E. Hallyn"
    Signed-off-by: Sasha Levin

    Zoran Markovic
     

26 Jan, 2019

1 commit

  • [ Upstream commit 2cbdcb882f97a45f7475c67ac6257bbc16277dfe ]

    If a superblock has the MS_SUBMOUNT flag set, we should always allow
    mounting it. These mounts are done automatically by the kernel either as
    part of mounting some parent mount (e.g. debugfs always mounts tracefs
    under "tracing" for compatibility) or they are mounted automatically as
    needed on subdirectory accesses (e.g. NFS crossmnt mounts). Since such
    automounts are either an implicit consequence of the parent mount (which
    is already checked) or they can happen during regular accesses (where it
    doesn't make sense to check against the current task's context), the
    mount permission check should be skipped for them.

    Without this patch, attempts to access contents of an automounted
    directory can cause unexpected SELinux denials.

    In the current kernel tree, the MS_SUBMOUNT flag is set only via
    vfs_submount(), which is called only from the following places:
    - AFS, when automounting special "symlinks" referencing other cells
    - CIFS, when automounting "referrals"
    - NFS, when automounting subtrees
    - debugfs, when automounting tracefs

    In all cases the submounts are meant to be transparent to the user and
    it makes sense that if mounting the master is allowed, then so should be
    the automounts. Note that CAP_SYS_ADMIN capability checking is already
    skipped for (SB_KERNMOUNT|SB_SUBMOUNT) in:
    - sget_userns() in fs/super.c:
    if (!(flags & (SB_KERNMOUNT|SB_SUBMOUNT)) &&
    !(type->fs_flags & FS_USERNS_MOUNT) &&
    !capable(CAP_SYS_ADMIN))
    return ERR_PTR(-EPERM);
    - sget() in fs/super.c:
    /* Ensure the requestor has permissions over the target filesystem */
    if (!(flags & (SB_KERNMOUNT|SB_SUBMOUNT)) && !ns_capable(user_ns, CAP_SYS_ADMIN))
    return ERR_PTR(-EPERM);

    Verified internally on patched RHEL 7.6 with a reproducer using
    NFS+httpd and selinux-tesuite.

    Fixes: 93faccbbfa95 ("fs: Better permission checking for submounts")
    Signed-off-by: Ondrej Mosnacek
    Signed-off-by: Paul Moore
    Signed-off-by: Sasha Levin

    Ondrej Mosnacek
     

23 Jan, 2019

3 commits

  • commit 5b0e7310a2a33c06edc7eb81ffc521af9b2c5610 upstream.

    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: Stephen Smalley
    Signed-off-by: Paul Moore
    Signed-off-by: Greg Kroah-Hartman

    Stephen Smalley
     
  • 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
     
  • commit 9474f4e7cd71a633fa1ef93b7daefd44bbdfd482 upstream.

    It's possible that a pid has died before we take the rcu lock, in which
    case we can't walk the ancestry list as it may be detached. Instead, check
    for death first before doing the walk.

    Reported-by: syzbot+a9ac39bf55329e206219@syzkaller.appspotmail.com
    Fixes: 2d514487faf1 ("security: Yama LSM")
    Cc: stable@vger.kernel.org
    Suggested-by: Oleg Nesterov
    Signed-off-by: Kees Cook
    Signed-off-by: James Morris
    Signed-off-by: Greg Kroah-Hartman

    Kees Cook
     

13 Jan, 2019

1 commit

  • commit 5df275cd4cf51c86d49009f1397132f284ba515e upstream.

    Do the LE conversions before doing the Infiniband-related range checks.
    The incorrect checks are otherwise causing a failure to load any policy
    with an ibendportcon rule on BE systems. This can be reproduced by
    running (on e.g. ppc64):

    cat >my_module.cil <
    Cc: Eli Cohen
    Cc: James Morris
    Cc: Doug Ledford
    Cc: # 4.13+
    Fixes: a806f7a1616f ("selinux: Create policydb version for Infiniband support")
    Signed-off-by: Ondrej Mosnacek
    Acked-by: Stephen Smalley
    Signed-off-by: Paul Moore
    Signed-off-by: Greg Kroah-Hartman

    Ondrej Mosnacek
     

08 Dec, 2018

1 commit

  • commit 598e1a42e9626213565d3b22ea948ce78556512a upstream.

    Commit 32a4f5ecd738 ("net: sched: introduce chain object to uapi")
    added new RTM_* definitions without properly updating SELinux, this
    patch adds the necessary SELinux support.

    While there was a BUILD_BUG_ON() in the SELinux code to protect from
    exactly this case, it was bypassed in the broken commit. In order to
    hopefully prevent this from happening in the future, add additional
    comments which provide some instructions on how to resolve the
    BUILD_BUG_ON() failures.

    Fixes: 32a4f5ecd738 ("net: sched: introduce chain object to uapi")
    Cc: # 4.19
    Acked-by: David S. Miller
    Signed-off-by: Paul Moore
    Signed-off-by: Greg Kroah-Hartman

    Paul Moore
     

01 Dec, 2018

1 commit

  • commit 4458bba09788e70e8fb39ad003f087cd9dfbd6ac upstream.

    syzbot is hitting warning at str_read() [1] because len parameter can
    become larger than KMALLOC_MAX_SIZE. We don't need to emit warning for
    this case.

    [1] https://syzkaller.appspot.com/bug?id=7f2f5aad79ea8663c296a2eedb81978401a908f0

    Signed-off-by: Tetsuo Handa
    Reported-by: syzbot
    Signed-off-by: Paul Moore
    Signed-off-by: Greg Kroah-Hartman

    Tetsuo Handa
     

27 Nov, 2018

1 commit

  • [ Upstream commit 250f2da49cb8e582215a65c03f50e8ddf5cd119c ]

    Syzkaller reported a OOB-read with the stacktrace below. This occurs
    inside __aa_lookupn_ns as `n` is not initialized. `n` is obtained from
    aa_splitn_fqname. In cases where `name` is invalid, aa_splitn_fqname
    returns without initializing `ns_name` and `ns_len`.

    Fix this by always initializing `ns_name` and `ns_len`.

    __dump_stack lib/dump_stack.c:77 [inline]
    dump_stack+0x1c4/0x2b4 lib/dump_stack.c:113
    print_address_description.cold.8+0x9/0x1ff mm/kasan/report.c:256
    kasan_report_error mm/kasan/report.c:354 [inline]
    kasan_report.cold.9+0x242/0x309 mm/kasan/report.c:412
    __asan_report_load1_noabort+0x14/0x20 mm/kasan/report.c:430
    memcmp+0xe3/0x160 lib/string.c:861
    strnstr+0x4b/0x70 lib/string.c:934
    __aa_lookupn_ns+0xc1/0x570 security/apparmor/policy_ns.c:209
    aa_lookupn_ns+0x88/0x1e0 security/apparmor/policy_ns.c:240
    aa_fqlookupn_profile+0x1b9/0x1010 security/apparmor/policy.c:468
    fqlookupn_profile+0x80/0xc0 security/apparmor/label.c:1844
    aa_label_strn_parse+0xa3a/0x1230 security/apparmor/label.c:1908
    aa_label_parse+0x42/0x50 security/apparmor/label.c:1943
    aa_change_profile+0x513/0x3510 security/apparmor/domain.c:1362
    apparmor_setprocattr+0xaa4/0x1150 security/apparmor/lsm.c:658
    security_setprocattr+0x66/0xc0 security/security.c:1298
    proc_pid_attr_write+0x301/0x540 fs/proc/base.c:2555
    __vfs_write+0x119/0x9f0 fs/read_write.c:485
    vfs_write+0x1fc/0x560 fs/read_write.c:549
    ksys_write+0x101/0x260 fs/read_write.c:598
    __do_sys_write fs/read_write.c:610 [inline]
    __se_sys_write fs/read_write.c:607 [inline]
    __x64_sys_write+0x73/0xb0 fs/read_write.c:607
    do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290
    entry_SYSCALL_64_after_hwframe+0x49/0xbe

    Fixes: 3b0aaf5866bf ("apparmor: add lib fn to find the "split" for fqnames")
    Reported-by: syzbot+61e4b490d9d2da591b50@syzkaller.appspotmail.com
    Signed-off-by: Zubin Mithra
    Reviewed-by: Kees Cook
    Signed-off-by: John Johansen
    Signed-off-by: Sasha Levin

    Zubin Mithra
     

21 Nov, 2018

1 commit

  • commit c138325fb8713472d5a0c3c7258b9131bab40725 upstream.

    selinux_sctp_bind_connect() must verify if the address buffer has
    sufficient length before accessing the 'sa_family' field. See
    __sctp_connect() for a similar check.

    The length of the whole address ('len') is already checked in the
    callees.

    Reported-by: Qian Cai
    Fixes: d452930fd3b9 ("selinux: Add SCTP support")
    Cc: # 4.17+
    Cc: Richard Haines
    Signed-off-by: Ondrej Mosnacek
    Tested-by: Qian Cai
    Signed-off-by: Paul Moore
    Signed-off-by: Greg Kroah-Hartman

    Ondrej Mosnacek
     

14 Nov, 2018

4 commits

  • commit a408e4a86b36bf98ad15b9ada531cf0e5118ac67 upstream.

    Open a new file instance as opposed to changing file->f_mode when
    the file is not readable. This is done to accomodate overlayfs
    stacked file operations change. The real struct file is hidden
    behind the overlays struct file. So, any file->f_mode manipulations are
    not reflected on the real struct file. Open the file again in read mode
    if original file cannot be read, read and calculate the hash.

    Signed-off-by: Goldwyn Rodrigues
    Cc: stable@vger.kernel.org (linux-4.19)
    Signed-off-by: Mimi Zohar
    Signed-off-by: Greg Kroah-Hartman

    Goldwyn Rodrigues
     
  • commit 1e4c8dafbb6bf72fb5eca035b861e39c5896c2b7 upstream.

    The 12 character temporary buffer is not necessarily long enough to hold
    a 'long' value. Increase it.

    Signed-off-by: Eric Biggers
    Cc: stable@vger.kernel.org
    Signed-off-by: Mimi Zohar
    Signed-off-by: Greg Kroah-Hartman

    Eric Biggers
     
  • commit 7bb185edb0306bb90029a5fa6b9cff900ffdbf4b upstream.

    commit 901ef845fa2469c ("selinux: allow per-file labeling for cgroupfs")
    broke mounting of cgroup2 under older SELinux policies which lacked
    a genfscon rule for cgroup2. This prevents mounting of cgroup2 even
    when SELinux is permissive.

    Change the handling when there is no genfscon rule in policy to
    just mark the inode unlabeled and not return an error to the caller.
    This permits mounting and access if allowed by policy, e.g. to
    unconfined domains.

    I also considered changing the behavior of security_genfs_sid() to
    never return -ENOENT, but the current behavior is relied upon by
    other callers to perform caller-specific handling.

    Fixes: 901ef845fa2469c ("selinux: allow per-file labeling for cgroupfs")
    CC:
    Reported-by: Dmitry Vyukov
    Reported-by: Waiman Long
    Signed-off-by: Stephen Smalley
    Tested-by: Waiman Long
    Signed-off-by: Paul Moore
    Signed-off-by: Greg Kroah-Hartman

    Stephen Smalley
     
  • [ Upstream commit dcb569cf6ac99ca899b8109c128b6ae52477a015 ]

    This fixes a pair of problems in the Smack ptrace checks
    related to checking capabilities. In both cases, as reported
    by Lukasz Pawelczyk, the raw capability calls are used rather
    than the Smack wrapper that check addition restrictions.
    In one case, as reported by Jann Horn, the wrong task is being
    checked for capabilities.

    Signed-off-by: Casey Schaufler
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Casey Schaufler
     

25 Sep, 2018

1 commit

  • This changes UAPI, breaking iwd and libell:

    ell/key.c: In function 'kernel_dh_compute':
    ell/key.c:205:38: error: 'struct keyctl_dh_params' has no member named 'private'; did you mean 'dh_private'?
    struct keyctl_dh_params params = { .private = private,
    ^~~~~~~
    dh_private

    This reverts commit 8a2336e549d385bb0b46880435b411df8d8200e8.

    Fixes: 8a2336e549d3 ("uapi/linux/keyctl.h: don't use C++ reserved keyword as a struct member name")
    Signed-off-by: Lubomir Rintel
    Signed-off-by: David Howells
    cc: Randy Dunlap
    cc: Mat Martineau
    cc: Stephan Mueller
    cc: James Morris
    cc: "Serge E. Hallyn"
    cc: Mat Martineau
    cc: Andrew Morton
    cc: Linus Torvalds
    cc:
    Signed-off-by: James Morris
    Signed-off-by: Greg Kroah-Hartman

    Lubomir Rintel
     

14 Sep, 2018

1 commit

  • This reverts commit 1f40a46cf47c12d93a5ad9dccd82bd36ff8f956a.

    It turned out that this patch is not sufficient to enable PTI on 32 bit
    systems with legacy 2-level page-tables. In this paging mode the huge-page
    PTEs are in the top-level page-table directory, where also the mirroring to
    the user-space page-table happens. So every huge PTE exits twice, in the
    kernel and in the user page-table.

    That means that accessed/dirty bits need to be fetched from two PTEs in
    this mode to be safe, but this is not trivial to implement because it needs
    changes to generic code just for the sake of enabling PTI with 32-bit
    legacy paging. As all systems that need PTI should support PAE anyway,
    remove support for PTI when 32-bit legacy paging is used.

    Fixes: 7757d607c6b3 ('x86/pti: Allow CONFIG_PAGE_TABLE_ISOLATION for x86_32')
    Reported-by: Meelis Roos
    Signed-off-by: Joerg Roedel
    Signed-off-by: Thomas Gleixner
    Cc: hpa@zytor.com
    Cc: linux-mm@kvack.org
    Cc: Linus Torvalds
    Cc: Andy Lutomirski
    Cc: Dave Hansen
    Cc: Borislav Petkov
    Cc: Andrea Arcangeli
    Link: https://lkml.kernel.org/r/1536922754-31379-1-git-send-email-joro@8bytes.org

    Joerg Roedel
     

07 Sep, 2018

1 commit


05 Sep, 2018

1 commit

  • Since this header is in "include/uapi/linux/", apparently people want to
    use it in userspace programs -- even in C++ ones. However, the header
    uses a C++ reserved keyword ("private"), so change that to "dh_private"
    instead to allow the header file to be used in C++ userspace.

    Fixes https://bugzilla.kernel.org/show_bug.cgi?id=191051
    Link: http://lkml.kernel.org/r/0db6c314-1ef4-9bfa-1baa-7214dd2ee061@infradead.org
    Fixes: ddbb41148724 ("KEYS: Add KEYCTL_DH_COMPUTE command")
    Signed-off-by: Randy Dunlap
    Reviewed-by: Andrew Morton
    Cc: David Howells
    Cc: James Morris
    Cc: "Serge E. Hallyn"
    Cc: Mat Martineau
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Randy Dunlap
     

04 Sep, 2018

1 commit

  • apparmor_secid_to_secctx() has a bad debug statement tripping on a
    condition handle by the code. When kconfig SECURITY_APPARMOR_DEBUG is
    enabled the debug WARN_ON will trip when **secdata is NULL resulting
    in the following trace.

    ------------[ cut here ]------------
    AppArmor WARN apparmor_secid_to_secctx: ((!secdata)):
    WARNING: CPU: 0 PID: 14826 at security/apparmor/secid.c:82 apparmor_secid_to_secctx+0x2b5/0x2f0 security/apparmor/secid.c:82
    Kernel panic - not syncing: panic_on_warn set ...

    CPU: 0 PID: 14826 Comm: syz-executor1 Not tainted 4.19.0-rc1+ #193
    Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
    Call Trace:
    __dump_stack lib/dump_stack.c:77 [inline]
    dump_stack+0x1c9/0x2b4 lib/dump_stack.c:113
    panic+0x238/0x4e7 kernel/panic.c:184
    __warn.cold.8+0x163/0x1ba kernel/panic.c:536
    report_bug+0x252/0x2d0 lib/bug.c:186
    fixup_bug arch/x86/kernel/traps.c:178 [inline]
    do_error_trap+0x1fc/0x4d0 arch/x86/kernel/traps.c:296
    do_invalid_op+0x1b/0x20 arch/x86/kernel/traps.c:316
    invalid_op+0x14/0x20 arch/x86/entry/entry_64.S:993
    RIP: 0010:apparmor_secid_to_secctx+0x2b5/0x2f0 security/apparmor/secid.c:82
    Code: c7 c7 40 66 58 87 e8 6a 6d 0f fe 0f 0b e9 6c fe ff ff e8 3e aa 44 fe 48 c7 c6 80 67 58 87 48 c7 c7 a0 65 58 87 e8 4b 6d 0f fe 0b e9 3f fe ff ff 48 89 df e8 fc a7 83 fe e9 ed fe ff ff bb f4
    RSP: 0018:ffff8801ba1bed10 EFLAGS: 00010286
    RAX: 0000000000000000 RBX: ffff8801ba1beed0 RCX: ffffc9000227e000
    RDX: 0000000000018482 RSI: ffffffff8163ac01 RDI: 0000000000000001
    RBP: ffff8801ba1bed30 R08: ffff8801b80ec080 R09: ffffed003b603eca
    R10: ffffed003b603eca R11: ffff8801db01f657 R12: 0000000000000001
    R13: 0000000000000000 R14: 0000000000000000 R15: ffff8801ba1beed0
    security_secid_to_secctx+0x63/0xc0 security/security.c:1314
    ctnetlink_secctx_size net/netfilter/nf_conntrack_netlink.c:621 [inline]
    ctnetlink_nlmsg_size net/netfilter/nf_conntrack_netlink.c:659 [inline]
    ctnetlink_conntrack_event+0x303/0x1470 net/netfilter/nf_conntrack_netlink.c:706
    nf_conntrack_eventmask_report+0x55f/0x930 net/netfilter/nf_conntrack_ecache.c:151
    nf_conntrack_event_report include/net/netfilter/nf_conntrack_ecache.h:112 [inline]
    nf_ct_delete+0x33c/0x5d0 net/netfilter/nf_conntrack_core.c:601
    nf_ct_iterate_cleanup+0x48c/0x5e0 net/netfilter/nf_conntrack_core.c:1892
    nf_ct_iterate_cleanup_net+0x23c/0x2d0 net/netfilter/nf_conntrack_core.c:1974
    ctnetlink_flush_conntrack net/netfilter/nf_conntrack_netlink.c:1226 [inline]
    ctnetlink_del_conntrack+0x66c/0x850 net/netfilter/nf_conntrack_netlink.c:1258
    nfnetlink_rcv_msg+0xd88/0x1070 net/netfilter/nfnetlink.c:228
    netlink_rcv_skb+0x172/0x440 net/netlink/af_netlink.c:2454
    nfnetlink_rcv+0x1c0/0x4d0 net/netfilter/nfnetlink.c:560
    netlink_unicast_kernel net/netlink/af_netlink.c:1317 [inline]
    netlink_unicast+0x5a0/0x760 net/netlink/af_netlink.c:1343
    netlink_sendmsg+0xa18/0xfc0 net/netlink/af_netlink.c:1908
    sock_sendmsg_nosec net/socket.c:621 [inline]
    sock_sendmsg+0xd5/0x120 net/socket.c:631
    ___sys_sendmsg+0x7fd/0x930 net/socket.c:2114
    __sys_sendmsg+0x11d/0x290 net/socket.c:2152
    __do_sys_sendmsg net/socket.c:2161 [inline]
    __se_sys_sendmsg net/socket.c:2159 [inline]
    __x64_sys_sendmsg+0x78/0xb0 net/socket.c:2159
    do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290
    entry_SYSCALL_64_after_hwframe+0x49/0xbe
    RIP: 0033:0x457089
    Code: fd b4 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 3d 01 f0 ff ff 0f 83 cb b4 fb ff c3 66 2e 0f 1f 84 00 00 00 00
    RSP: 002b:00007f7bc6e03c78 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
    RAX: ffffffffffffffda RBX: 00007f7bc6e046d4 RCX: 0000000000457089
    RDX: 0000000000000000 RSI: 0000000020d65000 RDI: 0000000000000003
    RBP: 00000000009300a0 R08: 0000000000000000 R09: 0000000000000000
    R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff
    R13: 00000000004d4588 R14: 00000000004c8d5c R15: 0000000000000000
    Dumping ftrace buffer:
    (ftrace buffer empty)
    Kernel Offset: disabled
    Rebooting in 86400 seconds..

    CC: #4.18
    Fixes: c092921219d2 ("apparmor: add support for mapping secids and using secctxes")
    Reported-by: syzbot+21016130b0580a9de3b5@syzkaller.appspotmail.com
    Signed-off-by: John Johansen

    John Johansen
     

25 Aug, 2018

2 commits

  • …git/jj/linux-apparmor

    Pull apparmor updates from John Johansen:
    "There is nothing major this time just four bug fixes and a patch to
    remove some dead code:

    Cleanups:
    - remove no-op permission check in policy_unpack

    Bug fixes:
    - fix an error code in __aa_create_ns()
    - fix failure to audit context info in build_change_hat
    - check buffer bounds when mapping permissions mask
    - fully initialize aa_perms struct when answering userspace query"

    * tag 'apparmor-pr-2018-08-23' of git://git.kernel.org/pub/scm/linux/kernel/git/jj/linux-apparmor:
    apparmor: remove no-op permission check in policy_unpack
    apparmor: fix an error code in __aa_create_ns()
    apparmor: Fix failure to audit context info in build_change_hat
    apparmor: Fully initialize aa_perms struct when answering userspace query
    apparmor: Check buffer bounds when mapping permissions mask

    Linus Torvalds
     
  • Pull namespace fixes from Eric Biederman:
    "This is a set of four fairly obvious bug fixes:

    - a switch from d_find_alias to d_find_any_alias because the xattr
    code perversely takes a dentry

    - two mutex vs copy_to_user fixes from Jann Horn

    - a fix to use a sanitized size not the size userspace passed in from
    Christian Brauner"

    * 'userns-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace:
    getxattr: use correct xattr length
    sys: don't hold uts_sem while accessing userspace memory
    userns: move user access out of the mutex
    cap_inode_getsecurity: use d_find_any_alias() instead of d_find_alias()

    Linus Torvalds
     

23 Aug, 2018

2 commits

  • The patch 736ec752d95e: "AppArmor: policy routines for loading and
    unpacking policy" from Jul 29, 2010, leads to the following static
    checker warning:

    security/apparmor/policy_unpack.c:410 verify_accept()
    warn: bitwise AND condition is false here

    security/apparmor/policy_unpack.c:413 verify_accept()
    warn: bitwise AND condition is false here

    security/apparmor/policy_unpack.c
    392 #define DFA_VALID_PERM_MASK 0xffffffff
    393 #define DFA_VALID_PERM2_MASK 0xffffffff
    394
    395 /**
    396 * verify_accept - verify the accept tables of a dfa
    397 * @dfa: dfa to verify accept tables of (NOT NULL)
    398 * @flags: flags governing dfa
    399 *
    400 * Returns: 1 if valid accept tables else 0 if error
    401 */
    402 static bool verify_accept(struct aa_dfa *dfa, int flags)
    403 {
    404 int i;
    405
    406 /* verify accept permissions */
    407 for (i = 0; i < dfa->tables[YYTD_ID_ACCEPT]->td_lolen; i++) {
    408 int mode = ACCEPT_TABLE(dfa)[i];
    409
    410 if (mode & ~DFA_VALID_PERM_MASK)
    411 return 0;
    412
    413 if (ACCEPT_TABLE2(dfa)[i] & ~DFA_VALID_PERM2_MASK)
    414 return 0;

    fixes: 736ec752d95e ("AppArmor: policy routines for loading and unpacking policy")
    Reported-by: Dan Carpenter
    Signed-off-by: John Johansen

    John Johansen
     
  • Allow the initcall tables to be emitted using relative references that
    are only half the size on 64-bit architectures and don't require fixups
    at runtime on relocatable kernels.

    Link: http://lkml.kernel.org/r/20180704083651.24360-5-ard.biesheuvel@linaro.org
    Acked-by: James Morris
    Acked-by: Sergey Senozhatsky
    Acked-by: Petr Mladek
    Acked-by: Michael Ellerman
    Acked-by: Ingo Molnar
    Signed-off-by: Ard Biesheuvel
    Cc: Arnd Bergmann
    Cc: Benjamin Herrenschmidt
    Cc: Bjorn Helgaas
    Cc: Catalin Marinas
    Cc: James Morris
    Cc: Jessica Yu
    Cc: Josh Poimboeuf
    Cc: Kees Cook
    Cc: Nicolas Pitre
    Cc: Paul Mackerras
    Cc: Russell King
    Cc: "Serge E. Hallyn"
    Cc: Steven Rostedt
    Cc: Thomas Garnier
    Cc: Thomas Gleixner
    Cc: Will Deacon
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ard Biesheuvel
     

22 Aug, 2018

1 commit


16 Aug, 2018

8 commits

  • …morris/linux-security

    Pull integrity updates from James Morris:
    "This adds support for EVM signatures based on larger digests, contains
    a new audit record AUDIT_INTEGRITY_POLICY_RULE to differentiate the
    IMA policy rules from the IMA-audit messages, addresses two deadlocks
    due to either loading or searching for crypto algorithms, and cleans
    up the audit messages"

    * 'next-integrity' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security:
    EVM: fix return value check in evm_write_xattrs()
    integrity: prevent deadlock during digsig verification.
    evm: Allow non-SHA1 digital signatures
    evm: Don't deadlock if a crypto algorithm is unavailable
    integrity: silence warning when CONFIG_SECURITYFS is not enabled
    ima: Differentiate auditing policy rules from "audit" actions
    ima: Do not audit if CONFIG_INTEGRITY_AUDIT is not set
    ima: Use audit_log_format() rather than audit_log_string()
    ima: Call audit_log_string() rather than logging it untrusted

    Linus Torvalds
     
  • Pull TPM updates from James Morris:

    - Migrate away from PM runtime as explicit cmdReady/goIdle transactions
    for every command is a spec requirement. PM runtime adds only a layer
    of complexity on our case.

    - tpm_tis drivers can now specify the hwrng quality.

    - TPM 2.0 code uses now tpm_buf for constructing messages. Jarkko
    thinks Tomas Winkler has done the same for TPM 1.2, and will start
    digging those changes from the patchwork in the near future.

    - Bug fixes and clean ups

    * 'next-tpm' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security:
    ima: Get rid of ima_used_chip and use ima_tpm_chip != NULL instead
    ima: Use tpm_default_chip() and call TPM functions with a tpm_chip
    tpm: replace TPM_TRANSMIT_RAW with TPM_TRANSMIT_NESTED
    tpm: Convert tpm_find_get_ops() to use tpm_default_chip()
    tpm: Implement tpm_default_chip() to find a TPM chip
    tpm: rename tpm_chip_find_get() to tpm_find_get_ops()
    tpm: Allow tpm_tis drivers to set hwrng quality.
    tpm: Return the actual size when receiving an unsupported command
    tpm: separate cmd_ready/go_idle from runtime_pm
    tpm/tpm_i2c_infineon: switch to i2c_lock_bus(..., I2C_LOCK_SEGMENT)
    tpm_tis_spi: Pass the SPI IRQ down to the driver
    tpm: migrate tpm2_get_random() to use struct tpm_buf
    tpm: migrate tpm2_get_tpm_pt() to use struct tpm_buf
    tpm: migrate tpm2_probe() to use struct tpm_buf
    tpm: migrate tpm2_shutdown() to use struct tpm_buf

    Linus Torvalds
     
  • Pull smack updates from James Morris:
    "Minor fixes from Piotr Sawicki"

    * 'next-smack' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security:
    Smack: Inform peer that IPv6 traffic has been blocked
    Smack: Check UDP-Lite and DCCP protocols during IPv6 handling
    Smack: Fix handling of IPv4 traffic received by PF_INET6 sockets

    Linus Torvalds
     
  • Pull crypto updates from Herbert Xu:
    "API:
    - Fix dcache flushing crash in skcipher.
    - Add hash finup self-tests.
    - Reschedule during speed tests.

    Algorithms:
    - Remove insecure vmac and replace it with vmac64.
    - Add public key verification for DH/ECDH.

    Drivers:
    - Decrease priority of sha-mb on x86.
    - Improve NEON latency/throughput on ARM64.
    - Add md5/sha384/sha512/des/3des to inside-secure.
    - Support eip197d in inside-secure.
    - Only register algorithms supported by the host in virtio.
    - Add cts and remove incompatible cts1 from ccree.
    - Add hisilicon SEC security accelerator driver.
    - Replace msm hwrng driver with qcom pseudo rng driver.

    Misc:
    - Centralize CRC polynomials"

    * 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: (121 commits)
    crypto: arm64/ghash-ce - implement 4-way aggregation
    crypto: arm64/ghash-ce - replace NEON yield check with block limit
    crypto: hisilicon - sec_send_request() can be static
    lib/mpi: remove redundant variable esign
    crypto: arm64/aes-ce-gcm - don't reload key schedule if avoidable
    crypto: arm64/aes-ce-gcm - implement 2-way aggregation
    crypto: arm64/aes-ce-gcm - operate on two input blocks at a time
    crypto: dh - make crypto_dh_encode_key() make robust
    crypto: dh - fix calculating encoded key size
    crypto: ccp - Check for NULL PSP pointer at module unload
    crypto: arm/chacha20 - always use vrev for 16-bit rotates
    crypto: ccree - allow bigger than sector XTS op
    crypto: ccree - zero all of request ctx before use
    crypto: ccree - remove cipher ivgen left overs
    crypto: ccree - drop useless type flag during reg
    crypto: ablkcipher - fix crash flushing dcache in error path
    crypto: blkcipher - fix crash flushing dcache in error path
    crypto: skcipher - fix crash flushing dcache in error path
    crypto: skcipher - remove unnecessary setting of walk->nbytes
    crypto: scatterwalk - remove scatterwalk_samebuf()
    ...

    Linus Torvalds
     
  • Pull networking updates from David Miller:
    "Highlights:

    - Gustavo A. R. Silva keeps working on the implicit switch fallthru
    changes.

    - Support 802.11ax High-Efficiency wireless in cfg80211 et al, From
    Luca Coelho.

    - Re-enable ASPM in r8169, from Kai-Heng Feng.

    - Add virtual XFRM interfaces, which avoids all of the limitations of
    existing IPSEC tunnels. From Steffen Klassert.

    - Convert GRO over to use a hash table, so that when we have many
    flows active we don't traverse a long list during accumluation.

    - Many new self tests for routing, TC, tunnels, etc. Too many
    contributors to mention them all, but I'm really happy to keep
    seeing this stuff.

    - Hardware timestamping support for dpaa_eth/fsl-fman from Yangbo Lu.

    - Lots of cleanups and fixes in L2TP code from Guillaume Nault.

    - Add IPSEC offload support to netdevsim, from Shannon Nelson.

    - Add support for slotting with non-uniform distribution to netem
    packet scheduler, from Yousuk Seung.

    - Add UDP GSO support to mlx5e, from Boris Pismenny.

    - Support offloading of Team LAG in NFP, from John Hurley.

    - Allow to configure TX queue selection based upon RX queue, from
    Amritha Nambiar.

    - Support ethtool ring size configuration in aquantia, from Anton
    Mikaev.

    - Support DSCP and flowlabel per-transport in SCTP, from Xin Long.

    - Support list based batching and stack traversal of SKBs, this is
    very exciting work. From Edward Cree.

    - Busyloop optimizations in vhost_net, from Toshiaki Makita.

    - Introduce the ETF qdisc, which allows time based transmissions. IGB
    can offload this in hardware. From Vinicius Costa Gomes.

    - Add parameter support to devlink, from Moshe Shemesh.

    - Several multiplication and division optimizations for BPF JIT in
    nfp driver, from Jiong Wang.

    - Lots of prepatory work to make more of the packet scheduler layer
    lockless, when possible, from Vlad Buslov.

    - Add ACK filter and NAT awareness to sch_cake packet scheduler, from
    Toke Høiland-Jørgensen.

    - Support regions and region snapshots in devlink, from Alex Vesker.

    - Allow to attach XDP programs to both HW and SW at the same time on
    a given device, with initial support in nfp. From Jakub Kicinski.

    - Add TLS RX offload and support in mlx5, from Ilya Lesokhin.

    - Use PHYLIB in r8169 driver, from Heiner Kallweit.

    - All sorts of changes to support Spectrum 2 in mlxsw driver, from
    Ido Schimmel.

    - PTP support in mv88e6xxx DSA driver, from Andrew Lunn.

    - Make TCP_USER_TIMEOUT socket option more accurate, from Jon
    Maxwell.

    - Support for templates in packet scheduler classifier, from Jiri
    Pirko.

    - IPV6 support in RDS, from Ka-Cheong Poon.

    - Native tproxy support in nf_tables, from Máté Eckl.

    - Maintain IP fragment queue in an rbtree, but optimize properly for
    in-order frags. From Peter Oskolkov.

    - Improvde handling of ACKs on hole repairs, from Yuchung Cheng"

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1996 commits)
    bpf: test: fix spelling mistake "REUSEEPORT" -> "REUSEPORT"
    hv/netvsc: Fix NULL dereference at single queue mode fallback
    net: filter: mark expected switch fall-through
    xen-netfront: fix warn message as irq device name has '/'
    cxgb4: Add new T5 PCI device ids 0x50af and 0x50b0
    net: dsa: mv88e6xxx: missing unlock on error path
    rds: fix building with IPV6=m
    inet/connection_sock: prefer _THIS_IP_ to current_text_addr
    net: dsa: mv88e6xxx: bitwise vs logical bug
    net: sock_diag: Fix spectre v1 gadget in __sock_diag_cmd()
    ieee802154: hwsim: using right kind of iteration
    net: hns3: Add vlan filter setting by ethtool command -K
    net: hns3: Set tx ring' tc info when netdev is up
    net: hns3: Remove tx ring BD len register in hns3_enet
    net: hns3: Fix desc num set to default when setting channel
    net: hns3: Fix for phy link issue when using marvell phy driver
    net: hns3: Fix for information of phydev lost problem when down/up
    net: hns3: Fix for command format parsing error in hclge_is_all_function_id_zero
    net: hns3: Add support for serdes loopback selftest
    bnxt_en: take coredump_record structure off stack
    ...

    Linus Torvalds
     
  • Pull Kbuild updates from Masahiro Yamada:

    - verify depmod is installed before modules_install

    - support build salt in case build ids must be unique between builds

    - allow users to specify additional host compiler flags via HOST*FLAGS,
    and rename internal variables to KBUILD_HOST*FLAGS

    - update buildtar script to drop vax support, add arm64 support

    - update builddeb script for better debarch support

    - document the pit-fall of if_changed usage

    - fix parallel build of UML with O= option

    - make 'samples' target depend on headers_install to fix build errors

    - remove deprecated host-progs variable

    - add a new coccinelle script for refcount_t vs atomic_t check

    - improve double-test coccinelle script

    - misc cleanups and fixes

    * tag 'kbuild-v4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: (41 commits)
    coccicheck: return proper error code on fail
    Coccinelle: doubletest: reduce side effect false positives
    kbuild: remove deprecated host-progs variable
    kbuild: make samples really depend on headers_install
    um: clean up archheaders recipe
    kbuild: add %asm-generic to no-dot-config-targets
    um: fix parallel building with O= option
    scripts: Add Python 3 support to tracing/draw_functrace.py
    builddeb: Add automatic support for sh{3,4}{,eb} architectures
    builddeb: Add automatic support for riscv* architectures
    builddeb: Add automatic support for m68k architecture
    builddeb: Add automatic support for or1k architecture
    builddeb: Add automatic support for sparc64 architecture
    builddeb: Add automatic support for mips{,64}r6{,el} architectures
    builddeb: Add automatic support for mips64el architecture
    builddeb: Add automatic support for ppc64 and powerpcspe architectures
    builddeb: Introduce functions to simplify kconfig tests in set_debarch
    builddeb: Drop check for 32-bit s390
    builddeb: Change architecture detection fallback to use dpkg-architecture
    builddeb: Skip architecture detection when KBUILD_DEBARCH is set
    ...

    Linus Torvalds
     
  • Pull SELinux updates from Paul Moore:
    "There are 16 patches in here but really only one that is of any
    significance. That one patch is by nixiaoming and fixes a few places
    where we were not properly cleaning up dentry and inode objects in the
    selinuxfs error handling code. The rest are either printk->pr_*
    conversions, constification tweaks, and a minor tweak to MAINTAINERS.

    Everything passes the selinux-testsuite and looks to merge cleanly
    against your master branch"

    * tag 'selinux-pr-20180814' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux:
    selinux: cleanup dentry and inodes on error in selinuxfs
    selinux: constify write_op[]
    selinux: Cleanup printk logging in netnode
    selinux: Cleanup printk logging in avc
    selinux: Cleanup printk logging in netif
    selinux: Cleanup printk logging in netport
    selinux: Cleanup printk logging in sidtab
    selinux: Cleanup printk logging in netlink
    selinux: Cleanup printk logging in selinuxfs
    selinux: Cleanup printk logging in services
    selinux: Cleanup printk logging in avtab
    selinux: Cleanup printk logging in hooks
    selinux: Cleanup printk logging in policydb
    selinux: Cleanup printk logging in ebitmap
    selinux: Cleanup printk logging in conditional
    MAINTAINERS: update the LSM and SELinux subsystems

    Linus Torvalds
     
  • Pull security subsystem updates from James Morris:

    - kstrdup() return value fix from Eric Biggers

    - Add new security_load_data hook to differentiate security checking of
    kernel-loaded binaries in the case of there being no associated file
    descriptor, from Mimi Zohar.

    - Add ability to IMA to specify a policy at build-time, rather than
    just via command line params or by loading a custom policy, from
    Mimi.

    - Allow IMA and LSMs to prevent sysfs firmware load fallback (e.g. if
    using signed firmware), from Mimi.

    - Allow IMA to deny loading of kexec kernel images, as they cannot be
    measured by IMA, from Mimi.

    * 'next-general' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security:
    security: check for kstrdup() failure in lsm_append()
    security: export security_kernel_load_data function
    ima: based on policy warn about loading firmware (pre-allocated buffer)
    module: replace the existing LSM hook in init_module
    ima: add build time policy
    ima: based on policy require signed firmware (sysfs fallback)
    firmware: add call to LSM hook before firmware sysfs fallback
    ima: based on policy require signed kexec kernel images
    kexec: add call to LSM hook in original kexec_load syscall
    security: define new LSM hook named security_kernel_load_data
    MAINTAINERS: remove the outdated "LINUX SECURITY MODULE (LSM) FRAMEWORK" entry

    Linus Torvalds