1. 22 Nov, 2013 2 commits
    • Linus Torvalds's avatar
      Merge branch 'for-linus2' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security · 78dc53c4
      Linus Torvalds authored
      Pull security subsystem updates from James Morris:
       "In this patchset, we finally get an SELinux update, with Paul Moore
        taking over as maintainer of that code.
      
        Also a significant update for the Keys subsystem, as well as
        maintenance updates to Smack, IMA, TPM, and Apparmor"
      
      and since I wanted to know more about the updates to key handling,
      here's the explanation from David Howells on that:
      
       "Okay.  There are a number of separate bits.  I'll go over the big bits
        and the odd important other bit, most of the smaller bits are just
        fixes and cleanups.  If you want the small bits accounting for, I can
        do that too.
      
         (1) Keyring capacity expansion.
      
              KEYS: Consolidate the concept of an 'index key' for key access
              KEYS: Introduce a search context structure
              KEYS: Search for auth-key by name rather than target key ID
              Add a generic associative array implementation.
              KEYS: Expand the capacity of a keyring
      
           Several of the patches are providing an expansion of the capacity of a
           keyring.  Currently, the maximum size of a keyring payload is one page.
           Subtract a small header and then divide up into pointers, that only gives
           you ~500 pointers on an x86_64 box.  However, since the NFS idmapper uses
           a keyring to store ID mapping data, that has proven to be insufficient to
           the cause.
      
           Whatever data structure I use to handle the keyring payload, it can only
           store pointers to keys, not the keys themselves because several keyrings
           may point to a single key.  This precludes inserting, say, and rb_node
           struct into the key struct for this purpose.
      
           I could make an rbtree of records such that each record has an rb_node
           and a key pointer, but that would use four words of space per key stored
           in the keyring.  It would, however, be able to use much existing code.
      
           I selected instead a non-rebalancing radix-tree type approach as that
           could have a better space-used/key-pointer ratio.  I could have used the
           radix tree implementation that we already have and insert keys into it by
           their serial numbers, but that means any sort of search must iterate over
           the whole radix tree.  Further, its nodes are a bit on the capacious side
           for what I want - especially given that key serial numbers are randomly
           allocated, thus leaving a lot of empty space in the tree.
      
           So what I have is an associative array that internally is a radix-tree
           with 16 pointers per node where the index key is constructed from the key
           type pointer and the key description.  This means that an exact lookup by
           type+description is very fast as this tells us how to navigate directly to
           the target key.
      
           I made the data structure general in lib/assoc_array.c as far as it is
           concerned, its index key is just a sequence of bits that leads to a
           pointer.  It's possible that someone else will be able to make use of it
           also.  FS-Cache might, for example.
      
         (2) Mark keys as 'trusted' and keyrings as 'trusted only'.
      
              KEYS: verify a certificate is signed by a 'trusted' key
              KEYS: Make the system 'trusted' keyring viewable by userspace
              KEYS: Add a 'trusted' flag and a 'trusted only' flag
              KEYS: Separate the kernel signature checking keyring from module signing
      
           These patches allow keys carrying asymmetric public keys to be marked as
           being 'trusted' and allow keyrings to be marked as only permitting the
           addition or linkage of trusted keys.
      
           Keys loaded from hardware during kernel boot or compiled into the kernel
           during build are marked as being trusted automatically.  New keys can be
           loaded at runtime with add_key().  They are checked against the system
           keyring contents and if their signatures can be validated with keys that
           are already marked trusted, then they are marked trusted also and can
           thus be added into the master keyring.
      
           Patches from Mimi Zohar make this usable with the IMA keyrings also.
      
         (3) Remove the date checks on the key used to validate a module signature.
      
              X.509: Remove certificate date checks
      
           It's not reasonable to reject a signature just because the key that it was
           generated with is no longer valid datewise - especially if the kernel
           hasn't yet managed to set the system clock when the first module is
           loaded - so just remove those checks.
      
         (4) Make it simpler to deal with additional X.509 being loaded into the kernel.
      
              KEYS: Load *.x509 files into kernel keyring
              KEYS: Have make canonicalise the paths of the X.509 certs better to deduplicate
      
           The builder of the kernel now just places files with the extension ".x509"
           into the kernel source or build trees and they're concatenated by the
           kernel build and stuffed into the appropriate section.
      
         (5) Add support for userspace kerberos to use keyrings.
      
              KEYS: Add per-user_namespace registers for persistent per-UID kerberos caches
              KEYS: Implement a big key type that can save to tmpfs
      
           Fedora went to, by default, storing kerberos tickets and tokens in tmpfs.
           We looked at storing it in keyrings instead as that confers certain
           advantages such as tickets being automatically deleted after a certain
           amount of time and the ability for the kernel to get at these tokens more
           easily.
      
           To make this work, two things were needed:
      
           (a) A way for the tickets to persist beyond the lifetime of all a user's
               sessions so that cron-driven processes can still use them.
      
               The problem is that a user's session keyrings are deleted when the
               session that spawned them logs out and the user's user keyring is
               deleted when the UID is deleted (typically when the last log out
               happens), so neither of these places is suitable.
      
               I've added a system keyring into which a 'persistent' keyring is
               created for each UID on request.  Each time a user requests their
               persistent keyring, the expiry time on it is set anew.  If the user
               doesn't ask for it for, say, three days, the keyring is automatically
               expired and garbage collected using the existing gc.  All the kerberos
               tokens it held are then also gc'd.
      
           (b) A key type that can hold really big tickets (up to 1MB in size).
      
               The problem is that Active Directory can return huge tickets with lots
               of auxiliary data attached.  We don't, however, want to eat up huge
               tracts of unswappable kernel space for this, so if the ticket is
               greater than a certain size, we create a swappable shmem file and dump
               the contents in there and just live with the fact we then have an
               inode and a dentry overhead.  If the ticket is smaller than that, we
               slap it in a kmalloc()'d buffer"
      
      * 'for-linus2' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security: (121 commits)
        KEYS: Fix keyring content gc scanner
        KEYS: Fix error handling in big_key instantiation
        KEYS: Fix UID check in keyctl_get_persistent()
        KEYS: The RSA public key algorithm needs to select MPILIB
        ima: define '_ima' as a builtin 'trusted' keyring
        ima: extend the measurement list to include the file signature
        kernel/system_certificate.S: use real contents instead of macro GLOBAL()
        KEYS: fix error return code in big_key_instantiate()
        KEYS: Fix keyring quota misaccounting on key replacement and unlink
        KEYS: Fix a race between negating a key and reading the error set
        KEYS: Make BIG_KEYS boolean
        apparmor: remove the "task" arg from may_change_ptraced_domain()
        apparmor: remove parent task info from audit logging
        apparmor: remove tsk field from the apparmor_audit_struct
        apparmor: fix capability to not use the current task, during reporting
        Smack: Ptrace access check mode
        ima: provide hash algo info in the xattr
        ima: enable support for larger default filedata hash algorithms
        ima: define kernel parameter 'ima_template=' to change configured default
        ima: add Kconfig default measurement list template
        ...
      78dc53c4
    • Linus Torvalds's avatar
      Merge git://git.infradead.org/users/eparis/audit · 3eaded86
      Linus Torvalds authored
      Pull audit updates from Eric Paris:
       "Nothing amazing.  Formatting, small bug fixes, couple of fixes where
        we didn't get records due to some old VFS changes, and a change to how
        we collect execve info..."
      
      Fixed conflict in fs/exec.c as per Eric and linux-next.
      
      * git://git.infradead.org/users/eparis/audit: (28 commits)
        audit: fix type of sessionid in audit_set_loginuid()
        audit: call audit_bprm() only once to add AUDIT_EXECVE information
        audit: move audit_aux_data_execve contents into audit_context union
        audit: remove unused envc member of audit_aux_data_execve
        audit: Kill the unused struct audit_aux_data_capset
        audit: do not reject all AUDIT_INODE filter types
        audit: suppress stock memalloc failure warnings since already managed
        audit: log the audit_names record type
        audit: add child record before the create to handle case where create fails
        audit: use given values in tty_audit enable api
        audit: use nlmsg_len() to get message payload length
        audit: use memset instead of trying to initialize field by field
        audit: fix info leak in AUDIT_GET requests
        audit: update AUDIT_INODE filter rule to comparator function
        audit: audit feature to set loginuid immutable
        audit: audit feature to only allow unsetting the loginuid
        audit: allow unsetting the loginuid (with priv)
        audit: remove CONFIG_AUDIT_LOGINUID_IMMUTABLE
        audit: loginuid functions coding style
        selinux: apply selinux checks on new audit message types
        ...
      3eaded86
  2. 20 Nov, 2013 36 commits
    • Linus Torvalds's avatar
      Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc · 527d1511
      Linus Torvalds authored
      Pull powerpc LE updates from Ben Herrenschmidt:
       "With my previous pull request I mentioned some remaining Little Endian
        patches, notably support for our new ABI, which I was sitting on
        making sure it was all finalized.
      
        The toolchain folks confirmed it now, the new ABI is stable and merged
        with gcc, so we are all good.  Oh and we actually missed the actual
        Kconfig switch for LE so here it is, along with a couple more bug
        fixes.
      
        I have more fixes but not related to LE so I'll send them as a
        separate pull request tomorrow, let's get this one out of the way.
      
        Note that this supports running user space binaries using the new ABI,
        but the kernel itself still needs to be built with the old one.  We'll
        bring fixes for that after -rc1.
      
        Here's Anton log that goes with this series:
      
           This patch series adds support for the new ABI, LPAR support for
           H_SET_MODE and finally adds a kconfig option and defconfig.
      
           ABIv2 support was recently committed to binutils and gcc, and should
           be merged into glibc soon.  There are a number of very nice
           improvements including the removal of function descriptors.  Rusty's
           kernel patches allow binaries of either ABI to work, easing the
           transition"
      
      * 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc:
        powerpc: Wrong DWARF CFI in the kernel vdso for little-endian / ELFv2
        powerpc: Add pseries_le_defconfig
        powerpc: Add CONFIG_CPU_LITTLE_ENDIAN kernel config option.
        powerpc: Don't use ELFv2 ABI to build the kernel
        powerpc: ELF2 binaries signal handling
        powerpc: ELF2 binaries launched directly.
        powerpc: Set eflags correctly for ELF ABIv2 core dumps.
        powerpc: Add TIF_ELF2ABI flag.
        pseries: Add H_SET_MODE to change exception endianness
        powerpc/pseries: Fix endian issues in pseries EEH code
      527d1511
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mattst88/alpha · d5bdaf4f
      Linus Torvalds authored
      Pull alpha updates from Matt Turner:
       "It contains a few fixes and some work from Richard to make alpha
        emulation under QEMU much more usable"
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mattst88/alpha:
        alpha: Prevent a NULL ptr dereference in csum_partial_copy.
        alpha: perf: fix out-of-bounds array access triggered from raw event
        alpha: Use qemu+cserve provided high-res clock and alarm.
        alpha: Switch to GENERIC_CLOCKEVENTS
        alpha: Enable the rpcc clocksource for single processor
        alpha: Reorganize rtc handling
        alpha: Primitive support for CPU power down.
        alpha: Allow HZ to be configured
        alpha: Notice if we're being run under QEMU
        alpha: Eliminate compiler warning from memset macro
      d5bdaf4f
    • Linus Torvalds's avatar
      Merge branch 'parisc-3.13' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux · dc6ec87d
      Linus Torvalds authored
      Pull parisc fixes from Helge Deller:
       - revert an access_ok() patch which broke 32bit userspace on 64bit
         kernels
       - avoid a gcc miscompilation in two internal pa_memcpy() functions by
         not inlining those
       - do not export the definition of SOCK_NONBLOCK via uapi header (fixes
         build of audit package)
       - depending on the fault type we now correctly report either SIGBUS or
         SIGSEGV
       - a small fix to not compare a size_t variable for < 0
      
      * 'parisc-3.13' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux:
        parisc: size_t is unsigned, so comparison size < 0 doesn't make sense.
        parisc: improve SIGBUS/SIGSEGV error reporting
        parisc: break out SOCK_NONBLOCK define to own asm header file
        parisc: do not inline pa_memcpy() internal functions
        Revert "parisc: implement full version of access_ok()"
      dc6ec87d
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/egtvedt/linux-avr32 · 8a60ba0a
      Linus Torvalds authored
      Pull AVR32 updates from Hans-Christian Egtvedt.
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/egtvedt/linux-avr32:
        avr32: uapi: be sure of "_UAPI" prefix for all guard macros
        avr32: add kprobe_ctlblk memory struct
        avr32: fix out-of-range jump in large kernels
        avr32: setup crt for early panic()
      8a60ba0a
    • Linus Torvalds's avatar
      Merge tag 'squashfs-updates' of git://git.kernel.org/pub/scm/linux/kernel/git/pkl/squashfs-next · af2e2f32
      Linus Torvalds authored
      Pull squashfs updates from Phillip Lougher:
       "These patches optionally improve the multi-threading peformance of
        Squashfs by adding parallel decompression, and direct decompression
        into the page cache, eliminating an intermediate buffer (removing
        memcpy overhead and lock contention)"
      
      * tag 'squashfs-updates' of git://git.kernel.org/pub/scm/linux/kernel/git/pkl/squashfs-next:
        Squashfs: Check stream is not NULL in decompressor_multi.c
        Squashfs: Directly decompress into the page cache for file data
        Squashfs: Restructure squashfs_readpage()
        Squashfs: Generalise paging handling in the decompressors
        Squashfs: add multi-threaded decompression using percpu variable
        squashfs: Enhance parallel I/O
        Squashfs: Refactor decompressor interface and code
      af2e2f32
    • Linus Torvalds's avatar
      Revert "mm: create a separate slab for page->ptl allocation" · 8b2e9b71
      Linus Torvalds authored
      This reverts commit ea1e7ed3.
      
      Al points out that while the commit *does* actually create a separate
      slab for the page->ptl allocation, that slab is never actually used, and
      the code continues to use kmalloc/kfree.
      
      Damien Wyart points out that the original patch did have the conversion
      to use kmem_cache_alloc/free, so it got lost somewhere on its way to me.
      
      Revert the half-arsed attempt that didn't do anything.  If we really do
      want the special slab (remember: this is all relevant just for debug
      builds, so it's not necessarily all that critical) we might as well redo
      the patch fully.
      Reported-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      Acked-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Cc: Kirill A Shutemov <kirill.shutemov@linux.intel.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      8b2e9b71
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs · b5898cd0
      Linus Torvalds authored
      Pull vfs bits and pieces from Al Viro:
       "Assorted bits that got missed in the first pull request + fixes for a
        couple of coredump regressions"
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
        fold try_to_ascend() into the sole remaining caller
        dcache.c: get rid of pointless macros
        take read_seqbegin_or_lock() and friends to seqlock.h
        consolidate simple ->d_delete() instances
        gfs2: endianness misannotations
        dump_emit(): use __kernel_write(), not vfs_write()
        dump_align(): fix the dumb braino
      b5898cd0
    • Al Viro's avatar
      Wrong page freed on preallocate_pmds() failure exit · 2a46eed5
      Al Viro authored
      Note that pmds[i] is simply uninitialized at that point...
      
      Granted, it's very hard to hit (you need split page locks *and*
      kmalloc(sizeof(spinlock_t), GFP_KERNEL) failing), but the code is
      obviously bogus.
      
      Introduced by commit 09ef4939 ("x86: add missed
      pgtable_pmd_page_ctor/dtor calls for preallocated pmds")
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      2a46eed5
    • Ulrich Weigand's avatar
      powerpc: Wrong DWARF CFI in the kernel vdso for little-endian / ELFv2 · 28027082
      Ulrich Weigand authored
      I've finally tracked down why my CR signal-unwind test case still
      fails on little-endian.  The problem turned to be that the kernel
      installs a signal trampoline in the vDSO, and provides a DWARF CFI
      record for that trampoline.  This CFI describes the save location
      for CR:
      
        rsave (70, 38*RSIZE + (RSIZE - CRSIZE))
      
      which is correct for big-endian, but points to the wrong word on
      little-endian.   This is wrong no matter which ABI.
      
      In addition, for the ELFv2 ABI, we should not only provide a CFI
      record for register 70 (cr2), but for all CR fields separately.
      Strictly speaking, I guess this would mean providing two separate
      vDSO images, one for ELFv1 processes and one for ELFv2 processes (or
      maybe playing some tricks with conditional DWARF expressions).
      However, having CFI records for the other CR fields in ELFv1 is not
      actually wrong, they just will be ignored.   So it seems the simplest
      fix would be just to always provide CFI for all the fields.
      Signed-off-by: default avatarUlrich Weigand <Ulrich.Weigand@de.ibm.com>
      Signed-off-by: default avatarAnton Blanchard <anton@samba.org>
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      28027082
    • Anton Blanchard's avatar
      f53e462e
    • Anton Blanchard's avatar
      powerpc: Add CONFIG_CPU_LITTLE_ENDIAN kernel config option. · 7c105b63
      Anton Blanchard authored
      With the little endian support merged, we can add the
      CONFIG_CPU_LITTLE_ENDIAN kernel config option.
      Signed-off-by: default avatarAnton Blanchard <anton@samba.org>
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      7c105b63
    • Alistair Popple's avatar
      powerpc: Don't use ELFv2 ABI to build the kernel · b2ca8c89
      Alistair Popple authored
      The kernel doesn't build correctly using the ELFv2 ABI.  This patch
      ensures that the ELFv1 ABI is used when building a kernel with an
      ELFv2 enabled compiler.
      Signed-off-by: default avatarAlistair Popple <alistair@popple.id.au>
      Signed-off-by: default avatarAnton Blanchard <anton@samba.org>
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      b2ca8c89
    • Rusty Russell's avatar
      powerpc: ELF2 binaries signal handling · d606b92a
      Rusty Russell authored
      For the ELFv2 ABI, the hander is the entry point, not a function descriptor.
      We also need to set up r12, and fortunately the fast_exception_return
      exit path restores r12 for us so nothing else is required.
      Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
      Signed-off-by: default avatarAnton Blanchard <anton@samba.org>
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      d606b92a
    • Rusty Russell's avatar
      powerpc: ELF2 binaries launched directly. · 94af3abf
      Rusty Russell authored
      No function descriptor, but we set r12 up and set TIF_RESTOREALL as it
      normally isn't restored on return from syscall.
      Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
      Signed-off-by: default avatarAnton Blanchard <anton@samba.org>
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      94af3abf
    • Rusty Russell's avatar
      powerpc: Set eflags correctly for ELF ABIv2 core dumps. · 918d0355
      Rusty Russell authored
      We leave it at zero (though it could be 1) for old tasks.
      Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
      Signed-off-by: default avatarAnton Blanchard <anton@samba.org>
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      918d0355
    • Rusty Russell's avatar
      powerpc: Add TIF_ELF2ABI flag. · 373c76d6
      Rusty Russell authored
      Little endian ppc64 is getting an exciting new ABI.  This is reflected
      by the bottom two bits of e_flags in the ELF header:
      
      	0 == legacy binaries (v1 ABI)
      	1 == binaries using the old ABI (compiled with a new toolchain)
      	2 == binaries using the new ABI.
      
      We store this in a thread flag, because we need to set it in core
      dumps and for signal delivery.  Our chief concern is that it doesn't
      use function descriptors.
      Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
      Signed-off-by: default avatarAnton Blanchard <anton@samba.org>
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      373c76d6
    • Anton Blanchard's avatar
      pseries: Add H_SET_MODE to change exception endianness · e844b1ee
      Anton Blanchard authored
      On little endian builds call H_SET_MODE so exceptions have the
      correct endianness. We need to reset the endian during kexec
      so do that in the MMU hashtable clear callback.
      Signed-off-by: default avatarAnton Blanchard <anton@samba.org>
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      e844b1ee
    • Anton Blanchard's avatar
    • Linus Torvalds's avatar
      Merge tag 'pm+acpi-2-3.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · 82023bb7
      Linus Torvalds authored
      Pull more ACPI and power management updates from Rafael Wysocki:
      
       - ACPI-based device hotplug fixes for issues introduced recently and a
         fix for an older error code path bug in the ACPI PCI host bridge
         driver
      
       - Fix for recently broken OMAP cpufreq build from Viresh Kumar
      
       - Fix for a recent hibernation regression related to s2disk
      
       - Fix for a locking-related regression in the ACPI EC driver from
         Puneet Kumar
      
       - System suspend error code path fix related to runtime PM and runtime
         PM documentation update from Ulf Hansson
      
       - cpufreq's conservative governor fix from Xiaoguang Chen
      
       - New processor IDs for intel_idle and turbostat and removal of an
         obsolete Kconfig option from Len Brown
      
       - New device IDs for the ACPI LPSS (Low-Power Subsystem) driver and
         ACPI-based PCI hotplug (ACPIPHP) cleanup from Mika Westerberg
      
       - Removal of several ACPI video DMI blacklist entries that are not
         necessary any more from Aaron Lu
      
       - Rework of the ACPI companion representation in struct device and code
         cleanup related to that change from Rafael J Wysocki, Lan Tianyu and
         Jarkko Nikula
      
       - Fixes for assigning names to ACPI-enumerated I2C and SPI devices from
         Jarkko Nikula
      
      * tag 'pm+acpi-2-3.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (24 commits)
        PCI / hotplug / ACPI: Drop unused acpiphp_debug declaration
        ACPI / scan: Set flags.match_driver in acpi_bus_scan_fixed()
        ACPI / PCI root: Clear driver_data before failing enumeration
        ACPI / hotplug: Fix PCI host bridge hot removal
        ACPI / hotplug: Fix acpi_bus_get_device() return value check
        cpufreq: governor: Remove fossil comment in the cpufreq_governor_dbs()
        ACPI / video: clean up DMI table for initial black screen problem
        ACPI / EC: Ensure lock is acquired before accessing ec struct members
        PM / Hibernate: Do not crash kernel in free_basic_memory_bitmaps()
        ACPI / AC: Remove struct acpi_device pointer from struct acpi_ac
        spi: Use stable dev_name for ACPI enumerated SPI slaves
        i2c: Use stable dev_name for ACPI enumerated I2C slaves
        ACPI: Provide acpi_dev_name accessor for struct acpi_device device name
        ACPI / bind: Use (put|get)_device() on ACPI device objects too
        ACPI: Eliminate the DEVICE_ACPI_HANDLE() macro
        ACPI / driver core: Store an ACPI device pointer in struct acpi_dev_node
        cpufreq: OMAP: Fix compilation error 'r & ret undeclared'
        PM / Runtime: Fix error path for prepare
        PM / Runtime: Update documentation around probe|remove|suspend
        cpufreq: conservative: set requested_freq to policy max when it is over policy max
        ...
      82023bb7
    • Linus Torvalds's avatar
      Merge branch 'next' of git://git.infradead.org/users/vkoul/slave-dma · e6d69a60
      Linus Torvalds authored
      Pull slave-dmaengine changes from Vinod Koul:
       "This brings for slave dmaengine:
      
         - Change dma notification flag to DMA_COMPLETE from DMA_SUCCESS as
           dmaengine can only transfer and not verify validaty of dma
           transfers
      
         - Bunch of fixes across drivers:
      
            - cppi41 driver fixes from Daniel
      
            - 8 channel freescale dma engine support and updated bindings from
              Hongbo
      
            - msx-dma fixes and cleanup by Markus
      
         - DMAengine updates from Dan:
      
            - Bartlomiej and Dan finalized a rework of the dma address unmap
              implementation.
      
            - In the course of testing 1/ a collection of enhancements to
              dmatest fell out.  Notably basic performance statistics, and
              fixed / enhanced test control through new module parameters
              'run', 'wait', 'noverify', and 'verbose'.  Thanks to Andriy and
              Linus [Walleij] for their review.
      
            - Testing the raid related corner cases of 1/ triggered bugs in
              the recently added 16-source operation support in the ioatdma
              driver.
      
            - Some minor fixes / cleanups to mv_xor and ioatdma"
      
      * 'next' of git://git.infradead.org/users/vkoul/slave-dma: (99 commits)
        dma: mv_xor: Fix mis-usage of mmio 'base' and 'high_base' registers
        dma: mv_xor: Remove unneeded NULL address check
        ioat: fix ioat3_irq_reinit
        ioat: kill msix_single_vector support
        raid6test: add new corner case for ioatdma driver
        ioatdma: clean up sed pool kmem_cache
        ioatdma: fix selection of 16 vs 8 source path
        ioatdma: fix sed pool selection
        ioatdma: Fix bug in selftest after removal of DMA_MEMSET.
        dmatest: verbose mode
        dmatest: convert to dmaengine_unmap_data
        dmatest: add a 'wait' parameter
        dmatest: add basic performance metrics
        dmatest: add support for skipping verification and random data setup
        dmatest: use pseudo random numbers
        dmatest: support xor-only, or pq-only channels in tests
        dmatest: restore ability to start test at module load and init
        dmatest: cleanup redundant "dmatest: " prefixes
        dmatest: replace stored results mechanism, with uniform messages
        Revert "dmatest: append verify result to results"
        ...
      e6d69a60
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.dk/linux-block · 5a1efc6e
      Linus Torvalds authored
      Pull block IO fixes from Jens Axboe:
       "Normally I'd defer my initial for-linus pull request until after the
        merge window, but a race was uncovered in the virtio-blk conversion to
        blk-mq that could cause hangs.  So here's a small collection of fixes
        for you to pull:
      
         - The fix for the virtio-blk IO hang reported by Dave Chinner, from
           Shaohua and myself.
      
         - Add the Insert blktrace event for blk-mq.  This makes 'btt' happy
           when it is doing it's state transition analysis.
      
         - Ensure that blk-mq has disk/partition stats enabled by default,
           instead of making it opt-in.
      
         - A fix for __bio_add_page() and large sector counts"
      
      * 'for-linus' of git://git.kernel.dk/linux-block:
        blk-mq: add blktrace insert event trace
        virtio-blk: virtqueue_kick() must be ordered with other virtqueue operations
        blk-mq: ensure that we set REQ_IO_STAT so diskstats work
        bio: fix argument of __bio_add_page() for max_sectors > 0xffff
      5a1efc6e
    • Linus Torvalds's avatar
      Merge tag 'md/3.13' of git://neil.brown.name/md · 6d6e352c
      Linus Torvalds authored
      Pull md update from Neil Brown:
       "Mostly optimisations and obscure bug fixes.
         - raid5 gets less lock contention
         - raid1 gets less contention between normal-io and resync-io during
           resync"
      
      * tag 'md/3.13' of git://neil.brown.name/md:
        md/raid5: Use conf->device_lock protect changing of multi-thread resources.
        md/raid5: Before freeing old multi-thread worker, it should flush them.
        md/raid5: For stripe with R5_ReadNoMerge, we replace REQ_FLUSH with REQ_NOMERGE.
        UAPI: include <asm/byteorder.h> in linux/raid/md_p.h
        raid1: Rewrite the implementation of iobarrier.
        raid1: Add some macros to make code clearly.
        raid1: Replace raise_barrier/lower_barrier with freeze_array/unfreeze_array when reconfiguring the array.
        raid1: Add a field array_frozen to indicate whether raid in freeze state.
        md: Convert use of typedef ctl_table to struct ctl_table
        md/raid5: avoid deadlock when raid5 array has unack badblocks during md_stop_writes.
        md: use MD_RECOVERY_INTR instead of kthread_should_stop in resync thread.
        md: fix some places where mddev_lock return value is not checked.
        raid5: Retry R5_ReadNoMerge flag when hit a read error.
        raid5: relieve lock contention in get_active_stripe()
        raid5: relieve lock contention in get_active_stripe()
        wait: add wait_event_cmd()
        md/raid5.c: add proper locking to error path of raid5_start_reshape.
        md: fix calculation of stacking limits on level change.
        raid5: Use slow_path to release stripe when mddev->thread is null
      6d6e352c
    • Chen Gang's avatar
      avr32: uapi: be sure of "_UAPI" prefix for all guard macros · e7f2c8c1
      Chen Gang authored
      For all uapi headers, need use "_UAPI" prefix for its guard macro
      (which will be stripped by "scripts/headers_installer.sh").
      
      Also remove redundant files (bitsperlong.h, errno.h, fcntl.h, ioctl.h,
      ioctls.h, ipcbuf.h, kvm_para.h, mman.h, poll.h, resource.h, siginfo.h,
      statfs.h, and unistd.h) which are already in Kbuild.
      
      Also be sure that all "#endif" only have one empty line above, and each
      file has guard macro.
      Signed-off-by: default avatarChen Gang <gang.chen@asianux.com>
      Signed-off-by: default avatarHans-Christian Egtvedt <hegtvedt@cisco.com>
      e7f2c8c1
    • Eirik Aanonsen's avatar
      avr32: add kprobe_ctlblk memory struct · dbc0d691
      Eirik Aanonsen authored
      This re-enables kprobes on AVR32 architecture.
      Signed-off-by: default avatarEirik Aanonsen <eaa@wprmedical.com>
      Signed-off-by: default avatarHans-Christian Egtvedt <egtvedt@samfundet.no>
      dbc0d691
    • Andreas Bießmann's avatar
      avr32: fix out-of-range jump in large kernels · d617b338
      Andreas Bießmann authored
      This patch fixes following error (for big kernels):
      
      ---8<---
      arch/avr32/boot/u-boot/head.o: In function `no_tag_table':
      (.init.text+0x44): relocation truncated to fit: R_AVR32_22H_PCREL against symbol `panic' defined in .text.unlikely section in kernel/built-in.o
      arch/avr32/kernel/built-in.o: In function `bad_return':
      (.ex.text+0x236): relocation truncated to fit: R_AVR32_22H_PCREL against symbol `panic' defined in .text.unlikely section in kernel/built-in.o
      --->8---
      
      It comes up when the kernel increases and 'panic()' is too far away to fit in
      the +/- 2MiB range. Which in turn issues from the 21-bit displacement in
      'br{cond4}' mnemonic which is one of the two ways to do jumps (rjmp has just
      10-bit displacement and therefore a way smaller range). This fact was stated
      before in 8d29b7b9.
      One solution to solve this is to add a local storage for the symbol address
      and just load the $pc with that value.
      Signed-off-by: default avatarAndreas Bießmann <andreas@biessmann.de>
      Acked-by: default avatarHans-Christian Egtvedt <egtvedt@samfundet.no>
      Cc: Haavard Skinnemoen <hskinnemoen@gmail.com>
      Cc: stable@vger.kernel.org
      d617b338
    • Andreas Bießmann's avatar
      avr32: setup crt for early panic() · 7a2a74f4
      Andreas Bießmann authored
      Before the CRT was (fully) set up in kernel_entry (bss cleared before in
      _start, but also not before jump to panic() in no_tag_table case).
      
      This patch fixes this up to have a fully working CRT when branching to panic()
      in no_tag_table.
      Signed-off-by: default avatarAndreas Bießmann <andreas@biessmann.de>
      Acked-by: default avatarHans-Christian Egtvedt <egtvedt@samfundet.no>
      Cc: Haavard Skinnemoen <hskinnemoen@gmail.com>
      Cc: stable@vger.kernel.org
      7a2a74f4
    • Phillip Lougher's avatar
      Squashfs: Check stream is not NULL in decompressor_multi.c · ed4f381e
      Phillip Lougher authored
      Fix static checker complaint that stream is not checked in
      squashfs_decompressor_destroy().
      Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: default avatarPhillip Lougher <phillip@squashfs.org.uk>
      Reviewed-by: default avatarMinchan Kim <minchan@kernel.org>
      ed4f381e
    • Phillip Lougher's avatar
      Squashfs: Directly decompress into the page cache for file data · 0d455c12
      Phillip Lougher authored
      This introduces an implementation of squashfs_readpage_block()
      that directly decompresses into the page cache.
      
      This uses the previously added page handler abstraction to push
      down the necessary kmap_atomic/kunmap_atomic operations on the
      page cache buffers into the decompressors.  This enables
      direct copying into the page cache without using the slow
      kmap/kunmap calls.
      
      The code detects when multiple threads are racing in
      squashfs_readpage() to decompress the same block, and avoids
      this regression by falling back to using an intermediate
      buffer.
      
      This patch enhances the performance of Squashfs significantly
      when multiple processes are accessing the filesystem simultaneously
      because it not only reduces memcopying, but it more importantly
      eliminates the lock contention on the intermediate buffer.
      
      Using single-thread decompression.
      
              dd if=file1 of=/dev/null bs=4096 &
              dd if=file2 of=/dev/null bs=4096 &
              dd if=file3 of=/dev/null bs=4096 &
              dd if=file4 of=/dev/null bs=4096
      
      Before:
      
      629145600 bytes (629 MB) copied, 45.8046 s, 13.7 MB/s
      
      After:
      
      629145600 bytes (629 MB) copied, 9.29414 s, 67.7 MB/s
      Signed-off-by: default avatarPhillip Lougher <phillip@squashfs.org.uk>
      Reviewed-by: default avatarMinchan Kim <minchan@kernel.org>
      0d455c12
    • Phillip Lougher's avatar
      Squashfs: Restructure squashfs_readpage() · 5f55dbc0
      Phillip Lougher authored
      Restructure squashfs_readpage() splitting it into separate
      functions for datablocks, fragments and sparse blocks.
      
      Move the memcpying (from squashfs cache entry) implementation of
      squashfs_readpage_block into file_cache.c
      
      This allows different implementations to be supported.
      Signed-off-by: default avatarPhillip Lougher <phillip@squashfs.org.uk>
      Reviewed-by: default avatarMinchan Kim <minchan@kernel.org>
      5f55dbc0
    • Phillip Lougher's avatar
      Squashfs: Generalise paging handling in the decompressors · 846b730e
      Phillip Lougher authored
      Further generalise the decompressors by adding a page handler
      abstraction.  This adds helpers to allow the decompressors
      to access and process the output buffers in an implementation
      independant manner.
      
      This allows different types of output buffer to be passed
      to the decompressors, with the implementation specific
      aspects handled at decompression time, but without the
      knowledge being held in the decompressor wrapper code.
      
      This will allow the decompressors to handle Squashfs
      cache buffers, and page cache pages.
      
      This patch adds the abstraction and an implementation for
      the caches.
      Signed-off-by: default avatarPhillip Lougher <phillip@squashfs.org.uk>
      Reviewed-by: default avatarMinchan Kim <minchan@kernel.org>
      846b730e
    • Phillip Lougher's avatar
      Squashfs: add multi-threaded decompression using percpu variable · d208383d
      Phillip Lougher authored
      Add a multi-threaded decompression implementation which uses
      percpu variables.
      
      Using percpu variables has advantages and disadvantages over
      implementations which do not use percpu variables.
      
      Advantages:
        * the nature of percpu variables ensures decompression is
          load-balanced across the multiple cores.
        * simplicity.
      
      Disadvantages: it limits decompression to one thread per core.
      Signed-off-by: default avatarPhillip Lougher <phillip@squashfs.org.uk>
      d208383d
    • Minchan Kim's avatar
      squashfs: Enhance parallel I/O · cd59c2ec
      Minchan Kim authored
      Now squashfs have used for only one stream buffer for decompression
      so it hurts parallel read performance so this patch supports
      multiple decompressor to enhance performance parallel I/O.
      
      Four 1G file dd read on KVM machine which has 2 CPU and 4G memory.
      
      dd if=test/test1.dat of=/dev/null &
      dd if=test/test2.dat of=/dev/null &
      dd if=test/test3.dat of=/dev/null &
      dd if=test/test4.dat of=/dev/null &
      
      old : 1m39s -> new : 9s
      
      * From v1
        * Change comp_strm with decomp_strm - Phillip
        * Change/add comments - Phillip
      Signed-off-by: default avatarMinchan Kim <minchan@kernel.org>
      Signed-off-by: default avatarPhillip Lougher <phillip@squashfs.org.uk>
      cd59c2ec
    • Phillip Lougher's avatar
      Squashfs: Refactor decompressor interface and code · 9508c6b9
      Phillip Lougher authored
      The decompressor interface and code was written from
      the point of view of single-threaded operation.  In doing
      so it mixed a lot of single-threaded implementation specific
      aspects into the decompressor code and elsewhere which makes it
      difficult to seamlessly support multiple different decompressor
      implementations.
      
      This patch does the following:
      
      1.  It removes compressor_options parsing from the decompressor
          init() function.  This allows the decompressor init() function
          to be dynamically called to instantiate multiple decompressors,
          without the compressor options needing to be read and parsed each
          time.
      
      2.  It moves threading and all sleeping operations out of the
          decompressors.  In doing so, it makes the decompressors
          non-blocking wrappers which only deal with interfacing with
          the decompressor implementation.
      
      3. It splits decompressor.[ch] into decompressor generic functions
         in decompressor.[ch], and moves the single threaded
         decompressor implementation into decompressor_single.c.
      
      The result of this patch is Squashfs should now be able to
      support multiple decompressors by adding new decompressor_xxx.c
      files with specialised implementations of the functions in
      decompressor_single.c
      Signed-off-by: default avatarPhillip Lougher <phillip@squashfs.org.uk>
      Reviewed-by: default avatarMinchan Kim <minchan@kernel.org>
      9508c6b9
    • Jens Axboe's avatar
      blk-mq: add blktrace insert event trace · 01b983c9
      Jens Axboe authored
      We need it to make 'btt' from blktrace happy, otherwise
      we are missing one state transition.
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      01b983c9
    • Shaohua Li's avatar
      virtio-blk: virtqueue_kick() must be ordered with other virtqueue operations · f02b9ac3
      Shaohua Li authored
      It isn't safe to call it without holding the vblk->vq_lock.
      Reported-by: default avatarDave Chinner <david@fromorbit.com>
      Signed-off-by: default avatarShaohua Li <shli@fusionio.com>
      
      Fixed another condition of virtqueue_kick() not holding the lock.
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      f02b9ac3
    • Mahesh Rajashekhara's avatar
      aacraid: prevent invalid pointer dereference · b4789b8e
      Mahesh Rajashekhara authored
      It appears that driver runs into a problem here if fibsize is too small
      because we allocate user_srbcmd with fibsize size only but later we
      access it until user_srbcmd->sg.count to copy it over to srbcmd.
      
      It is not correct to test (fibsize < sizeof(*user_srbcmd)) because this
      structure already includes one sg element and this is not needed for
      commands without data.  So, we would recommend to add the following
      (instead of test for fibsize == 0).
      Signed-off-by: default avatarMahesh Rajashekhara <Mahesh.Rajashekhara@pmcs.com>
      Reported-by: default avatarNico Golde <nico@ngolde.de>
      Reported-by: default avatarFabian Yamaguchi <fabs@goesec.de>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      b4789b8e
  3. 19 Nov, 2013 2 commits
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · 1ee2dcc2
      Linus Torvalds authored
      Pull networking fixes from David Miller:
       "Mostly these are fixes for fallout due to merge window changes, as
        well as cures for problems that have been with us for a much longer
        period of time"
      
       1) Johannes Berg noticed two major deficiencies in our genetlink
          registration.  Some genetlink protocols we passing in constant
          counts for their ops array rather than something like
          ARRAY_SIZE(ops) or similar.  Also, some genetlink protocols were
          using fixed IDs for their multicast groups.
      
          We have to retain these fixed IDs to keep existing userland tools
          working, but reserve them so that other multicast groups used by
          other protocols can not possibly conflict.
      
          In dealing with these two problems, we actually now use less state
          management for genetlink operations and multicast groups.
      
       2) When configuring interface hardware timestamping, fix several
          drivers that simply do not validate that the hwtstamp_config value
          is one the driver actually supports.  From Ben Hutchings.
      
       3) Invalid memory references in mwifiex driver, from Amitkumar Karwar.
      
       4) In dev_forward_skb(), set the skb->protocol in the right order
          relative to skb_scrub_packet().  From Alexei Starovoitov.
      
       5) Bridge erroneously fails to use the proper wrapper functions to make
          calls to netdev_ops->ndo_vlan_rx_{add,kill}_vid.  Fix from Toshiaki
          Makita.
      
       6) When detaching a bridge port, make sure to flush all VLAN IDs to
          prevent them from leaking, also from Toshiaki Makita.
      
       7) Put in a compromise for TCP Small Queues so that deep queued devices
          that delay TX reclaim non-trivially don't have such a performance
          decrease.  One particularly problematic area is 802.11 AMPDU in
          wireless.  From Eric Dumazet.
      
       8) Fix crashes in tcp_fastopen_cache_get(), we can see NULL socket dsts
          here.  Fix from Eric Dumzaet, reported by Dave Jones.
      
       9) Fix use after free in ipv6 SIT driver, from Willem de Bruijn.
      
      10) When computing mergeable buffer sizes, virtio-net fails to take the
          virtio-net header into account.  From Michael Dalton.
      
      11) Fix seqlock deadlock in ip4_datagram_connect() wrt.  statistic
          bumping, this one has been with us for a while.  From Eric Dumazet.
      
      12) Fix NULL deref in the new TIPC fragmentation handling, from Erik
          Hugne.
      
      13) 6lowpan bit used for traffic classification was wrong, from Jukka
          Rissanen.
      
      14) macvlan has the same issue as normal vlans did wrt.  propagating LRO
          disabling down to the real device, fix it the same way.  From Michal
          Kubecek.
      
      15) CPSW driver needs to soft reset all slaves during suspend, from
          Daniel Mack.
      
      16) Fix small frame pacing in FQ packet scheduler, from Eric Dumazet.
      
      17) The xen-netfront RX buffer refill timer isn't properly scheduled on
          partial RX allocation success, from Ma JieYue.
      
      18) When ipv6 ping protocol support was added, the AF_INET6 protocol
          initialization cleanup path on failure was borked a little.  Fix
          from Vlad Yasevich.
      
      19) If a socket disconnects during a read/recvmsg/recvfrom/etc that
          blocks we can do the wrong thing with the msg_name we write back to
          userspace.  From Hannes Frederic Sowa.  There is another fix in the
          works from Hannes which will prevent future problems of this nature.
      
      20) Fix route leak in VTI tunnel transmit, from Fan Du.
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (106 commits)
        genetlink: make multicast groups const, prevent abuse
        genetlink: pass family to functions using groups
        genetlink: add and use genl_set_err()
        genetlink: remove family pointer from genl_multicast_group
        genetlink: remove genl_unregister_mc_group()
        hsr: don't call genl_unregister_mc_group()
        quota/genetlink: use proper genetlink multicast APIs
        drop_monitor/genetlink: use proper genetlink multicast APIs
        genetlink: only pass array to genl_register_family_with_ops()
        tcp: don't update snd_nxt, when a socket is switched from repair mode
        atm: idt77252: fix dev refcnt leak
        xfrm: Release dst if this dst is improper for vti tunnel
        netlink: fix documentation typo in netlink_set_err()
        be2net: Delete secondary unicast MAC addresses during be_close
        be2net: Fix unconditional enabling of Rx interface options
        net, virtio_net: replace the magic value
        ping: prevent NULL pointer dereference on write to msg_name
        bnx2x: Prevent "timeout waiting for state X"
        bnx2x: prevent CFC attention
        bnx2x: Prevent panic during DMAE timeout
        ...
      1ee2dcc2
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc · 4457e6f6
      Linus Torvalds authored
      Pull sparc fixes from David Miller:
       "Two merge window fallout build fixes"
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc:
        sparc64: merge fix
        sparc64: fix build regession
      4457e6f6