16 Dec, 2015

1 commit


20 Nov, 2015

10 commits

  • Commit "SELinux: Enable setting security contexts on rootfs inodes."
    cherry-picked in experimental/android-4.1 used a now obsolete flag
    SE_SBLABELSUPP. Rename it to SBLABEL_MNT as intended by upstream
    commit 12f348b9dcf6 "SELinux: rename SE_SBLABELSUPP to SBLABEL_MNT",
    otherwise we run into following build error:

    CC security/selinux/hooks.o
    security/selinux/hooks.c: In function ‘sb_finish_set_opts’:
    security/selinux/hooks.c:459:19: error: ‘SE_SBLABELSUPP’ undeclared (first use in this function)
    sbsec->flags |= SE_SBLABELSUPP;
    ^
    security/selinux/hooks.c:459:19: note: each undeclared identifier is reported only once for each function it appears in
    make[2]: *** [security/selinux/hooks.o] Error 1

    Signed-off-by: Amit Pundir

    Amit Pundir
     
  • NOT intended for new Android devices - this commit is unnecessary
    for a target device that does not have a previous M variant.

    DO NOT upstream. Android only.

    Motivation:

    This commit mitigates a mismatch between selinux kernel and
    selinux userspace. The selinux ioctl white-listing binary policy
    format that was accepted into Android M differs slightly from what
    was later accepted into the upstream kernel. This leaves Android
    master branch kernels incompatible with Android M releases. This
    patch restores backwards compatibility. This is important because:

    1. kernels may be updated on a different cycle than the rest of the
    OS e.g. security patching.
    2. Android M bringup may still be ongoing for some devices. The
    same kernel should work for both M and master.

    Backwards compatibility is achieved by checking for an Android M
    policy characteristic during initial policy read and converting to
    upstream policy format. The inverse conversion is done for policy
    write as required for CTS testing.

    Bug: 22846070
    Change-Id: I2f1ee2eee402f37cf3c9df9f9e03c1b9ddec1929
    Signed-off-by: Jeff Vander Stoep

    Jeff Vander Stoep
     
  • (cherry picked from commit fa1aa143ac4a682c7f5fd52a3cf05f5a6fe44a0a)

    Add extended permissions logic to selinux. Extended permissions
    provides additional permissions in 256 bit increments. Extend the
    generic ioctl permission check to use the extended permissions for
    per-command filtering. Source/target/class sets including the ioctl
    permission may additionally include a set of commands. Example:

    allowxperm : ioctl unpriv_app_socket_cmds
    auditallowxperm : ioctl priv_gpu_cmds

    Where unpriv_app_socket_cmds and priv_gpu_cmds are macros
    representing commonly granted sets of ioctl commands.

    When ioctl commands are omitted only the permissions are checked.
    This feature is intended to provide finer granularity for the ioctl
    permission that may be too imprecise. For example, the same driver
    may use ioctls to provide important and benign functionality such as
    driver version or socket type as well as dangerous capabilities such
    as debugging features, read/write/execute to physical memory or
    access to sensitive data. Per-command filtering provides a mechanism
    to reduce the attack surface of the kernel, and limit applications
    to the subset of commands required.

    The format of the policy binary has been modified to include ioctl
    commands, and the policy version number has been incremented to
    POLICYDB_VERSION_XPERMS_IOCTL=30 to account for the format
    change.

    The extended permissions logic is deliberately generic to allow
    components to be reused e.g. netlink filters

    Signed-off-by: Jeff Vander Stoep
    Acked-by: Nick Kralevich
    Signed-off-by: Paul Moore
    Bug: 22846070
    Change-Id: I7c6bdc0362657b47aa1388936c5a1300bc5c0b42
    [jstultz: Added missing security.h include, needed to build]
    Signed-off-by: John Stultz

    Jeff Vander Stoep
     
  • (cherry pick from commit 671a2781ff01abf4fdc8904881fc3abd3a8279af)

    Add information about ioctl calls to the LSM audit data. Log the
    file path and command number.

    Signed-off-by: Jeff Vander Stoep
    Acked-by: Nick Kralevich
    [PM: subject line tweak]
    Signed-off-by: Paul Moore
    Bug: 22846070
    Change-Id: I88a6ecdd59297a315a6fb9c82c0a798bdb6bafaa

    Jeff Vander Stoep
     
  • Use the ATTR_FILE attribute to distinguish between truncate()
    and ftruncate() system calls. The two other cases where
    do_truncate is called with a filp (and therefore ATTR_FILE is set)
    are for coredump files and for open(O_TRUNC). In both of those cases
    the open permission has already been checked during file open and
    therefore does not need to be repeated.

    Commit 95dbf739313f ("SELinux: check OPEN on truncate calls")
    fixed a major issue where domains were allowed to truncate files
    without the open permission. However, it introduced a new bug where
    a domain with the write permission can no longer ftruncate files
    without the open permission, even when they receive an already open
    file.

    (cherry picked from commit b21800f304392ee5d20f411c37470183cc779f11)

    Bug: 22567870
    Change-Id: I2525a0e244c8d635b2d0c1f966071edbb365a43a

    Signed-off-by: Jeff Vander Stoep
    Acked-by: Stephen Smalley
    Signed-off-by: Paul Moore

    Jeff Vander Stoep
     
  • Support per-file labeling of sysfs and pstore files based on
    genfscon policy entries. This is safe because the sysfs
    and pstore directory tree cannot be manipulated by userspace,
    except to unlink pstore entries.
    This provides an alternative method of assigning per-file labeling
    to sysfs or pstore files without needing to set the labels from
    userspace on each boot. The advantages of this approach are that
    the labels are assigned as soon as the dentry is first instantiated
    and userspace does not need to walk the sysfs or pstore tree and
    set the labels on each boot. The limitations of this approach are
    that the labels can only be assigned based on pathname prefix matching.
    You can initially assign labels using this mechanism and then change
    them at runtime via setxattr if allowed to do so by policy.

    Change-Id: If5999785fdc1d24d869b23ae35cd302311e94562
    Signed-off-by: Stephen Smalley
    Suggested-by: Dominick Grift

    Stephen Smalley
     
  • upstream commit 6f29997f4a3117169eeabd41dbea4c1bd94a739c

    Add support for per-file labeling of debugfs files so that
    we can distinguish them in policy. This is particularly
    important in Android where certain debugfs files have to be writable
    by apps and therefore the debugfs directory tree can be read and
    searched by all.

    Since debugfs is entirely kernel-generated, the directory tree is
    immutable by userspace, and the inodes are pinned in memory, we can
    simply use the same approach as with proc and label the inodes from
    policy based on pathname from the root of the debugfs filesystem.
    Generalize the existing labeling support used for proc and reuse it
    for debugfs too.

    Change-Id: I6460fbed6bb6bd36eb8554ac8c4fdd574edf3b07
    Signed-off-by: Stephen Smalley

    Stephen Smalley
     
  • rootfs (ramfs) can support setting of security contexts
    by userspace due to the vfs fallback behavior of calling
    the security module to set the in-core inode state
    for security.* attributes when the filesystem does not
    provide an xattr handler. No xattr handler required
    as the inodes are pinned in memory and have no backing
    store.

    This is useful in allowing early userspace to label individual
    files within a rootfs while still providing a policy-defined
    default via genfs.

    Signed-off-by: Stephen Smalley
    Signed-off-by: Paul Moore
    Signed-off-by: Eric Paris

    Stephen Smalley
     
  • Commit b641072 ("security: Add AID_NET_RAW and AID_NET_ADMIN capability
    check in cap_capable().") introduces additional checks for AID_NET_xxx
    macros. Since the header file including those macros are conditionally
    included, the checks should also be conditionally executed.

    Change-Id: Iaec5208d5b95a46b1ac3f2db8449c661e803fa5b
    Signed-off-by: Tushar Behera
    Signed-off-by: Andrey Konovalov

    Tushar Behera
     
  • Signed-off-by: Chia-chi Yeh

    Chia-chi Yeh
     

22 Sep, 2015

1 commit

  • commit a068acf2ee77693e0bf39d6e07139ba704f461c3 upstream.

    Many file systems that implement the show_options hook fail to correctly
    escape their output which could lead to unescaped characters (e.g. new
    lines) leaking into /proc/mounts and /proc/[pid]/mountinfo files. This
    could lead to confusion, spoofed entries (resulting in things like
    systemd issuing false d-bus "mount" notifications), and who knows what
    else. This looks like it would only be the root user stepping on
    themselves, but it's possible weird things could happen in containers or
    in other situations with delegated mount privileges.

    Here's an example using overlay with setuid fusermount trusting the
    contents of /proc/mounts (via the /etc/mtab symlink). Imagine the use
    of "sudo" is something more sneaky:

    $ BASE="ovl"
    $ MNT="$BASE/mnt"
    $ LOW="$BASE/lower"
    $ UP="$BASE/upper"
    $ WORK="$BASE/work/ 0 0
    none /proc fuse.pwn user_id=1000"
    $ mkdir -p "$LOW" "$UP" "$WORK"
    $ sudo mount -t overlay -o "lowerdir=$LOW,upperdir=$UP,workdir=$WORK" none /mnt
    $ cat /proc/mounts
    none /root/ovl/mnt overlay rw,relatime,lowerdir=ovl/lower,upperdir=ovl/upper,workdir=ovl/work/ 0 0
    none /proc fuse.pwn user_id=1000 0 0
    $ fusermount -u /proc
    $ cat /proc/mounts
    cat: /proc/mounts: No such file or directory

    This fixes the problem by adding new seq_show_option and
    seq_show_option_n helpers, and updating the vulnerable show_option
    handlers to use them as needed. Some, like SELinux, need to be open
    coded due to unusual existing escape mechanisms.

    [akpm@linux-foundation.org: add lost chunk, per Kees]
    [keescook@chromium.org: seq_show_option should be using const parameters]
    Signed-off-by: Kees Cook
    Acked-by: Serge Hallyn
    Acked-by: Jan Kara
    Acked-by: Paul Moore
    Cc: J. R. Okajima
    Signed-off-by: Kees Cook
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds
    Signed-off-by: Greg Kroah-Hartman

    Kees Cook
     

04 Aug, 2015

11 commits

  • commit 892e8cac99a71f6254f84fc662068d912e1943bf upstream.

    commit 66fc13039422ba7df2d01a8ee0873e4ef965b50b ("mm: shmem_zero_setup
    skip security check and lockdep conflict with XFS") caused a regression
    for SELinux by disabling any SELinux checking of mprotect PROT_EXEC on
    shared anonymous mappings. However, even before that regression, the
    checking on such mprotect PROT_EXEC calls was inconsistent with the
    checking on a mmap PROT_EXEC call for a shared anonymous mapping. On a
    mmap, the security hook is passed a NULL file and knows it is dealing
    with an anonymous mapping and therefore applies an execmem check and no
    file checks. On a mprotect, the security hook is passed a vma with a
    non-NULL vm_file (as this was set from the internally-created shmem
    file during mmap) and therefore applies the file-based execute check
    and no execmem check. Since the aforementioned commit now marks the
    shmem zero inode with the S_PRIVATE flag, the file checks are disabled
    and we have no checking at all on mprotect PROT_EXEC. Add a test to
    the mprotect hook logic for such private inodes, and apply an execmem
    check in that case. This makes the mmap and mprotect checking
    consistent for shared anonymous mappings, as well as for /dev/zero and
    ashmem.

    Signed-off-by: Stephen Smalley
    Signed-off-by: Paul Moore
    Signed-off-by: Greg Kroah-Hartman

    Stephen Smalley
     
  • commit 3324603524925c7727207027d1c15e597412d15e upstream.

    At present we don't create efficient ebitmaps when importing NetLabel
    category bitmaps. This can present a problem when comparing ebitmaps
    since ebitmap_cmp() is very strict about these things and considers
    these wasteful ebitmaps not equal when compared to their more
    efficient counterparts, even if their values are the same. This isn't
    likely to cause problems on 64-bit systems due to a bit of luck on
    how NetLabel/CIPSO works and the default ebitmap size, but it can be
    a problem on 32-bit systems.

    This patch fixes this problem by being a bit more intelligent when
    importing NetLabel category bitmaps by skipping over empty sections
    which should result in a nice, efficient ebitmap.

    Signed-off-by: Paul Moore
    Signed-off-by: Greg Kroah-Hartman

    Paul Moore
     
  • commit 24fd03c87695a76f0517df42a37e51b1597d2c8a upstream.

    This patch defines a builtin measurement policy "tcb", similar to the
    existing "ima_tcb", but with additional rules to also measure files
    based on the effective uid and to measure files opened with the "read"
    mode bit set (eg. read, read-write).

    Changing the builtin "ima_tcb" policy could potentially break existing
    users. Instead of defining a new separate boot command line option each
    time the builtin measurement policy is modified, this patch defines a
    single generic boot command line option "ima_policy=" to specify the
    builtin policy and deprecates the use of the builtin ima_tcb policy.

    [The "ima_policy=" boot command line option is based on Roberto Sassu's
    "ima: added new policy type exec" patch.]

    Signed-off-by: Mimi Zohar
    Signed-off-by: Dr. Greg Wettstein
    Signed-off-by: Greg Kroah-Hartman

    Mimi Zohar
     
  • commit 4351c294b8c1028077280f761e158d167b592974 upstream.

    The current "mask" policy option matches files opened as MAY_READ,
    MAY_WRITE, MAY_APPEND or MAY_EXEC. This patch extends the "mask"
    option to match files opened containing one of these modes. For
    example, "mask=^MAY_READ" would match files opened read-write.

    Signed-off-by: Mimi Zohar
    Signed-off-by: Dr. Greg Wettstein
    Signed-off-by: Greg Kroah-Hartman

    Mimi Zohar
     
  • commit 139069eff7388407f19794384c42a534d618ccd7 upstream.

    The new "euid" policy condition measures files with the specified
    effective uid (euid). In addition, for CAP_SETUID files it measures
    files with the specified uid or suid.

    Changelog:
    - fixed checkpatch.pl warnings
    - fixed avc denied {setuid} messages - based on Roberto's feedback

    Signed-off-by: Mimi Zohar
    Signed-off-by: Dr. Greg Wettstein
    Signed-off-by: Greg Kroah-Hartman

    Mimi Zohar
     
  • commit 45b26133b97871896b8c5241d59f4ff7839db7b2 upstream.

    This patch fixes a bug introduced in "4d7aeee ima: define new template
    ima-ng and template fields d-ng and n-ng".

    Changelog:
    - change int to uint32 (Roberto Sassu's suggestion)

    Signed-off-by: Mimi Zohar
    Signed-off-by: Roberto Sassu
    Signed-off-by: Greg Kroah-Hartman

    Mimi Zohar
     
  • commit 5101a1850bb7ccbf107929dee9af0cd2f400940f upstream.

    To prevent offline stripping of existing file xattrs and relabeling of
    them at runtime, EVM allows only newly created files to be labeled. As
    pseudo filesystems are not persistent, stripping of xattrs is not a
    concern.

    Some LSMs defer file labeling on pseudo filesystems. This patch
    permits the labeling of existing files on pseudo files systems.

    Signed-off-by: Mimi Zohar
    Signed-off-by: Greg Kroah-Hartman

    Mimi Zohar
     
  • commit cd025f7f94108995383edddfb61fc8afea6c66a9 upstream.

    Include don't appraise or measure rules for the NSFS filesystem
    in the builtin ima_tcb and ima_appraise_tcb policies.

    Changelog:
    - Update documentation

    Signed-off-by: Mimi Zohar
    Signed-off-by: Greg Kroah-Hartman

    Mimi Zohar
     
  • commit 5577857f8e26e9027271f10daf96361640907300 upstream.

    It's a bit easier to read this if we split it up into two for loops.

    Signed-off-by: Dan Carpenter
    Signed-off-by: Mimi Zohar
    Signed-off-by: Greg Kroah-Hartman

    Dan Carpenter
     
  • commit 6438de9f3fb5180d78a0422695d0b88c687757d3 upstream.

    This patch adds a rule in the default measurement policy to skip inodes
    in the cgroupfs filesystem. Measurements for this filesystem can be
    avoided, as all the digests collected have the same value of the digest of
    an empty file.

    Furthermore, this patch updates the documentation of IMA policies in
    Documentation/ABI/testing/ima_policy to make it consistent with
    the policies set in security/integrity/ima/ima_policy.c.

    Signed-off-by: Roberto Sassu
    Signed-off-by: Mimi Zohar
    Signed-off-by: Greg Kroah-Hartman

    Roberto Sassu
     
  • commit ca4da5dd1f99fe9c59f1709fb43e818b18ad20e0 upstream.

    __key_link_end is not freeing the associated array edit structure
    and this leads to a 512 byte memory leak each time an identical
    existing key is added with add_key().

    The reason the add_key() system call returns okay is that
    key_create_or_update() calls __key_link_begin() before checking to see
    whether it can update a key directly rather than adding/replacing - which
    it turns out it can. Thus __key_link() is not called through
    __key_instantiate_and_link() and __key_link_end() must cancel the edit.

    CVE-2015-1333

    Signed-off-by: Colin Ian King
    Signed-off-by: David Howells
    Signed-off-by: James Morris
    Signed-off-by: Greg Kroah-Hartman

    Colin Ian King
     

22 Jul, 2015

1 commit

  • commit f9bb48825a6b5d02f4cabcc78967c75db903dcdc upstream.

    This allows for better documentation in the code and
    it allows for a simpler and fully correct version of
    fs_fully_visible to be written.

    The mount points converted and their filesystems are:
    /sys/hypervisor/s390/ s390_hypfs
    /sys/kernel/config/ configfs
    /sys/kernel/debug/ debugfs
    /sys/firmware/efi/efivars/ efivarfs
    /sys/fs/fuse/connections/ fusectl
    /sys/fs/pstore/ pstore
    /sys/kernel/tracing/ tracefs
    /sys/fs/cgroup/ cgroup
    /sys/kernel/security/ securityfs
    /sys/fs/selinux/ selinuxfs
    /sys/fs/smackfs/ smackfs

    Acked-by: Greg Kroah-Hartman
    Signed-off-by: "Eric W. Biederman"
    Signed-off-by: Greg Kroah-Hartman

    Eric W. Biederman
     

11 Jul, 2015

1 commit

  • commit 9fc2b4b436cff7d8403034676014f1be9d534942 upstream.

    Before calling into the filesystem, vfs_setxattr calls
    security_inode_setxattr, which ends up calling selinux_inode_setxattr in
    our case. That returns -EOPNOTSUPP whenever SBLABEL_MNT is not set.
    SBLABEL_MNT was supposed to be set by sb_finish_set_opts, which sets it
    only if selinux_is_sblabel_mnt returns true.

    The selinux_is_sblabel_mnt logic was broken by eadcabc697e9 "SELinux: do
    all flags twiddling in one place", which didn't take into the account
    the SECURITY_FS_USE_NATIVE behavior that had been introduced for nfs
    with eb9ae686507b "SELinux: Add new labeling type native labels".

    This caused setxattr's of security labels over NFSv4.2 to fail.

    Cc: Eric Paris
    Cc: David Quigley
    Reported-by: Richard Chan
    Signed-off-by: J. Bruce Fields
    Acked-by: Stephen Smalley
    [PM: added the stable dependency]
    Signed-off-by: Paul Moore
    Signed-off-by: Greg Kroah-Hartman

    J. Bruce Fields
     

27 Apr, 2015

1 commit

  • Pull fourth vfs update from Al Viro:
    "d_inode() annotations from David Howells (sat in for-next since before
    the beginning of merge window) + four assorted fixes"

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
    RCU pathwalk breakage when running into a symlink overmounting something
    fix I_DIO_WAKEUP definition
    direct-io: only inc/dec inode->i_dio_count for file systems
    fs/9p: fix readdir()
    VFS: assorted d_backing_inode() annotations
    VFS: fs/inode.c helpers: d_inode() annotations
    VFS: fs/cachefiles: d_backing_inode() annotations
    VFS: fs library helpers: d_inode() annotations
    VFS: assorted weird filesystems: d_inode() annotations
    VFS: normal filesystems (and lustre): d_inode() annotations
    VFS: security/: d_inode() annotations
    VFS: security/: d_backing_inode() annotations
    VFS: net/: d_inode() annotations
    VFS: net/unix: d_backing_inode() annotations
    VFS: kernel/: d_inode() annotations
    VFS: audit: d_backing_inode() annotations
    VFS: Fix up some ->d_inode accesses in the chelsio driver
    VFS: Cachefiles should perform fs modifications on the top layer only
    VFS: AF_UNIX sockets should call mknod on the top layer only

    Linus Torvalds
     

17 Apr, 2015

1 commit

  • The mm->exe_file is currently serialized with mmap_sem (shared) in order
    to both safely (1) read the file and (2) compute the realpath by calling
    tomoyo_realpath_from_path, making it an absolute overkill. Good users
    will, on the other hand, make use of the more standard get_mm_exe_file(),
    requiring only holding the mmap_sem to read the value, and relying on
    reference

    [akpm@linux-foundation.org: coding-style fixes]
    Signed-off-by: Davidlohr Bueso
    Acked-by: Tetsuo Handa
    Cc: James Morris
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Davidlohr Bueso
     

16 Apr, 2015

6 commits

  • Merge second patchbomb from Andrew Morton:

    - the rest of MM

    - various misc bits

    - add ability to run /sbin/reboot at reboot time

    - printk/vsprintf changes

    - fiddle with seq_printf() return value

    * akpm: (114 commits)
    parisc: remove use of seq_printf return value
    lru_cache: remove use of seq_printf return value
    tracing: remove use of seq_printf return value
    cgroup: remove use of seq_printf return value
    proc: remove use of seq_printf return value
    s390: remove use of seq_printf return value
    cris fasttimer: remove use of seq_printf return value
    cris: remove use of seq_printf return value
    openrisc: remove use of seq_printf return value
    ARM: plat-pxa: remove use of seq_printf return value
    nios2: cpuinfo: remove use of seq_printf return value
    microblaze: mb: remove use of seq_printf return value
    ipc: remove use of seq_printf return value
    rtc: remove use of seq_printf return value
    power: wakeup: remove use of seq_printf return value
    x86: mtrr: if: remove use of seq_printf return value
    linux/bitmap.h: improve BITMAP_{LAST,FIRST}_WORD_MASK
    MAINTAINERS: CREDITS: remove Stefano Brivio from B43
    .mailmap: add Ricardo Ribalda
    CREDITS: add Ricardo Ribalda Delgado
    ...

    Linus Torvalds
     
  • There are a lot of embedded systems that run most or all of their
    functionality in init, running as root:root. For these systems,
    supporting multiple users is not necessary.

    This patch adds a new symbol, CONFIG_MULTIUSER, that makes support for
    non-root users, non-root groups, and capabilities optional. It is enabled
    under CONFIG_EXPERT menu.

    When this symbol is not defined, UID and GID are zero in any possible case
    and processes always have all capabilities.

    The following syscalls are compiled out: setuid, setregid, setgid,
    setreuid, setresuid, getresuid, setresgid, getresgid, setgroups,
    getgroups, setfsuid, setfsgid, capget, capset.

    Also, groups.c is compiled out completely.

    In kernel/capability.c, capable function was moved in order to avoid
    adding two ifdef blocks.

    This change saves about 25 KB on a defconfig build. The most minimal
    kernels have total text sizes in the high hundreds of kB rather than
    low MB. (The 25k goes down a bit with allnoconfig, but not that much.

    The kernel was booted in Qemu. All the common functionalities work.
    Adding users/groups is not possible, failing with -ENOSYS.

    Bloat-o-meter output:
    add/remove: 7/87 grow/shrink: 19/397 up/down: 1675/-26325 (-24650)

    [akpm@linux-foundation.org: coding-style fixes]
    Signed-off-by: Iulia Manda
    Reviewed-by: Josh Triplett
    Acked-by: Geert Uytterhoeven
    Tested-by: Paul E. McKenney
    Reviewed-by: Paul E. McKenney
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Iulia Manda
     
  • ... except where that code acts as a filesystem driver, rather than
    working with dentries given to it.

    Signed-off-by: David Howells
    Signed-off-by: Al Viro

    David Howells
     
  • most of the ->d_inode uses there refer to the same inode IO would
    go to, i.e. d_backing_inode()

    Signed-off-by: David Howells
    Signed-off-by: Al Viro

    David Howells
     
  • Pull security subsystem updates from James Morris:
    "Highlights for this window:

    - improved AVC hashing for SELinux by John Brooks and Stephen Smalley

    - addition of an unconfined label to Smack

    - Smack documentation update

    - TPM driver updates"

    * 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security: (28 commits)
    lsm: copy comm before calling audit_log to avoid race in string printing
    tomoyo: Do not generate empty policy files
    tomoyo: Use if_changed when generating builtin-policy.h
    tomoyo: Use bin2c to generate builtin-policy.h
    selinux: increase avtab max buckets
    selinux: Use a better hash function for avtab
    selinux: convert avtab hash table to flex_array
    selinux: reconcile security_netlbl_secattr_to_sid() and mls_import_netlbl_cat()
    selinux: remove unnecessary pointer reassignment
    Smack: Updates for Smack documentation
    tpm/st33zp24/spi: Add missing device table for spi phy.
    tpm/st33zp24: Add proper wait for ordinal duration in case of irq mode
    smack: Fix gcc warning from unused smack_syslog_lock mutex in smackfs.c
    Smack: Allow an unconfined label in bringup mode
    Smack: getting the Smack security context of keys
    Smack: Assign smack_known_web as default smk_in label for kernel thread's socket
    tpm/tpm_infineon: Use struct dev_pm_ops for power management
    MAINTAINERS: Add Jason as designated reviewer for TPM
    tpm: Update KConfig text to include TPM2.0 FIFO chips
    tpm/st33zp24/dts/st33zp24-spi: Add dts documentation for st33zp24 spi phy
    ...

    Linus Torvalds
     
  • Pull networking updates from David Miller:

    1) Add BQL support to via-rhine, from Tino Reichardt.

    2) Integrate SWITCHDEV layer support into the DSA layer, so DSA drivers
    can support hw switch offloading. From Floria Fainelli.

    3) Allow 'ip address' commands to initiate multicast group join/leave,
    from Madhu Challa.

    4) Many ipv4 FIB lookup optimizations from Alexander Duyck.

    5) Support EBPF in cls_bpf classifier and act_bpf action, from Daniel
    Borkmann.

    6) Remove the ugly compat support in ARP for ugly layers like ax25,
    rose, etc. And use this to clean up the neigh layer, then use it to
    implement MPLS support. All from Eric Biederman.

    7) Support L3 forwarding offloading in switches, from Scott Feldman.

    8) Collapse the LOCAL and MAIN ipv4 FIB tables when possible, to speed
    up route lookups even further. From Alexander Duyck.

    9) Many improvements and bug fixes to the rhashtable implementation,
    from Herbert Xu and Thomas Graf. In particular, in the case where
    an rhashtable user bulk adds a large number of items into an empty
    table, we expand the table much more sanely.

    10) Don't make the tcp_metrics hash table per-namespace, from Eric
    Biederman.

    11) Extend EBPF to access SKB fields, from Alexei Starovoitov.

    12) Split out new connection request sockets so that they can be
    established in the main hash table. Much less false sharing since
    hash lookups go direct to the request sockets instead of having to
    go first to the listener then to the request socks hashed
    underneath. From Eric Dumazet.

    13) Add async I/O support for crytpo AF_ALG sockets, from Tadeusz Struk.

    14) Support stable privacy address generation for RFC7217 in IPV6. From
    Hannes Frederic Sowa.

    15) Hash network namespace into IP frag IDs, also from Hannes Frederic
    Sowa.

    16) Convert PTP get/set methods to use 64-bit time, from Richard
    Cochran.

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1816 commits)
    fm10k: Bump driver version to 0.15.2
    fm10k: corrected VF multicast update
    fm10k: mbx_update_max_size does not drop all oversized messages
    fm10k: reset head instead of calling update_max_size
    fm10k: renamed mbx_tx_dropped to mbx_tx_oversized
    fm10k: update xcast mode before synchronizing multicast addresses
    fm10k: start service timer on probe
    fm10k: fix function header comment
    fm10k: comment next_vf_mbx flow
    fm10k: don't handle mailbox events in iov_event path and always process mailbox
    fm10k: use separate workqueue for fm10k driver
    fm10k: Set PF queues to unlimited bandwidth during virtualization
    fm10k: expose tx_timeout_count as an ethtool stat
    fm10k: only increment tx_timeout_count in Tx hang path
    fm10k: remove extraneous "Reset interface" message
    fm10k: separate PF only stats so that VF does not display them
    fm10k: use hw->mac.max_queues for stats
    fm10k: only show actual queues, not the maximum in hardware
    fm10k: allow creation of VLAN on default vid
    fm10k: fix unused warnings
    ...

    Linus Torvalds
     

