Skip to content
  1. Nov 12, 2016
    • Arnd Bergmann's avatar
      pcmcia: fix return value of soc_pcmcia_regulator_set · 75ed2687
      Arnd Bergmann authored
      The newly introduced soc_pcmcia_regulator_set() function sometimes
      returns without setting its return code, as shown by this warning:
      
        drivers/pcmcia/soc_common.c: In function 'soc_pcmcia_regulator_set':
        drivers/pcmcia/soc_common.c:112:5: error: 'ret' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      
      This changes it to propagate the regulator_disable() result instead.
      
      Fixes: ac61b600
      
       ("pcmcia: soc_common: add support for Vcc and Vpp regulators")
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      75ed2687
    • Arnd Bergmann's avatar
      infiniband: shut up a maybe-uninitialized warning · c50e90d0
      Arnd Bergmann authored
      
      
      Some configurations produce this harmless warning when built with gcc
      -Wmaybe-uninitialized:
      
        infiniband/core/cma.c: In function 'cma_get_net_dev':
        infiniband/core/cma.c:1242:12: warning: 'src_addr_storage.sin_addr.s_addr' may be used uninitialized in this function [-Wmaybe-uninitialized]
      
      I previously reported this for the powerpc64 defconfig, but have now
      reproduced the same thing for x86 as well, using gcc-5 or higher.
      
      The code looks correct to me, and this change just rearranges it by
      making sure we alway initialize the entire address structure to make the
      warning disappear.  My first approach added an initialization at the
      time of the declaration, which Doug commented may be too costly, so I
      hope this version doesn't add overhead.
      
      Link: http://arm-soc.lixom.net/buildlogs/mainline/v4.7-rc6/buildall.powerpc.ppc64_defconfig.log.passed
      Link: https://patchwork.kernel.org/patch/9212825/
      Acked-by: default avatarHaggai Eran <haggaie@mellanox.com>
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      c50e90d0
    • Arnd Bergmann's avatar
      crypto: aesni: shut up -Wmaybe-uninitialized warning · beae2c9e
      Arnd Bergmann authored
      
      
      The rfc4106 encrypy/decrypt helper functions cause an annoying
      false-positive warning in allmodconfig if we turn on
      -Wmaybe-uninitialized warnings again:
      
        arch/x86/crypto/aesni-intel_glue.c: In function ‘helper_rfc4106_decrypt’:
        include/linux/scatterlist.h:67:31: warning: ‘dst_sg_walk.sg’ may be used uninitialized in this function [-Wmaybe-uninitialized]
      
      The problem seems to be that the compiler doesn't track the state of the
      'one_entry_in_sg' variable across the kernel_fpu_begin/kernel_fpu_end
      section.
      
      This takes the easy way out by adding a bogus initialization, which
      should be harmless enough to get the patch into v4.9 so we can turn on
      this warning again by default without producing useless output.  A
      follow-up patch for v4.10 rearranges the code to make the warning go
      away.
      
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      beae2c9e
    • Arnd Bergmann's avatar
      rc: print correct variable for z8f0811 · 9cdbe14f
      Arnd Bergmann authored
      A recent rework accidentally left a debugging printk untouched while
      changing the meaning of the variables, leading to an uninitialized
      variable being printed:
      
        drivers/media/i2c/ir-kbd-i2c.c: In function 'get_key_haup_common':
        drivers/media/i2c/ir-kbd-i2c.c:62:2: error: 'toggle' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      
      This prints the correct one instead, as we did before the patch.
      
      Fixes: 00bb8207
      
       ("[media] rc: Hauppauge z8f0811 can decode RC6")
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      9cdbe14f
    • Sean Young's avatar
      dib0700: fix nec repeat handling · ba13e98f
      Sean Young authored
      
      
      When receiving a nec repeat, ensure the correct scancode is repeated
      rather than a random value from the stack.  This removes the need for
      the bogus uninitialized_var() and also fixes the warnings:
      
          drivers/media/usb/dvb-usb/dib0700_core.c: In function ‘dib0700_rc_urb_completion’:
          drivers/media/usb/dvb-usb/dib0700_core.c:679: warning: ‘protocol’ may be used uninitialized in this function
      
      [sean addon: So after writing the patch and submitting it, I've bought the
                   hardware on ebay. Without this patch you get random scancodes
                   on nec repeats, which the patch indeed fixes.]
      
      Signed-off-by: default avatarSean Young <sean@mess.org>
      Tested-by: default avatarSean Young <sean@mess.org>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      ba13e98f
    • Arnd Bergmann's avatar
      s390: pci: don't print uninitialized data for debugging · 92dfffee
      Arnd Bergmann authored
      
      
      gcc correctly warns about an incorrect use of the 'pa' variable in case
      we pass an empty scatterlist to __s390_dma_map_sg:
      
        arch/s390/pci/pci_dma.c: In function '__s390_dma_map_sg':
        arch/s390/pci/pci_dma.c:309:13: warning: 'pa' may be used uninitialized in this function [-Wmaybe-uninitialized]
      
      This adds a bogus initialization to the function to sanitize the debug
      output.  I would have preferred a solution without the initialization,
      but I only got the report from the kbuild bot after turning on the
      warning again, and didn't manage to reproduce it myself.
      
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Acked-by: default avatarSebastian Ott <sebott@linux.vnet.ibm.com>
      Acked-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      92dfffee
    • Arnd Bergmann's avatar
      nios2: fix timer initcall return value · 069013a9
      Arnd Bergmann authored
      
      
      When called more than twice, the nios2_time_init() function return an
      uninitialized value, as detected by gcc -Wmaybe-uninitialized
      
        arch/nios2/kernel/time.c: warning: 'ret' may be used uninitialized in this function
      
      This makes it return '0' here, matching the comment above the function.
      
      Acked-by: default avatarLey Foon Tan <lftan@altera.com>
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      069013a9
    • Arnd Bergmann's avatar
      x86: apm: avoid uninitialized data · 3a6d8676
      Arnd Bergmann authored
      
      
      apm_bios_call() can fail, and return a status in its argument structure.
      If that status however is zero during a call from
      apm_get_power_status(), we end up using data that may have never been
      set, as reported by "gcc -Wmaybe-uninitialized":
      
        arch/x86/kernel/apm_32.c: In function ‘apm’:
        arch/x86/kernel/apm_32.c:1729:17: error: ‘bx’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
        arch/x86/kernel/apm_32.c:1835:5: error: ‘cx’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
        arch/x86/kernel/apm_32.c:1730:17: note: ‘cx’ was declared here
        arch/x86/kernel/apm_32.c:1842:27: error: ‘dx’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
        arch/x86/kernel/apm_32.c:1731:17: note: ‘dx’ was declared here
      
      This changes the function to return "APM_NO_ERROR" here, which makes the
      code more robust to broken BIOS versions, and avoids the warning.
      
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Reviewed-by: default avatarJiri Kosina <jkosina@suse.cz>
      Reviewed-by: default avatarLuis R. Rodriguez <mcgrof@kernel.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      3a6d8676
    • Arnd Bergmann's avatar
      NFSv4.1: work around -Wmaybe-uninitialized warning · e84efa32
      Arnd Bergmann authored
      A bugfix introduced a harmless gcc warning in nfs4_slot_seqid_in_use if
      we enable -Wmaybe-uninitialized again:
      
        fs/nfs/nfs4session.c:203:54: error: 'cur_seq' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      
      gcc is not smart enough to conclude that the IS_ERR/PTR_ERR pair results
      in a nonzero return value here.  Using PTR_ERR_OR_ZERO() instead makes
      this clear to the compiler.
      
      Fixes: e09c978a
      
       ("NFSv4.1: Fix Oopsable condition in server callback races")
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      e84efa32
    • Arnd Bergmann's avatar
      Kbuild: enable -Wmaybe-uninitialized warning for "make W=1" · a76bcf55
      Arnd Bergmann authored
      Traditionally, we have always had warnings about uninitialized variables
      enabled, as this is part of -Wall, and generally a good idea [1], but it
      also always produced false positives, mainly because this is a variation
      of the halting problem and provably impossible to get right in all cases
      [2].
      
      Various people have identified cases that are particularly bad for false
      positives, and in commit e74fc973 ("Turn off -Wmaybe-uninitialized
      when building with -Os"), I turned off the warning for any build that
      was done with CC_OPTIMIZE_FOR_SIZE.  This drastically reduced the number
      of false positive warnings in the default build but unfortunately had
      the side effect of turning the warning off completely in 'allmodconfig'
      builds, which in turn led to a lot of warnings (both actual bugs, and
      remaining false positives) to go in unnoticed.
      
      With commit 877417e6 ("Kbuild: change CC_OPTIMIZE_FOR_SIZE
      definition") enabled the warning again for allmodconfig builds in v4.7
      and in v4.8-rc1, I had finally managed to address all warnings I get in
      an ARM allmodconfig build and most other maybe-uninitialized warnings
      for ARM randconfig builds.
      
      However, commit 6e8d666e
      
       ("Disable "maybe-uninitialized" warning
      globally") was merged at the same time and disabled it completely for
      all configurations, because of false-positive warnings on x86 that I had
      not addressed until then.  This caused a lot of actual bugs to get
      merged into mainline, and I sent several dozen patches for these during
      the v4.9 development cycle.  Most of these are actual bugs, some are for
      correct code that is safe because it is only called under external
      constraints that make it impossible to run into the case that gcc sees,
      and in a few cases gcc is just stupid and finds something that can
      obviously never happen.
      
      I have now done a few thousand randconfig builds on x86 and collected
      all patches that I needed to address every single warning I got (I can
      provide the combined patch for the other warnings if anyone is
      interested), so I hope we can get the warning back and let people catch
      the actual bugs earlier.
      
      This reverts the change to disable the warning completely and for now
      brings it back at the "make W=1" level, so we can get it merged into
      mainline without introducing false positives.  A follow-up patch enables
      it on all levels unless some configuration option turns it off because
      of false-positives.
      
      Link: https://rusty.ozlabs.org/?p=232 [1]
      Link: https://gcc.gnu.org/wiki/Better_Uninitialized_Warnings [2]
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      a76bcf55
  2. Nov 10, 2016
    • Linus Torvalds's avatar
      Merge tag 'sound-4.9-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound · 27bcd37e
      Linus Torvalds authored
      Pull sound fixes from Takashi Iwai:
       "This became a largish pull-request, as we've got a bunch of pending
        ASoC fixes at this time. One noticeable change is the removal of error
        directive in uapi/sound/asoc.h. We found that the API has been already
        used on Chromebooks, so we need to support it even now.
      
        A slight big LOC is found in Qualcomm lpass driver, but the rest are
        all small and easy fixes for ASoC drivers (sti, sun4i, Realtek codecs,
        Intel, tas571x, etc) in addition to the patches to harden the ALSA
        core proc file accesses"
      
      * tag 'sound-4.9-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (26 commits)
        ALSA: info: Return error for invalid read/write
        ALSA: info: Limit the proc text input size
        ASoC: samsung: spdif: Fix DMA filter initialization
        ASoC: sun4i-codec: Enable bus clock after getting GPIO
        ASoC: lpass-cpu: add module licence and description
        ASoC: lpass-platform: Fix broken pcm data usage
        ASoC: sun4i-codec: return error code instead of NULL when create_card fails
        ASoC: hdmi-codec: Fix hdmi_of_xlate_dai_name when #sound-dai-cells = <0>
        ASoC: samsung: get access to DMA engine early to defer probe properly
        ASoC: da7219: Connect output enable register to DAIOUT
        ASoC: Intel: Skylake: Fix to turn off hdmi power on probe failure
        ASoC: sti-sas: enable fast io for regmap
        ASoC: sti: fix channel status update after playback start
        ASoC: PXA: Brownstone needs I2C
        ASoC: Intel: Skylake: Always acquire runtime pm ref on unload
        ASoC: Intel: Atom: add terminate entry for dmi_system_id tables
        ASoC: rt298: fix jack type detect error
        ASoC: rt5663: fix a debug statement
        ASoC: cs4270: fix DAPM stream name mismatch
        ASoC: Intel: haswell depends on sst-firmware
        ...
      27bcd37e
    • Linus Torvalds's avatar
      Merge tag 'for-linus-4.9-rc4-ofs-1' of git://git.kernel.org/pub/scm/linux/kernel/git/hubcap/linux · 3c6106da
      Linus Torvalds authored
      Pull orangefs fix from Mike Marshall:
       "We recently refactored the Orangefs debugfs code. The refactor seemed
        to trigger dan.carpenter@oracle.com's static tester to find a possible
        double-free in the code.
      
        While designing the fix we saw a condition under which the buffer
        being freed could also be overflowed.
      
        We also realized how to rebuild the related debugfs file's "contents"
        (a string) without deleting and re-creating the file.
      
        This fix should eliminate the possible double-free, the potential
        overflow and improve code readability"
      
      * tag 'for-linus-4.9-rc4-ofs-1' of git://git.kernel.org/pub/scm/linux/kernel/git/hubcap/linux:
        orangefs: clean up debugfs
      3c6106da
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux · ae67e87f
      Linus Torvalds authored
      Pull s390 fixes from Martin Schwidefsky:
       "Two bug fixes
      
         - a memory alignment fix in the s390 only hypfs code
      
         - a fix for the generic percpu code that caused ftrace to break on
           s390. This is not relevant for x86 but for all architectures that
           use the generic percpu code"
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
        percpu: use notrace variant of preempt_disable/preempt_enable
        s390/hypfs: Use get_free_page() instead of kmalloc to ensure page alignment
      ae67e87f
  3. Nov 09, 2016
    • Linus Torvalds's avatar
      Merge tag 'iommu-fixes-v4.9-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu · e3a00f68
      Linus Torvalds authored
      Pull IOMMU fixes from Joerg Roedel:
      
       - Four patches from Robin Murphy fix several issues with the recently
         merged generic DT-bindings support for arm-smmu drivers
      
       - A fix for a dead-lock issue in the VT-d driver, which shows up on
         iommu hotplug
      
      * tag 'iommu-fixes-v4.9-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu:
        iommu/vt-d: Fix dead-locks in disable_dmar_iommu() path
        iommu/arm-smmu: Fix out-of-bounds dereference
        iommu/arm-smmu: Check that iommu_fwspecs are ours
        iommu/arm-smmu: Don't inadvertently reject multiple SMMUv3s
        iommu/arm-smmu: Work around ARM DMA configuration
      e3a00f68
  4. Nov 08, 2016
    • Joerg Roedel's avatar
      iommu/vt-d: Fix dead-locks in disable_dmar_iommu() path · bea64033
      Joerg Roedel authored
      It turns out that the disable_dmar_iommu() code-path tried
      to get the device_domain_lock recursivly, which will
      dead-lock when this code runs on dmar removal. Fix both
      code-paths that could lead to the dead-lock.
      
      Fixes: 55d94043
      
       ('iommu/vt-d: Get rid of domain->iommu_lock')
      Signed-off-by: default avatarJoerg Roedel <jroedel@suse.de>
      bea64033
    • Robin Murphy's avatar
      iommu/arm-smmu: Fix out-of-bounds dereference · 8c82d6ec
      Robin Murphy authored
      When we iterate a master's config entries, what we generally care
      about is the entry's stream map index, rather than the entry index
      itself, so it's nice to have the iterator automatically assign the
      former from the latter. Unfortunately, booting with KASAN reveals
      the oversight that using a simple comma operator results in the
      entry index being dereferenced before being checked for validity,
      so we always access one element past the end of the fwspec array.
      
      Flip things around so that the check always happens before the index
      may be dereferenced.
      
      Fixes: adfec2e7
      
       ("iommu/arm-smmu: Convert to iommu_fwspec")
      Reported-by: default avatarMark Rutland <mark.rutland@arm.com>
      Signed-off-by: default avatarRobin Murphy <robin.murphy@arm.com>
      Acked-by: default avatarWill Deacon <will.deacon@arm.com>
      Signed-off-by: default avatarJoerg Roedel <jroedel@suse.de>
      8c82d6ec
    • Robin Murphy's avatar
      iommu/arm-smmu: Check that iommu_fwspecs are ours · 3c117b54
      Robin Murphy authored
      We seem to have forgotten to check that iommu_fwspecs actually belong to
      us before we go ahead and dereference their private data. Oops.
      
      Fixes: 021bb842
      
       ("iommu/arm-smmu: Wire up generic configuration support")
      Signed-off-by: default avatarRobin Murphy <robin.murphy@arm.com>
      Signed-off-by: default avatarJoerg Roedel <jroedel@suse.de>
      3c117b54
    • Robin Murphy's avatar
      iommu/arm-smmu: Don't inadvertently reject multiple SMMUv3s · ec615f43
      Robin Murphy authored
      We now delay installing our per-bus iommu_ops until we know an SMMU has
      successfully probed, as they don't serve much purpose beforehand, and
      doing so also avoids fights between multiple IOMMU drivers in a single
      kernel. However, the upshot of passing the return value of bus_set_iommu()
      back from our probe function is that if there happens to be more than
      one SMMUv3 device in a system, the second and subsequent probes will
      wind up returning -EBUSY to the driver core and getting torn down again.
      
      Avoid re-setting ops if ours are already installed, so that any genuine
      failures stand out.
      
      Fixes: 08d4ca2a
      
       ("iommu/arm-smmu: Support non-PCI devices with SMMUv3")
      CC: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      CC: Hanjun Guo <hanjun.guo@linaro.org>
      Signed-off-by: default avatarRobin Murphy <robin.murphy@arm.com>
      Signed-off-by: default avatarJoerg Roedel <jroedel@suse.de>
      ec615f43
    • Robin Murphy's avatar
      iommu/arm-smmu: Work around ARM DMA configuration · fba4f8e5
      Robin Murphy authored
      
      
      The 32-bit ARM DMA configuration code predates the IOMMU core's default
      domain functionality, and instead relies on allocating its own domains
      and attaching any devices using the generic IOMMU binding to them.
      Unfortunately, it does this relatively early on in the creation of the
      device, before we've seen our add_device callback, which leads us to
      attempt to operate on a half-configured master.
      
      To avoid a crash, check for this situation on attach, but refuse to
      play, as there's nothing we can do. This at least allows VFIO to keep
      working for people who update their 32-bit DTs to the generic binding,
      albeit with a few (innocuous) warnings from the DMA layer on boot.
      
      Signed-off-by: default avatarRobin Murphy <robin.murphy@arm.com>
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      Signed-off-by: default avatarJoerg Roedel <jroedel@suse.de>
      fba4f8e5
    • Takashi Iwai's avatar
      ALSA: info: Return error for invalid read/write · 6809cd68
      Takashi Iwai authored
      
      
      Currently the ALSA proc handler allows read or write even if the proc
      file were write-only or read-only.  It's mostly harmless, does thing
      but allocating memory and ignores the input/output.  But it doesn't
      tell user about the invalid use, and it's confusing and inconsistent
      in comparison with other proc files.
      
      This patch adds some sanity checks and let the proc handler returning
      an -EIO error when the invalid read/write is performed.
      
      Cc: <stable@vger.kernel.org> # v4.2+
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      6809cd68
    • Takashi Iwai's avatar
      ALSA: info: Limit the proc text input size · 027a9fe6
      Takashi Iwai authored
      
      
      The ALSA proc handler allows currently the write in the unlimited size
      until kmalloc() fails.  But basically the write is supposed to be only
      for small inputs, mostly for one line inputs, and we don't have to
      handle too large sizes at all.  Since the kmalloc error results in the
      kernel warning, it's better to limit the size beforehand.
      
      This patch adds the limit of 16kB, which must be large enough for the
      currently existing code.
      
      Cc: stable@vger.kernel.org # v4.2+
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      027a9fe6
    • Heiko Carstens's avatar
      percpu: use notrace variant of preempt_disable/preempt_enable · 7f8d61f0
      Heiko Carstens authored
      Commit 345ddcc8
      
       ("ftrace: Have set_ftrace_pid use the bitmap like
      events do") added a couple of this_cpu_read calls to the ftrace code.
      
      On x86 this is not a problem, since it has single instructions to read
      percpu data. Other architectures which use the generic variant now
      have additional preempt_disable and preempt_enable calls in the core
      ftrace code. This may lead to recursive calls and in result to a dead
      machine, e.g. if preemption and debugging options are enabled.
      
      To fix this use the notrace variant of preempt_disable and
      preempt_enable within the generic percpu code.
      
      Reported-and-bisected-by: default avatarSebastian Ott <sebott@linux.vnet.ibm.com>
      Tested-by: default avatarSebastian Ott <sebott@linux.vnet.ibm.com>
      Fixes: 345ddcc8
      
       ("ftrace: Have set_ftrace_pid use the bitmap like events do")
      Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
      Acked-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
      7f8d61f0
    • Linus Torvalds's avatar
      Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux · b58ec8b5
      Linus Torvalds authored
      Pull arm64 fix from Will Deacon:
       "It's been pretty quiet on the fixes side of things for us, but Artem
        reported a build failure introduced during the merge window that
        appears with older GCCs that do not support asm goto. The fix is
        bigger than I'd like, but it's a mechnical move of some constants to
        break an include dependency between atomic.h and jump_label.h when
        !HAVE_JUMP_LABEL.
      
        Summary:
      
         - Fix build failure on compilers without asm goto"
      
      * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
        arm64: Fix circular include of asm/lse.h through linux/jump_label.h
      b58ec8b5
    • Linus Torvalds's avatar
      Merge tag 'openrisc-for-linus-v4.9-rc5' of... · 17ce1b20
      Linus Torvalds authored
      Merge tag 'openrisc-for-linus-v4.9-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging
      
      Pull openrisc fix from Guenter Roeck:
       "Fix openrisc crash caused by ro_init changes"
      
      * tag 'openrisc-for-linus-v4.9-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
        openrisc: Define __ro_after_init to avoid crash
      17ce1b20
    • Linus Torvalds's avatar
      Merge tag 'hwmon-for-linus-v4.9-rc5' of... · 8cebec46
      Linus Torvalds authored
      Merge tag 'hwmon-for-linus-v4.9-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging
      
      Pull hwmon fix from Guenter Roeck:
       "Fix resource leak on devm_kcalloc failure"
      
      * tag 'hwmon-for-linus-v4.9-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
        hwmon: (core) fix resource leak on devm_kcalloc failure
      8cebec46
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid · c1f4c2b2
      Linus Torvalds authored
      Pull HID fixes from Jiri Kosina:
      
       - modprobe-after-rmmod load failure bugfix for intel-ish, from Even Xu
      
       - IRQ probing bugfix for intel-ish, from Srinivas Pandruvada
      
       - attribute parsing fix in hid-sensor, from Ooi, Joyce
      
       - other small misc fixes / quirky device additions
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid:
        HID: sensor: fix attributes in HID sensor interface
        HID: intel-ish-hid: request_irq failure
        HID: intel-ish-hid: Fix driver reinit failure
        HID: intel-ish-hid: Move DMA disable code to new function
        HID: intel-ish-hid: consolidate ish wake up operation
        HID: usbhid: add ATEN CS962 to list of quirky devices
        HID: intel-ish-hid: Fix !CONFIG_PM build warning
        HID: sensor-hub: Fix packing of result buffer for feature report
      c1f4c2b2
  5. Nov 07, 2016
    • Mike Marshall's avatar
      orangefs: clean up debugfs · dc033621
      Mike Marshall authored
      
      
      We recently refactored the Orangefs debugfs code.
      The refactor seemed to trigger dan.carpenter@oracle.com's
      static tester to find a possible double-free in the code.
      
      While designing the fix we saw a condition under which the
      buffer being freed could also be overflowed.
      
      We also realized how to rebuild the related debugfs file's
      "contents" (a string) without deleting and re-creating the file.
      
      This fix should eliminate the possible double-free, the
      potential overflow and improve code readability.
      
      Signed-off-by: default avatarMike Marshall <hubcap@omnibond.com>
      Signed-off-by: default avatarMartin Brandenburg <martin@omnibond.com>
      dc033621
    • Guenter Roeck's avatar
      openrisc: Define __ro_after_init to avoid crash · 2c7a5c5c
      Guenter Roeck authored
      openrisc qemu tests fail with the following crash.
      
      Unable to handle kernel access at virtual address 0xc0300c34
      
      Oops#: 0001
      CPU #: 0
         PC: c016c710    SR: 0000ae67    SP: c1017e04
         GPR00: 00000000 GPR01: c1017e04 GPR02: c0300c34 GPR03: c0300c34
         GPR04: 00000000 GPR05: c0300cb0 GPR06: c0300c34 GPR07: 000000ff
         GPR08: c107f074 GPR09: c0199ef4 GPR10: c1016000 GPR11: 00000000
         GPR12: 00000000 GPR13: c107f044 GPR14: c0473774 GPR15: 07ce0000
         GPR16: 00000000 GPR17: c107ed8a GPR18: 00009600 GPR19: c107f044
         GPR20: c107ee74 GPR21: 00000003 GPR22: c0473770 GPR23: 00000033
         GPR24: 000000bf GPR25: 00000019 GPR26: c046400c GPR27: 00000001
         GPR28: c0464028 GPR29: c1018000 GPR30: 00000006 GPR31: ccf37483
           RES: 00000000 oGPR11: ffffffff
           Process swapper (pid: 1, stackpage=c1001960)
      
           Stack: Stack dump [0xc1017cf8]:
           sp + 00: 0xc1017e04
           sp + 04: 0xc0300c34
           sp + 08: 0xc0300c34
           sp + 12: 0x00000000
      ...
      
      Bisect points to commit d2ec3f77 ("pty: make ptmx file ops read-only
      after init"). Fix by defining __ro_after_init for the openrisc
      architecture, similar to parisc.
      
      Fixes: d2ec3f77
      
       ("pty: make ptmx file ops read-only after init")
      Cc: Kees Cook <keescook@chromium.org>
      Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
      Acked-by: default avatarStafford Horne <shorne@gmail.com>
      2c7a5c5c
  6. Nov 06, 2016
    • Linus Torvalds's avatar
      Linux 4.9-rc4 · bc33b0ca
      Linus Torvalds authored
      v4.9-rc4
      bc33b0ca
    • Linus Torvalds's avatar
      Merge branch 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux · bd060ac0
      Linus Torvalds authored
      Pull i2c fix from Wolfram Sang:
       "A bugfix for the I2C core fixing a (rare) race condition"
      
      * 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
        i2c: core: fix NULL pointer dereference under race condition
      bd060ac0
    • Catalin Marinas's avatar
      arm64: Fix circular include of asm/lse.h through linux/jump_label.h · 272d01bd
      Catalin Marinas authored
      Commit efd9e03f ("arm64: Use static keys for CPU features")
      introduced support for static keys in asm/cpufeature.h, including
      linux/jump_label.h. When CC_HAVE_ASM_GOTO is not defined, this causes a
      circular dependency via linux/atomic.h, asm/lse.h and asm/cpufeature.h.
      
      This patch moves the capability macros out out of asm/cpufeature.h into
      a separate asm/cpucaps.h and modifies some of the #includes accordingly.
      
      Fixes: efd9e03f
      
       ("arm64: Use static keys for CPU features")
      Reported-by: default avatarArtem Savkov <asavkov@redhat.com>
      Tested-by: default avatarArtem Savkov <asavkov@redhat.com>
      Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      272d01bd
    • Linus Torvalds's avatar
      Merge branches 'sched-urgent-for-linus' and 'core-urgent-for-linus' of... · ffbcbfca
      Linus Torvalds authored
      Merge branches 'sched-urgent-for-linus' and 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
      
      Pull stack vmap fixups from Thomas Gleixner:
       "Two small patches related to sched_show_task():
      
         - make sure to hold a reference on the task stack while accessing it
      
         - remove the thread_saved_pc printout
      
        .. and add a sanity check into release_task_stack() to catch problems
        with task stack references"
      
      * 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        sched/core: Remove pointless printout in sched_show_task()
        sched/core: Fix oops in sched_show_task()
      
      * 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        fork: Add task stack refcounting sanity check and prevent premature task stack freeing
      ffbcbfca
    • Linus Torvalds's avatar
      Merge tag 'md/4.9-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/shli/md · 6c286e81
      Linus Torvalds authored
      Pull MD fixes from Shaohua Li:
       "There are several bug fixes queued:
      
         - fix raid5-cache recovery bugs
      
         - fix discard IO error handling for raid1/10
      
         - fix array sync writes bogus position to superblock
      
         - fix IO error handling for raid array with external metadata"
      
      * tag 'md/4.9-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/shli/md:
        md: be careful not lot leak internal curr_resync value into metadata. -- (all)
        raid1: handle read error also in readonly mode
        raid5-cache: correct condition for empty metadata write
        md: report 'write_pending' state when array in sync
        md/raid5: write an empty meta-block when creating log super-block
        md/raid5: initialize next_checkpoint field before use
        RAID10: ignore discard error
        RAID1: ignore discard error
      6c286e81
    • Linus Torvalds's avatar
      Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi · e12d8d51
      Linus Torvalds authored
      Pull SCSI fixes from James Bottomley:
       "Two more important data integrity fixes related to RAID device drivers
        which wrongly throw away the SYNCHRONIZE CACHE command in the non-RAID
        path and a memory leak in the scsi_debug driver"
      
      * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
        scsi: arcmsr: Send SYNCHRONIZE_CACHE command to firmware
        scsi: scsi_debug: Fix memory leak if LBP enabled and module is unloaded
        scsi: megaraid_sas: Fix data integrity failure for JBOD (passthrough) devices
      e12d8d51
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input · f29b909d
      Linus Torvalds authored
      Pull input subsystem updates from Dmitry Torokhov.
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
        Input: psmouse - cleanup Focaltech code
        Input: i8042 - add XMG C504 to keyboard reset table
      f29b909d
    • Linus Torvalds's avatar
      Merge tag 'firewire-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394 · 03daa36f
      Linus Torvalds authored
      Pull FireWire (IEEE 1394) fixes from Stefan Richter:
      
       - add missing input validation to the firewire-net driver. Invalid
         IP-over-1394 encapsulation headers could trigger buffer overflows
         (CVE 2016-8633).
      
       - IP-over-1394 link fragmentation headers were read and written
         incorrectly, breaking fragmented RX/TX with other OS's stacks.
      
      * tag 'firewire-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394:
        firewire: net: fix fragmented datagram_size off-by-one
        firewire: net: guard against rx buffer overflows
      03daa36f
    • Linus Torvalds's avatar
      Merge tag 'media/v4.9-3' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media · d8d1721c
      Linus Torvalds authored
      Pull media fixes from Mauro Carvalho Chehab:
       "A series of fixup patches meant to fix the usage of DMA on stack, plus
        one warning fixup"
      
      * tag 'media/v4.9-3' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (32 commits)
        [media] radio-bcm2048: don't ignore errors
        [media] pctv452e: fix semicolon.cocci warnings
        [media] flexcop-usb: don't use stack for DMA
        [media] stk-webcam: don't use stack for DMA
        [media] s2255drv: don't use stack for DMA
        [media] cpia2_usb: don't use stack for DMA
        [media] digitv: handle error code on RC query
        [media] dw2102: return error if su3000_power_ctrl() fails
        [media] nova-t-usb2: handle error code on RC query
        [media] technisat-usb2: use DMA buffers for I2C transfers
        [media] pctv452e: don't call BUG_ON() on non-fatal error
        [media] pctv452e: don't do DMA on stack
        [media] nova-t-usb2: don't do DMA on stack
        [media] gp8psk: don't go past the buffer size
        [media] gp8psk: don't do DMA on stack
        [media] dtv5100: don't do DMA on stack
        [media] dtt200u: handle USB control message errors
        [media] dtt200u: don't do DMA on stack
        [media] dtt200u-fe: handle errors on USB control messages
        [media] dtt200u-fe: don't do DMA on stack
        ...
      d8d1721c
    • Linus Torvalds's avatar
      Merge tag 'pci-v4.9-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci · 41e6410e
      Linus Torvalds authored
      Pull PCI fixes from Bjorn Helgaas:
      
       - fix for a Qualcomm driver issue that causes a use-before-set crash
      
       - fix for DesignWare iATU unroll support that causes external aborts
         when enabling the host bridge
      
      * tag 'pci-v4.9-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci:
        PCI: designware: Check for iATU unroll support after initializing host
        PCI: qcom: Fix pp->dev usage before assignment
      41e6410e
    • Linus Torvalds's avatar
      Merge tag 'for-linus-20161104' of git://git.infradead.org/linux-mtd · 785bcb40
      Linus Torvalds authored
      Pull MTD fixes from Brian Norris:
      
       - MAINTAINERS updates to reflect some new maintainers/submaintainers.
      
         We have some great volunteers who've been developing and reviewing
         already. We're going to try a group maintainership model, so
         eventually you'll probably see pull requests from people besides me.
      
       - NAND fixes from Boris:
          "Three simple fixes:
      
            - fix a non-critical bug in the gpmi driver
            - fix a bug in the 'automatic NAND timings selection' feature
              introduced in 4.9-rc1
            - fix a false positive uninitialized-var warning"
      
      * tag 'for-linus-20161104' of git://git.infradead.org/linux-mtd:
        mtd: mtk: avoid warning in mtk_ecc_encode
        mtd: nand: Fix data interface configuration logic
        mtd: nand: gpmi: disable the clocks on errors
        MAINTAINERS: add more people to the MTD maintainer team
        MAINTAINERS: add a maintainer for the SPI NOR subsystem
      785bcb40
    • Linus Torvalds's avatar
      Merge tag 'mmc-v4.9-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc · d2997040
      Linus Torvalds authored
      Pull MMC fixes from Ulf Hansson:
       "MMC host:
      
         - sdhci-msm: Fix error path in probe
         - dw_mmc-pltfm: Avoid NULL pointer dereference"
      
      * tag 'mmc-v4.9-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc:
        mmc: sdhci-msm: Fix error return code in sdhci_msm_probe()
        mmc: dw_mmc-pltfm: fix the potential NULL pointer dereference
      d2997040