1. 07 Mar, 2013 6 commits
    • Linus Torvalds's avatar
      Merge branch 'fixes' of git://git.linaro.org/people/rmk/linux-arm · 19cf3edb
      Linus Torvalds authored
      Pull ARM fixes from Russell King:
       "Mainly a group of fixes, the only exception is the wiring up of the
        kcmp syscall now that those patches went in during the last merge
        window."
      
      * 'fixes' of git://git.linaro.org/people/rmk/linux-arm:
        ARM: 7668/1: fix memset-related crashes caused by recent GCC (4.7.2) optimizations
        ARM: 7667/1: perf: Fix section mismatch on armpmu_init()
        ARM: 7666/1: decompressor: add -mno-single-pic-base for building the decompressor
        ARM: 7665/1: Wire up kcmp syscall
        ARM: 7664/1: perf: remove erroneous semicolon from event initialisation
        ARM: 7663/1: perf: fix ARMv7 EVTYPE_MASK to include NSH bit
        ARM: 7662/1: hw_breakpoint: reset debug logic on secondary CPUs in s2ram resume
        ARM: 7661/1: mm: perform explicit branch predictor maintenance when required
        ARM: 7660/1: tlb: add branch predictor maintenance operations
        ARM: 7659/1: mm: make mm->context.id an atomic64_t variable
        ARM: 7658/1: mm: fix race updating mm->context.id on ASID rollover
        ARM: 7657/1: head: fix swapper and idmap population with LPAE and big-endian
        ARM: 7655/1: smp_twd: make twd_local_timer_of_register() no-op for nosmp
        ARM: 7652/1: mm: fix missing use of 'asid' to get asid value from mm->context.id
        ARM: 7642/1: netx: bump IRQ offset to 64
      19cf3edb
    • Linus Torvalds's avatar
      Merge tag 'regulator-3.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator · d3452436
      Linus Torvalds authored
      Pull regulator fixes from Mark Brown:
       "A few small things here and there, nothing major here really.  The
        conversion of twl4030ldo_ops to get_voltage_sel is a fix, as covered
        in the commit log it fixes inconsistency in handling of the IS_UNSUP()
        feature in the driver."
      
      * tag 'regulator-3.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator:
        regulator: fixed regulator_bulk_enable unwinding code
        regulator: twl: Convert twl4030ldo_ops to get_voltage_sel
        regulator: palmas: fix number of SMPS voltages
        regulator: core: fix documentation error in regulator_allow_bypass
        regulator: core: update kernel documentation for regulator_desc
        regulator: db8500-prcmu - remove incorrect __exit markup
      d3452436
    • Linus Torvalds's avatar
      Merge tag 'regmap-v3.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap · 0c8150d2
      Linus Torvalds authored
      Pull regmap PM fix from Mark Brown:
       "A simple fix to stop us leaking a runtime PM reference in the case
        where we fail to enable a device."
      
      * tag 'regmap-v3.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap:
        regmap: irq: call pm_runtime_put in pm_runtime_get_sync failed case
      0c8150d2
    • Linus Torvalds's avatar
      Merge tag 'ecryptfs-3.9-rc2-fixes' of... · e2e091fd
      Linus Torvalds authored
      Merge tag 'ecryptfs-3.9-rc2-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tyhicks/ecryptfs
      
      Pull ecryptfs fixes from Tyler Hicks:
       "Minor code cleanups and new Kconfig option to disable /dev/ecryptfs
      
        The code cleanups fix up W=1 compiler warnings and some unnecessary
        checks.  The new Kconfig option, defaulting to N, allows the rarely
        used eCryptfs kernel to userspace communication channel to be compiled
        out.  This may be the first step in it being eventually removed."
      
      Hmm.  I'm not sure whether these should be called "fixes", and it
      probably should have gone in the merge window.  But I'll let it slide.
      
      * tag 'ecryptfs-3.9-rc2-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tyhicks/ecryptfs:
        eCryptfs: allow userspace messaging to be disabled
        eCryptfs: Fix redundant error check on ecryptfs_find_daemon_by_euid()
        ecryptfs: ecryptfs_msg_ctx_alloc_to_free(): remove kfree() redundant null check
        eCryptfs: decrypt_pki_encrypted_session_key(): remove kfree() redundant null check
        eCryptfs: remove unneeded checks in virt_to_scatterlist()
        eCryptfs: Fix -Wmissing-prototypes warnings
        eCryptfs: Fix -Wunused-but-set-variable warnings
        eCryptfs: initialize payload_len in keystore.c
      e2e091fd
    • Linus Torvalds's avatar
      Merge tag 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging · cd66acb4
      Linus Torvalds authored
      Pull hwmon patches from Guenter Roeck:
       "Bug fixes for sht15 and ltc2978 driver plus some documentation
        updates"
      
      * tag 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
        hwmon: (sht15) Check return value of regulator_enable()
        hwmon: (adt7410) Document ADT7420 support
        hwmon: (pmbus/ltc2978) Use detected chip ID to select supported functionality
        hwmon: (pmbus/ltc2978) Fix peak attribute handling
        hwmon: (pmbus/ltc2978) Update datasheet links
        hwmon: Update my e-mail address in driver documentation
      cd66acb4
    • Ivan Djelic's avatar
      ARM: 7668/1: fix memset-related crashes caused by recent GCC (4.7.2) optimizations · 455bd4c4
      Ivan Djelic authored
      Recent GCC versions (e.g. GCC-4.7.2) perform optimizations based on
      assumptions about the implementation of memset and similar functions.
      The current ARM optimized memset code does not return the value of
      its first argument, as is usually expected from standard implementations.
      
      For instance in the following function:
      
      void debug_mutex_lock_common(struct mutex *lock, struct mutex_waiter *waiter)
      {
      	memset(waiter, MUTEX_DEBUG_INIT, sizeof(*waiter));
      	waiter->magic = waiter;
      	INIT_LIST_HEAD(&waiter->list);
      }
      
      compiled as:
      
      800554d0 <debug_mutex_lock_common>:
      800554d0:       e92d4008        push    {r3, lr}
      800554d4:       e1a00001        mov     r0, r1
      800554d8:       e3a02010        mov     r2, #16 ; 0x10
      800554dc:       e3a01011        mov     r1, #17 ; 0x11
      800554e0:       eb04426e        bl      80165ea0 <memset>
      800554e4:       e1a03000        mov     r3, r0
      800554e8:       e583000c        str     r0, [r3, #12]
      800554ec:       e5830000        str     r0, [r3]
      800554f0:       e5830004        str     r0, [r3, #4]
      800554f4:       e8bd8008        pop     {r3, pc}
      
      GCC assumes memset returns the value of pointer 'waiter' in register r0; causing
      register/memory corruptions.
      
      This patch fixes the return value of the assembly version of memset.
      It adds a 'mov' instruction and merges an additional load+store into
      existing load/store instructions.
      For ease of review, here is a breakdown of the patch into 4 simple steps:
      
      Step 1
      ======
      Perform the following substitutions:
      ip -> r8, then
      r0 -> ip,
      and insert 'mov ip, r0' as the first statement of the function.
      At this point, we have a memset() implementation returning the proper result,
      but corrupting r8 on some paths (the ones that were using ip).
      
      Step 2
      ======
      Make sure r8 is saved and restored when (! CALGN(1)+0) == 1:
      
      save r8:
      -       str     lr, [sp, #-4]!
      +       stmfd   sp!, {r8, lr}
      
      and restore r8 on both exit paths:
      -       ldmeqfd sp!, {pc}               @ Now <64 bytes to go.
      +       ldmeqfd sp!, {r8, pc}           @ Now <64 bytes to go.
      (...)
              tst     r2, #16
              stmneia ip!, {r1, r3, r8, lr}
      -       ldr     lr, [sp], #4
      +       ldmfd   sp!, {r8, lr}
      
      Step 3
      ======
      Make sure r8 is saved and restored when (! CALGN(1)+0) == 0:
      
      save r8:
      -       stmfd   sp!, {r4-r7, lr}
      +       stmfd   sp!, {r4-r8, lr}
      
      and restore r8 on both exit paths:
              bgt     3b
      -       ldmeqfd sp!, {r4-r7, pc}
      +       ldmeqfd sp!, {r4-r8, pc}
      (...)
              tst     r2, #16
              stmneia ip!, {r4-r7}
      -       ldmfd   sp!, {r4-r7, lr}
      +       ldmfd   sp!, {r4-r8, lr}
      
      Step 4
      ======
      Rewrite register list "r4-r7, r8" as "r4-r8".
      Signed-off-by: default avatarIvan Djelic <ivan.djelic@parrot.com>
      Reviewed-by: default avatarNicolas Pitre <nico@linaro.org>
      Signed-off-by: default avatarDirk Behme <dirk.behme@gmail.com>
      Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
      455bd4c4
  2. 06 Mar, 2013 9 commits
    • Stephen Boyd's avatar
      ARM: 7667/1: perf: Fix section mismatch on armpmu_init() · 44d6b1fc
      Stephen Boyd authored
      WARNING: vmlinux.o(.text+0xfb80): Section mismatch in reference
      from the function armpmu_register() to the function
      .init.text:armpmu_init()
      The function armpmu_register() references
      the function __init armpmu_init().
      This is often because armpmu_register lacks a __init
      annotation or the annotation of armpmu_init is wrong.
      
      Just drop the __init marking on armpmu_init() because
      armpmu_register() no longer has an __init marking.
      Acked-by: default avatarWill Deacon <will.deacon@arm.com>
      Signed-off-by: default avatarStephen Boyd <sboyd@codeaurora.org>
      Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
      44d6b1fc
    • Jonathan Austin's avatar
      ARM: 7666/1: decompressor: add -mno-single-pic-base for building the decompressor · b8083f86
      Jonathan Austin authored
      Before jumping to (position independent) C-code from the decompressor's
      assembler world we set-up the C environment. This setup currently does not
      set r9, which for arm-none-uclinux-uclibceabi toolchains is by default
      expected to be the PIC offset base register (IE should point to the
      beginning of the GOT).
      
      Currently, therefore, in order to build working kernels that use the
      decompressor it is necessary to use an arm-linux-gnueabi toolchain, or
      similar. uClinux toolchains cause a prefetch abort to occur at the beginning
      of the decompress_kernel function.
      
      This patch allows uClinux toolchains to build bootable zImages by forcing
      the -mno-single-pic-base option, which ensures that the location of the GOT
      is re-derived each time it is required, and r9 becomes free for use as a
      general purpose register.
      
      This has a small (4% in instruction terms) advantage over the alternative of
      setting r9 to point to the GOT before calling into the C-world.
      Signed-off-by: default avatarJonathan Austin <jonathan.austin@arm.com>
      Acked-by: default avatarNicolas Pitre <nico@linaro.org>
      Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
      b8083f86
    • Linus Torvalds's avatar
      Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc · 9f225788
      Linus Torvalds authored
      Pull powerpc fixes from Ben Herrenschmidt:
       "Here are a few powerpc bits & fixes for rc1.  A couple of str*cpy
        fixes, some fixes in handling the FSCR register on Power8 (controls
        the enabling of processor features), a 32-bit build fix and a couple
        more nits."
      
      * 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc:
        powerpc: Set DSCR bit in FSCR setup
        powerpc: Add DSCR FSCR register bit definition
        powerpc: Fix setting FSCR for HV=0 and on secondary CPUs
        powerpc: Wireup the kcmp syscall to sys_ni
        powerpc: Remove unused BITOP_LE_SWIZZLE macro
        powerpc: Avoid link stack corruption in MMU on syscall entry path
        drivers/tty/hvc: Use strlcpy instead of strncpy
        powerpc/pseries/hvcserver: Fix strncpy buffer limit in location code
        powerpc: Fix compile of sha1-powerpc-asm.S on 32-bit
      9f225788
    • Linus Torvalds's avatar
      Merge tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux · d7b815d4
      Linus Torvalds authored
      Pull virtio hwrng fix from Rusty Russell:
       "Nasty side-effect of vmalloc'ing modules: their static vars cannot be
        put into scatterlists.  Jens has a check queued for this, so it
        shouldn't happen again.
      
        We could fix this in virtio_rng, but it's actually far easier to just
        do it in the core"
      
      * tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux:
        hw_random: make buffer usable in scatterlist.
      d7b815d4
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · 9da060d0
      Linus Torvalds authored
      Pull networking fixes from David Miller:
       "A moderately sized pile of fixes, some specifically for merge window
        introduced regressions although others are for longer standing items
        and have been queued up for -stable.
      
        I'm kind of tired of all the RDS protocol bugs over the years, to be
        honest, it's way out of proportion to the number of people who
        actually use it.
      
         1) Fix missing range initialization in netfilter IPSET, from Jozsef
            Kadlecsik.
      
         2) ieee80211_local->tim_lock needs to use BH disabling, from Johannes
            Berg.
      
         3) Fix DMA syncing in SFC driver, from Ben Hutchings.
      
         4) Fix regression in BOND device MAC address setting, from Jiri
            Pirko.
      
         5) Missing usb_free_urb in ISDN Hisax driver, from Marina Makienko.
      
         6) Fix UDP checksumming in bnx2x driver for 57710 and 57711 chips,
            fix from Dmitry Kravkov.
      
         7) Missing cfgspace_lock initialization in BCMA driver.
      
         8) Validate parameter size for SCTP assoc stats getsockopt(), from
            Guenter Roeck.
      
         9) Fix SCTP association hangs, from Lee A Roberts.
      
        10) Fix jumbo frame handling in r8169, from Francois Romieu.
      
        11) Fix phy_device memory leak, from Petr Malat.
      
        12) Omit trailing FCS from frames received in BGMAC driver, from Hauke
            Mehrtens.
      
        13) Missing socket refcount release in L2TP, from Guillaume Nault.
      
        14) sctp_endpoint_init should respect passed in gfp_t, rather than use
            GFP_KERNEL unconditionally.  From Dan Carpenter.
      
        15) Add AISX AX88179 USB driver, from Freddy Xin.
      
        16) Remove MAINTAINERS entries for drivers deleted during the merge
            window, from Cesar Eduardo Barros.
      
        17) RDS protocol can try to allocate huge amounts of memory, check
            that the user's request length makes sense, from Cong Wang.
      
        18) SCTP should use the provided KMALLOC_MAX_SIZE instead of it's own,
            bogus, definition.  From Cong Wang.
      
        19) Fix deadlocks in FEC driver by moving TX reclaim into NAPI poll,
            from Frank Li.  Also, fix a build error introduced in the merge
            window.
      
        20) Fix bogus purging of default routes in ipv6, from Lorenzo Colitti.
      
        21) Don't double count RTT measurements when we leave the TCP receive
            fast path, from Neal Cardwell."
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (61 commits)
        tcp: fix double-counted receiver RTT when leaving receiver fast path
        CAIF: fix sparse warning for caif_usb
        rds: simplify a warning message
        net: fec: fix build error in no MXC platform
        net: ipv6: Don't purge default router if accept_ra=2
        net: fec: put tx to napi poll function to fix dead lock
        sctp: use KMALLOC_MAX_SIZE instead of its own MAX_KMALLOC_SIZE
        rds: limit the size allocated by rds_message_alloc()
        MAINTAINERS: remove eexpress
        MAINTAINERS: remove drivers/net/wan/cycx*
        MAINTAINERS: remove 3c505
        caif_dev: fix sparse warnings for caif_flow_cb
        ax88179_178a: ASIX AX88179_178A USB 3.0/2.0 to gigabit ethernet adapter driver
        sctp: use the passed in gfp flags instead GFP_KERNEL
        ipv[4|6]: correct dropwatch false positive in local_deliver_finish
        l2tp: Restore socket refcount when sendmsg succeeds
        net/phy: micrel: Disable asymmetric pause for KSZ9021
        bgmac: omit the fcs
        phy: Fix phy_device_free memory leak
        bnx2x: Fix KR2 work-around condition
        ...
      9da060d0
    • Linus Torvalds's avatar
      Merge branch 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · e3b59518
      Linus Torvalds authored
      Pull irq fixes and cleanups from Thomas Gleixner:
       "Commit e5ab012c ("nohz: Make tick_nohz_irq_exit() irq safe") is
        the first commit in the series and the minimal necessary bugfix, which
        needs to go back into stable.
      
        The remanining commits enforce irq disabling in irq_exit(), sanitize
        the hardirq/softirq preempt count transition and remove a bunch of no
        longer necessary conditionals."
      
      I personally love getting rid of the very subtle and confusing
      IRQ_EXIT_OFFSET thing.  Even apart from the whole "more lines removed
      than added" thing.
      
      * 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        irq: Don't re-enable interrupts at the end of irq_exit
        irq: Remove IRQ_EXIT_OFFSET workaround
        Revert "nohz: Make tick_nohz_irq_exit() irq safe"
        irq: Sanitize invoke_softirq
        irq: Ensure irq_exit() code runs with interrupts disabled
        nohz: Make tick_nohz_irq_exit() irq safe
      e3b59518
    • Linus Torvalds's avatar
      Merge branch 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 6516ab6f
      Linus Torvalds authored
      Pull smpboot bugfix from Thomas Gleixner:
       "A single bugfix for a regression introduced with the conversion of the
        stop machine threads to the generic smpboot thread management
        facility"
      
      * 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        stop_machine: Mark per cpu stopper enabled early
      6516ab6f
    • Linus Torvalds's avatar
      Merge tag 'gpio-for-linus' of git://git.secretlab.ca/git/linux · 06e79d3b
      Linus Torvalds authored
      Pull second round of GPIO changes from Grant Likely:
       "This branch contains a few bug fixes that I missed the first time
        around and updates to the gpio_desc series included in the first pull
        request.  This tag has been retagged to drop the 2 head commits
        because the one of them caused a build failure."
      
      * tag 'gpio-for-linus' of git://git.secretlab.ca/git/linux:
        gpio/gpio-ich: fix ichx_gpio_check_available() return what callers expect
        gpiolib: move comment to right function
        gpiolib: use const parameters when possible
        gpiolib: check descriptors validity before use
      06e79d3b
    • Linus Torvalds's avatar
      Merge tag 'md-3.9' of git://neil.brown.name/md · a5e0d731
      Linus Torvalds authored
      Pull md updates from NeilBrown:
       "Mostly little bugfixes.
      
        Only "feature" is a new RAID10 layout which slightly improves the
        number of sets of devices that can concurrently fail, without data
        loss."
      
      * tag 'md-3.9' of git://neil.brown.name/md:
        md: expedite metadata update when switching  read-auto -> active
        md: remove CONFIG_MULTICORE_RAID456
        md/raid1,raid10: fix deadlock with freeze_array()
        md/raid0: improve error message when converting RAID4-with-spares to RAID0
        md: raid0: fix error return from create_stripe_zones.
        md: fix two bugs when attempting to resize RAID0 array.
        DM RAID: Add support for MD's RAID10 "far" and "offset" algorithms
        MD RAID10: Improve redundancy for 'far' and 'offset' algorithms (part 2)
        MD RAID10: Improve redundancy for 'far' and 'offset' algorithms (part 1)
        MD RAID10: Minor non-functional code changes
        md: raid1,10: Handle REQ_WRITE_SAME flag in write bios
        md: protect against crash upon fsync on ro array
      a5e0d731
  3. 05 Mar, 2013 14 commits
  4. 04 Mar, 2013 11 commits
    • Rusty Russell's avatar
      hw_random: make buffer usable in scatterlist. · f7f154f1
      Rusty Russell authored
      virtio_rng feeds the randomness buffer handed by the core directly
      into the scatterlist, since commit bb347d98.
      
      However, if CONFIG_HW_RANDOM=m, the static buffer isn't a linear address
      (at least on most archs).  We could fix this in virtio_rng, but it's actually
      far easier to just do it in the core as virtio_rng would have to allocate
      a buffer every time (it doesn't know how much the core will want to read).
      Reported-by: default avatarAurelien Jarno <aurelien@aurel32.net>
      Tested-by: default avatarAurelien Jarno <aurelien@aurel32.net>
      Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
      Cc: stable@kernel.org
      f7f154f1
    • Neal Cardwell's avatar
      tcp: fix double-counted receiver RTT when leaving receiver fast path · aab2b4bf
      Neal Cardwell authored
      We should not update ts_recent and call tcp_rcv_rtt_measure_ts() both
      before and after going to step5. That wastes CPU and double-counts the
      receiver-side RTT sample.
      Signed-off-by: default avatarNeal Cardwell <ncardwell@google.com>
      Acked-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      aab2b4bf
    • Silviu-Mihai Popescu's avatar
      CAIF: fix sparse warning for caif_usb · d2123be0
      Silviu-Mihai Popescu authored
      This fixes the following sparse warning:
      net/caif/caif_usb.c:84:16: warning: symbol 'cfusbl_create' was not
      declared. Should it be static?
      Signed-off-by: default avatarSilviu-Mihai Popescu <silviupopescu1990@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d2123be0
    • Cong Wang's avatar
      rds: simplify a warning message · 7dac1b51
      Cong Wang authored
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Venkat Venkatsubra <venkat.x.venkatsubra@oracle.com>
      Signed-off-by: default avatarCong Wang <amwang@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7dac1b51
    • Frank Li's avatar
      net: fec: fix build error in no MXC platform · acac8406
      Frank Li authored
      build error cause by
      Commit ff43da86
      ("NET: FEC: dynamtic check DMA desc buff type")
      
      drivers/net/ethernet/freescale/fec.c: In function ‘fec_enet_get_nextdesc’:
      drivers/net/ethernet/freescale/fec.c:215:18: error: invalid use of undefined type ‘struct bufdesc_ex’
      drivers/net/ethernet/freescale/fec.c: In function ‘fec_enet_get_prevdesc’:
      drivers/net/ethernet/freescale/fec.c:224:18: error: invalid use of undefined type ‘struct bufdesc_ex’
      drivers/net/ethernet/freescale/fec.c: In function ‘fec_enet_start_xmit’:
      drivers/net/ethernet/freescale/fec.c:286:37: error: arithmetic on pointer to an incomplete type
      drivers/net/ethernet/freescale/fec.c:287:13: error: arithmetic on pointer to an incomplete type
      drivers/net/ethernet/freescale/fec.c:324:7: error: dereferencing pointer to incomplete type etc....
      Signed-off-by: default avatarFrank Li <Frank.Li@freescale.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      acac8406
    • Lorenzo Colitti's avatar
      net: ipv6: Don't purge default router if accept_ra=2 · 3e8b0ac3
      Lorenzo Colitti authored
      Setting net.ipv6.conf.<interface>.accept_ra=2 causes the kernel
      to accept RAs even when forwarding is enabled. However, enabling
      forwarding purges all default routes on the system, breaking
      connectivity until the next RA is received. Fix this by not
      purging default routes on interfaces that have accept_ra=2.
      Signed-off-by: default avatarLorenzo Colitti <lorenzo@google.com>
      Acked-by: default avatarYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
      Acked-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3e8b0ac3
    • Frank Li's avatar
      net: fec: put tx to napi poll function to fix dead lock · de5fb0a0
      Frank Li authored
      up stack ndo_start_xmit already hold lock.
      fec_enet_start_xmit needn't spin lock.
      stat_xmit just update fep->cur_tx
      fec_enet_tx just update fep->dirty_tx
      
      Reserve a empty bdb to check full or empty
      cur_tx == dirty_tx    means full
      cur_tx == dirty_tx +1 means empty
      
      So needn't is_full variable.
      
      Fix spin lock deadlock
      
      =================================
      [ INFO: inconsistent lock state ]
      3.8.0-rc5+ #107 Not tainted
      ---------------------------------
      inconsistent {HARDIRQ-ON-W} -> {IN-HARDIRQ-W} usage.
      ptp4l/615 [HC1[1]:SC0[0]:HE0:SE1] takes:
       (&(&list->lock)->rlock#3){?.-...}, at: [<8042c3c4>] skb_queue_tail+0x20/0x50
       {HARDIRQ-ON-W} state was registered at:
       [<80067250>] mark_lock+0x154/0x4e8
       [<800676f4>] mark_irqflags+0x110/0x1a4
       [<80069208>] __lock_acquire+0x494/0x9c0
       [<80069ce8>] lock_acquire+0x90/0xa4
       [<80527ad0>] _raw_spin_lock_bh+0x44/0x54
       [<804877e0>] first_packet_length+0x38/0x1f0
       [<804879e4>] udp_poll+0x4c/0x5c
       [<804231f8>] sock_poll+0x24/0x28
       [<800d27f0>] do_poll.isra.10+0x120/0x254
       [<800d36e4>] do_sys_poll+0x15c/0x1e8
       [<800d3828>] sys_poll+0x60/0xc8
       [<8000e780>] ret_fast_syscall+0x0/0x3c
      
       *** DEADLOCK ***
      
       1 lock held by ptp4l/615:
        #0:  (&(&fep->hw_lock)->rlock){-.-...}, at: [<80355f9c>] fec_enet_tx+0x24/0x268
        stack backtrace:
        Backtrace:
        [<800121e0>] (dump_backtrace+0x0/0x10c) from [<80516210>] (dump_stack+0x18/0x1c)
        r6:8063b1fc r5:bf38b2f8 r4:bf38b000 r3:bf38b000
        [<805161f8>] (dump_stack+0x0/0x1c) from [<805189d0>] (print_usage_bug.part.34+0x164/0x1a4)
        [<8051886c>] (print_usage_bug.part.34+0x0/0x1a4) from [<80518a88>] (print_usage_bug+0x78/0x88)
        r8:80065664 r7:bf38b2f8 r6:00000002 r5:00000000 r4:bf38b000
        [<80518a10>] (print_usage_bug+0x0/0x88) from [<80518b58>] (mark_lock_irq+0xc0/0x270)
        r7:bf38b000 r6:00000002 r5:bf38b2f8 r4:00000000
        [<80518a98>] (mark_lock_irq+0x0/0x270) from [<80067270>] (mark_lock+0x174/0x4e8)
        [<800670fc>] (mark_lock+0x0/0x4e8) from [<80067744>] (mark_irqflags+0x160/0x1a4)
        [<800675e4>] (mark_irqflags+0x0/0x1a4) from [<80069208>] (__lock_acquire+0x494/0x9c0)
        r5:00000002 r4:bf38b2f8
        [<80068d74>] (__lock_acquire+0x0/0x9c0) from [<80069ce8>] (lock_acquire+0x90/0xa4)
        [<80069c58>] (lock_acquire+0x0/0xa4) from [<805278d8>] (_raw_spin_lock_irqsave+0x4c/0x60)
        [<8052788c>] (_raw_spin_lock_irqsave+0x0/0x60) from [<8042c3c4>] (skb_queue_tail+0x20/0x50)
        r6:bfbb2180 r5:bf1d0190 r4:bf1d0184
        [<8042c3a4>] (skb_queue_tail+0x0/0x50) from [<8042c4cc>] (sock_queue_err_skb+0xd8/0x188)
        r6:00000056 r5:bfbb2180 r4:bf1d0000 r3:00000000
        [<8042c3f4>] (sock_queue_err_skb+0x0/0x188) from [<8042d15c>] (skb_tstamp_tx+0x70/0xa0)
        r6:bf0dddb0 r5:bf1d0000 r4:bfbb2180 r3:00000004
        [<8042d0ec>] (skb_tstamp_tx+0x0/0xa0) from [<803561d0>] (fec_enet_tx+0x258/0x268)
        r6:c089d260 r5:00001c00 r4:bfbd0000
        [<80355f78>] (fec_enet_tx+0x0/0x268) from [<803562cc>] (fec_enet_interrupt+0xec/0xf8)
        [<803561e0>] (fec_enet_interrupt+0x0/0xf8) from [<8007d5b0>] (handle_irq_event_percpu+0x54/0x1a0)
        [<8007d55c>] (handle_irq_event_percpu+0x0/0x1a0) from [<8007d740>] (handle_irq_event+0x44/0x64)
        [<8007d6fc>] (handle_irq_event+0x0/0x64) from [<80080690>] (handle_fasteoi_irq+0xc4/0x15c)
        r6:bf0dc000 r5:bf811290 r4:bf811240 r3:00000000
        [<800805cc>] (handle_fasteoi_irq+0x0/0x15c) from [<8007ceec>] (generic_handle_irq+0x28/0x38)
        r5:807130c8 r4:00000096
        [<8007cec4>] (generic_handle_irq+0x0/0x38) from [<8000f16c>] (handle_IRQ+0x54/0xb4)
        r4:8071d280 r3:00000180
        [<8000f118>] (handle_IRQ+0x0/0xb4) from [<80008544>] (gic_handle_irq+0x30/0x64)
        r8:8000e924 r7:f4000100 r6:bf0ddef8 r5:8071c974 r4:f400010c
        r3:00000000
        [<80008514>] (gic_handle_irq+0x0/0x64) from [<8000e2e4>] (__irq_svc+0x44/0x5c)
        Exception stack(0xbf0ddef8 to 0xbf0ddf40)
      Signed-off-by: default avatarFrank Li <Frank.Li@freescale.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      de5fb0a0
    • Cong Wang's avatar
      sctp: use KMALLOC_MAX_SIZE instead of its own MAX_KMALLOC_SIZE · 3f736868
      Cong Wang authored
      Don't definite its own MAX_KMALLOC_SIZE, use the one
      defined in mm.
      
      Cc: Vlad Yasevich <vyasevich@gmail.com>
      Cc: Sridhar Samudrala <sri@us.ibm.com>
      Cc: Neil Horman <nhorman@tuxdriver.com>
      Cc: David S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarCong Wang <amwang@redhat.com>
      Acked-by: default avatarNeil Horman <nhorman@tuxdriver.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3f736868
    • Cong Wang's avatar
      rds: limit the size allocated by rds_message_alloc() · ece6b0a2
      Cong Wang authored
      Dave Jones reported the following bug:
      
      "When fed mangled socket data, rds will trust what userspace gives it,
      and tries to allocate enormous amounts of memory larger than what
      kmalloc can satisfy."
      
      WARNING: at mm/page_alloc.c:2393 __alloc_pages_nodemask+0xa0d/0xbe0()
      Hardware name: GA-MA78GM-S2H
      Modules linked in: vmw_vsock_vmci_transport vmw_vmci vsock fuse bnep dlci bridge 8021q garp stp mrp binfmt_misc l2tp_ppp l2tp_core rfcomm s
      Pid: 24652, comm: trinity-child2 Not tainted 3.8.0+ #65
      Call Trace:
       [<ffffffff81044155>] warn_slowpath_common+0x75/0xa0
       [<ffffffff8104419a>] warn_slowpath_null+0x1a/0x20
       [<ffffffff811444ad>] __alloc_pages_nodemask+0xa0d/0xbe0
       [<ffffffff8100a196>] ? native_sched_clock+0x26/0x90
       [<ffffffff810b2128>] ? trace_hardirqs_off_caller+0x28/0xc0
       [<ffffffff810b21cd>] ? trace_hardirqs_off+0xd/0x10
       [<ffffffff811861f8>] alloc_pages_current+0xb8/0x180
       [<ffffffff8113eaaa>] __get_free_pages+0x2a/0x80
       [<ffffffff811934fe>] kmalloc_order_trace+0x3e/0x1a0
       [<ffffffff81193955>] __kmalloc+0x2f5/0x3a0
       [<ffffffff8104df0c>] ? local_bh_enable_ip+0x7c/0xf0
       [<ffffffffa0401ab3>] rds_message_alloc+0x23/0xb0 [rds]
       [<ffffffffa04043a1>] rds_sendmsg+0x2b1/0x990 [rds]
       [<ffffffff810b21cd>] ? trace_hardirqs_off+0xd/0x10
       [<ffffffff81564620>] sock_sendmsg+0xb0/0xe0
       [<ffffffff810b2052>] ? get_lock_stats+0x22/0x70
       [<ffffffff810b24be>] ? put_lock_stats.isra.23+0xe/0x40
       [<ffffffff81567f30>] sys_sendto+0x130/0x180
       [<ffffffff810b872d>] ? trace_hardirqs_on+0xd/0x10
       [<ffffffff816c547b>] ? _raw_spin_unlock_irq+0x3b/0x60
       [<ffffffff816cd767>] ? sysret_check+0x1b/0x56
       [<ffffffff810b8695>] ? trace_hardirqs_on_caller+0x115/0x1a0
       [<ffffffff81341d8e>] ? trace_hardirqs_on_thunk+0x3a/0x3f
       [<ffffffff816cd742>] system_call_fastpath+0x16/0x1b
      ---[ end trace eed6ae990d018c8b ]---
      Reported-by: default avatarDave Jones <davej@redhat.com>
      Cc: Dave Jones <davej@redhat.com>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Venkat Venkatsubra <venkat.x.venkatsubra@oracle.com>
      Signed-off-by: default avatarCong Wang <amwang@redhat.com>
      Acked-by: default avatarVenkat Venkatsubra <venkat.x.venkatsubra@oracle.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ece6b0a2
    • Kees Cook's avatar
      eCryptfs: allow userspace messaging to be disabled · 290502be
      Kees Cook authored
      When the userspace messaging (for the less common case of userspace key
      wrap/unwrap via ecryptfsd) is not needed, allow eCryptfs to build with
      it removed. This saves on kernel code size and reduces potential attack
      surface by removing the /dev/ecryptfs node.
      Signed-off-by: default avatarKees Cook <keescook@chromium.org>
      Signed-off-by: default avatarTyler Hicks <tyhicks@canonical.com>
      290502be
    • Mark Brown's avatar
      hwmon: (sht15) Check return value of regulator_enable() · 3e78080f
      Mark Brown authored
      Not having power is a pretty serious error so check that we are able to
      enable the supply and error out if we can't.
      Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
      Cc: stable@vger.kernel.org #3.8+; 3.0+ will need manual backport
      Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
      3e78080f