15 Apr, 2015

2 commits

  • When task->comm is passed directly to audit_log_untrustedstring() without
    getting a copy or using the task_lock, there is a race that could happen that
    would output a NULL (\0) in the middle of the output string that would
    effectively truncate the rest of the report text after the comm= field in the
    audit log message, losing fields.

    Using get_task_comm() to get a copy while acquiring the task_lock to prevent
    this and to prevent the result from being a mixture of old and new values of
    comm would incur potentially unacceptable overhead, considering that the value
    can be influenced by userspace and therefore untrusted anyways.

    Copy the value before passing it to audit_log_untrustedstring() ensures that a
    local copy is used to calculate the length *and* subsequently printed. Even if
    this value contains a mix of old and new values, it will only calculate and
    copy up to the first NULL, preventing the rest of the audit log message being
    truncated.

    Use a second local copy of comm to avoid a race between the first and second
    calls to audit_log_untrustedstring() with comm.

    Reported-by: Tetsuo Handa
    Signed-off-by: Richard Guy Briggs
    Signed-off-by: James Morris

    Richard Guy Briggs
     
  • Pull vfs update from Al Viro:
    "Part one:

    - struct filename-related cleanups

    - saner iov_iter_init() replacements (and switching the syscalls to
    use of those)

    - ntfs switch to ->write_iter() (Anton)

    - aio cleanups and splitting iocb into common and async parts
    (Christoph)

    - assorted fixes (me, bfields, Andrew Elble)

    There's a lot more, including the completion of switchover to
    ->{read,write}_iter(), d_inode/d_backing_inode annotations, f_flags
    race fixes, etc, but that goes after #for-davem merge. David has
    pulled it, and once it's in I'll send the next vfs pull request"

    * 'for-linus-1' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (35 commits)
    sg_start_req(): use import_iovec()
    sg_start_req(): make sure that there's not too many elements in iovec
    blk_rq_map_user(): use import_single_range()
    sg_io(): use import_iovec()
    process_vm_access: switch to {compat_,}import_iovec()
    switch keyctl_instantiate_key_common() to iov_iter
    switch {compat_,}do_readv_writev() to {compat_,}import_iovec()
    aio_setup_vectored_rw(): switch to {compat_,}import_iovec()
    vmsplice_to_user(): switch to import_iovec()
    kill aio_setup_single_vector()
    aio: simplify arguments of aio_setup_..._rw()
    aio: lift iov_iter_init() into aio_setup_..._rw()
    lift iov_iter into {compat_,}do_readv_writev()
    NFS: fix BUG() crash in notify_change() with patch to chown_common()
    dcache: return -ESTALE not -EBUSY on distributed fs race
    NTFS: Version 2.1.32 - Update file write from aio_write to write_iter.
    VFS: Add iov_iter_fault_in_multipages_readable()
    drop bogus check in file_open_root()
    switch security_inode_getattr() to struct path *
    constify tomoyo_realpath_from_path()
    ...

    Linus Torvalds
     

14 Apr, 2015

1 commit


13 Apr, 2015

4 commits