1. 03 May, 2014 26 commits
  2. 28 Apr, 2014 2 commits
  3. 27 Apr, 2014 12 commits
    • Will Deacon's avatar
      word-at-a-time: avoid undefined behaviour in zero_bytemask macro · ec6931b2
      Will Deacon authored
      The asm-generic, big-endian version of zero_bytemask creates a mask of
      bytes preceding the first zero-byte by left shifting ~0ul based on the
      position of the first zero byte.
      
      Unfortunately, if the first (top) byte is zero, the output of
      prep_zero_mask has only the top bit set, resulting in undefined C
      behaviour as we shift left by an amount equal to the width of the type.
      As it happens, GCC doesn't manage to spot this through the call to fls(),
      but the issue remains if architectures choose to implement their shift
      instructions differently.
      
      An example would be arch/arm/ (AArch32), where LSL Rd, Rn, #32 results
      in Rd == 0x0, whilst on arch/arm64 (AArch64) LSL Xd, Xn, #64 results in
      Xd == Xn.
      
      Rather than check explicitly for the problematic shift, this patch adds
      an extra shift by 1, replacing fls with __fls. Since zero_bytemask is
      never called with a zero argument (has_zero() is used to check the data
      first), we don't need to worry about calling __fls(0), which is
      undefined.
      
      Cc: <stable@vger.kernel.org>
      Cc: Victor Kamensky <victor.kamensky@linaro.org>
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      ec6931b2
    • Linus Torvalds's avatar
      Merge branch 'safe-dirty-tlb-flush' · ac6c9e2b
      Linus Torvalds authored
      This merges the patch to fix possible loss of dirty bit on munmap() or
      madvice(DONTNEED).  If there are concurrent writers on other CPU's that
      have the unmapped/unneeded page in their TLBs, their writes to the page
      could possibly get lost if a third CPU raced with the TLB flush and did
      a page_mkclean() before the page was fully written.
      
      Admittedly, if you unmap() or madvice(DONTNEED) an area _while_ another
      thread is still busy writing to it, you deserve all the lost writes you
      could get.  But we kernel people hold ourselves to higher quality
      standards than "crazy people deserve to lose", because, well, we've seen
      people do all kinds of crazy things.
      
      So let's get it right, just because we can, and we don't have to worry
      about it.
      
      * safe-dirty-tlb-flush:
        mm: split 'tlb_flush_mmu()' into tlb flushing and memory freeing parts
      ac6c9e2b
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs · 33c0022f
      Linus Torvalds authored
      Pull btrfs fixes from Chris Mason.
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs:
        Btrfs: limit the path size in send to PATH_MAX
        Btrfs: correctly set profile flags on seqlock retry
        Btrfs: use correct key when repeating search for extent item
        Btrfs: fix inode caching vs tree log
        Btrfs: fix possible memory leaks in open_ctree()
        Btrfs: avoid triggering bug_on() when we fail to start inode caching task
        Btrfs: move btrfs_{set,clear}_and_info() to ctree.h
        btrfs: replace error code from btrfs_drop_extents
        btrfs: Change the hole range to a more accurate value.
        btrfs: fix use-after-free in mount_subvol()
      33c0022f
    • Linus Torvalds's avatar
      Merge branch 'fixes' of git://ftp.arm.linux.org.uk/~rmk/linux-arm · 2b9d1c05
      Linus Torvalds authored
      Pull arm fixes from Russell King:
       "A number of fixes for the PJ4/iwmmxt changes which arm-soc forced me
        to take during the merge window.  This stuff should have been better
        tested and sorted out *before* the merge window"
      
      * 'fixes' of git://ftp.arm.linux.org.uk/~rmk/linux-arm:
        ARM: 8042/1: iwmmxt: allow to build iWMMXt on Marvell PJ4B
        ARM: 8041/1: pj4: fix cpu_is_pj4 check
        ARM: 8040/1: pj4: properly detect existence of iWMMXt coprocessor
        ARM: 8039/1: pj4: enable iWMMXt only if CONFIG_IWMMXT is set
        ARM: 8038/1: iwmmxt: explicitly check for supported architectures
      2b9d1c05
    • Linus Torvalds's avatar
      Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux · afa3cad7
      Linus Torvalds authored
      Pull arm64 fixes from Catalin Marinas:
       - compat renameat2 syscall wiring and __NR_compat_syscalls fix
       - TLB fix for transparent huge pages following switch to generic
         mmu_gather
       - spinlock initialisation for init_mm's context
       - move of_clk_init() earlier
       - Kconfig duplicate entry fix
      
      * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
        arm64: init: Move of_clk_init to time_init
        arm64: initialize spinlock for init_mm's context
        arm64: debug: remove noisy, pointless warning
        arm64: mm: Add THP TLB entries to general mmu_gather
        arm64: add renameat2 compat syscall
        ARM64: Remove duplicated Kconfig entry for "kernel/power/Kconfig"
        arm64: __NR_compat_syscalls fix
      afa3cad7
    • Oleg Drokin's avatar
      staging/lustre/llite: Fix a compile warning. · 1da4f83c
      Oleg Drokin authored
      Quiet the warning below in Lustre code.
      Actually the warning is invalid since we either always assign
      the symname in ll_readlink_internal or return an error there and
      then the following rc check would assign symlink variable explicitly.
      
      In file included from /home/green/bk/linux/drivers/staging/lustre/lustre/llite/../include/linux/lustre_compat25.h:41:0,
                       from /home/green/bk/linux/drivers/staging/lustre/lustre/llite/../include/linux/lvfs.h:48,
                       from /home/green/bk/linux/drivers/staging/lustre/lustre/llite/../include/lvfs.h:45,
                       from /home/green/bk/linux/drivers/staging/lustre/lustre/llite/../include/obd_support.h:41,
                       from /home/green/bk/linux/drivers/staging/lustre/lustre/llite/../include/obd_class.h:40,
                       from /home/green/bk/linux/drivers/staging/lustre/lustre/llite/../include/linux/lustre_lite.h:49,
                       from /home/green/bk/linux/drivers/staging/lustre/lustre/llite/../include/lustre_lite.h:45,
                       from /home/green/bk/linux/drivers/staging/lustre/lustre/llite/symlink.c:42:
      /home/green/bk/linux/drivers/staging/lustre/lustre/llite/symlink.c: In function ‘ll_follow_link’:
      /home/green/bk/linux/include/linux/namei.h:88:29: warning: ‘symname’ may be used uninitialized in this function [-Wmaybe-uninitialized]
        nd->saved_names[nd->depth] = path;
                                   ^
      /home/green/bk/linux/drivers/staging/lustre/lustre/llite/symlink.c:123:8: note: ‘symname’ was declared here
        char *symname;
              ^
      Signed-off-by: default avatarOleg Drokin <oleg.drokin@intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      1da4f83c
    • Linus Torvalds's avatar
      Merge branch 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · d9e9e8e2
      Linus Torvalds authored
      Pull irq fixes from Thomas Gleixner:
       "A slighlty large fix for a subtle issue in the CPU hotplug code of
        certain ARM SoCs, where the not yet online cpu needs to setup the cpu
        local timer and needs to set the interrupt affinity to itself.
        Setting interrupt affinity to a not online cpu is prohibited and
        therefor the timer interrupt ends up on the wrong cpu, which leads to
        nasty complications.
      
        The SoC folks tried to hack around that in the SoC code in some more
        than nasty ways.  The proper solution is to have a way to enforce the
        affinity setting to a not online cpu.  The core patch to the genirq
        code provides that facility and the follow up patches make use of it
        in the GIC interrupt controller and the exynos timer driver.
      
        The change to the core code has no implications to existing users,
        except for the rename of the locked function and therefor the
        necessary fixup in mips/cavium.  Aside of that, no runtime impact is
        possible, as none of the existing interrupt chips implements anything
        which depends on the force argument of the irq_set_affinity()
        callback"
      
      * 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        clocksource: Exynos_mct: Register clock event after request_irq()
        clocksource: Exynos_mct: Use irq_force_affinity() in cpu bringup
        irqchip: Gic: Support forced affinity setting
        genirq: Allow forcing cpu affinity of interrupts
      d9e9e8e2
    • Linus Torvalds's avatar
      Merge tag 'tty-3.15-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty · a8d70698
      Linus Torvalds authored
      Pull tty/serial fixes from Greg KH:
       "Here are a few tty/serial fixes for 3.15-rc3 that resolve a number of
        reported issues in the 8250 and samsung serial drivers, as well as a
        character loss fix for the tty core that was caused by the lock
        removal patches a release ago"
      
      * tag 'tty-3.15-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
        serial_core: fix uart PORT_UNKNOWN handling
        serial: samsung: Change barrier() to cpu_relax() in console output
        serial: samsung: don't check config for every character
        serial: samsung: Use the passed in "port", fixing kgdb w/ no console
        serial: 8250: Fix thread unsafe __dma_tx_complete function
        8250_core: Fix unwanted TX chars write
        tty: Fix race condition between __tty_buffer_request_room and flush_to_ldisc
      a8d70698
    • Linus Torvalds's avatar
      Merge tag 'staging-3.15-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging · d0c15ad7
      Linus Torvalds authored
      Pull staging / IIO driver fixes from Greg KH:
       "Here are some small staging and IIO driver fixes for 3.15-rc3.
      
        Nothing major at all, just some assorted issues that people have
        reported"
      
      * tag 'staging-3.15-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging:
        staging: comedi: usbdux: bug fix for accessing 'ao_chanlist' in private data
        iio: adc: mxs-lradc: fix warning when buidling on avr32
        iio: cm36651: Fix i2c client leak and possible NULL pointer dereference
        iio: querying buffer scan_mask should return 0/1
        staging:iio:ad2s1200 fix a missing break
        iio: adc: at91_adc: correct default shtim value
        ARM: at91: at91sam9260: change at91_adc name
        ARM: at91: at91sam9g45: change at91_adc name
        iio: cm32181: Fix read integration time function
        iio: adc: at91_adc: Repair broken platform_data support
      d0c15ad7
    • Bobi Jam's avatar
      staging/lustre/llite: prevent buffer overflow in fiemap · ebdc4fc5
      Bobi Jam authored
      lov_fiemap() does not take consider its @vallen parameter, which is
      the max buffer size the caller can hold for the fiemap extents.
      
      This patch fixes this and limits the max mapped fiemap extent count
      to fit in the preallocted buffer.
      
      This patch also fixes a memory out of bound write issue when the
      fiemap call is only for detecting the number of existing extent.
      Signed-off-by: default avatarBobi Jam <bobijam.xu@intel.com>
      Reviewed-on: http://review.whamcloud.com/9834
      Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4619Reviewed-by: default avatarFan Yong <fan.yong@intel.com>
      Reviewed-by: default avatarPatrick Farrell <paf@cray.com>
      Signed-off-by: default avatarOleg Drokin <oleg.drokin@intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      ebdc4fc5
    • Oleg Drokin's avatar
      staging/lustre: Fix unsafe userspace access in many proc files · a1e7e2d4
      Oleg Drokin authored
      Apparently we are pretty bad about verifying our buffers passed
      from userspace.
      Signed-off-by: default avatarOleg Drokin <oleg.drokin@intel.com>
      Reviewed-on: http://review.whamcloud.com/9059
      Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4563Reviewed-by: default avatarDmitry Eremin <dmitry.eremin@intel.com>
      Reviewed-by: default avatarJames Simmons <uja.ornl@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      a1e7e2d4
    • Andreas Dilger's avatar
      staging/lustre: pass fsync() range through RPC/IO stack · 05289927
      Andreas Dilger authored
      The Linux VFS and Lustre OST_SYNC RPC are both capable of specifying
      fsync() on a sub-extent of the file {start, end} instead of the full
      file.  This allows less than the full amount of data to be flushed,
      reducing or possibly eliminating the work needed before the syscall
      can return.
      
      However, the handling of sub-extent of the file for fsync was lost
      with the move to CLIO on the client and OSD API on the server.  They
      were ignoring the passed {start, end} and using {0, OBD_OBJECT_EOF}
      instead.
      
      Return the ability to pass a sub-extent for fsync() from the client,
      to the specific stripes/OSTs that need the sync operation, and pass
      it down to the OSD.  The ZFS OSD doesn't handle this yet, but there
      is room for improvement in a separate patch.
      Signed-off-by: default avatarAndreas Dilger <andreas.dilger@intel.com>
      Reviewed-on: http://review.whamcloud.com/8626
      Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4388Reviewed-by: default avatarBobi Jam <bobijam@gmail.com>
      Reviewed-by: default avatarJinshan Xiong <jinshan.xiong@intel.com>
      Signed-off-by: default avatarOleg Drokin <oleg.drokin@intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      05289927