1. 14 Jul, 2018 9 commits
    • Wei Yongjun's avatar
      pinctrl: nsp: Fix potential NULL dereference · c29e9da5
      Wei Yongjun authored
      platform_get_resource() may fail and return NULL, so we should
      better check it's return value to avoid a NULL pointer dereference
      a bit later in the code.
      
      This is detected by Coccinelle semantic patch.
      
      @@
      expression pdev, res, n, t, e, e1, e2;
      @@
      
      res = platform_get_resource(pdev, t, n);
      + if (!res)
      +   return -EINVAL;
      ... when != res == NULL
      e = devm_ioremap_nocache(e1, res->start, e2);
      
      Fixes: cc4fa83f ("pinctrl: nsp: add pinmux driver support for Broadcom NSP SoC")
      Signed-off-by: default avatarWei Yongjun <weiyongjun1@huawei.com>
      Reviewed-by: default avatarRay Jui <ray.jui@broadcom.com>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      c29e9da5
    • Dan Carpenter's avatar
      pinctrl: nsp: off by ones in nsp_pinmux_enable() · f90a21c8
      Dan Carpenter authored
      The > comparisons should be >= or else we read beyond the end of the
      pinctrl->functions[] array.
      
      Fixes: cc4fa83f ("pinctrl: nsp: add pinmux driver support for Broadcom NSP SoC")
      Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Reviewed-by: default avatarRay Jui <ray.jui@broadcom.com>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      f90a21c8
    • Niklas Söderlund's avatar
      pinctrl: sh-pfc: r8a77970: remove SH_PFC_PIN_CFG_DRIVE_STRENGTH flag · 550b6f7e
      Niklas Söderlund authored
      The datasheet does not document any registers to control drive strength,
      and no drive strength registers are for this reason described for this
      SoC. The flags indicating that drive strength can be controlled are
      however set for some pins in the driver.
      
      This leads to a NULL pointer dereference when the sh-pfc core tries to
      access the struct describing the drive strength registers, for example
      when reading the sysfs file pinconf-pins.
      
      Fix this by removing the SH_PFC_PIN_CFG_DRIVE_STRENGTH from all pins.
      
      Fixes: b92ac66a ("pinctrl: sh-pfc: Add R8A77970 PFC support")
      Signed-off-by: default avatarNiklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
      Reviewed-by: default avatarSimon Horman <horms+renesas@verge.net.au>
      Reviewed-by: default avatarSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
      Reviewed-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      550b6f7e
    • Paul Cercueil's avatar
      pinctrl: ingenic: Fix inverted direction for < JZ4770 · 0084a786
      Paul Cercueil authored
      The .gpio_set_direction() callback was setting inverted direction
      for SoCs older than the JZ4770, this restores the correct behaviour.
      Signed-off-by: default avatarPaul Cercueil <paul@crapouillou.net>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      0084a786
    • Sean Wang's avatar
      pinctrl: mt7622: fix a kernel panic when gpio-hog is being applied · 5b1c4bf2
      Sean Wang authored
      When we are explicitly using GPIO hogging mechanism in the pinctrl node,
      such as:
      
      	&pio {
      		line_input {
      			gpio-hog;
      			gpios = <95 0>, <96 0>, <97 0>;
      			input;
      		};
      	};
      
      A kernel panic happens at dereferencing a NULL pointer: In this case, the
      drvdata is still not setup properly yet when it is being accessed.
      
      A better solution for fixing up this issue should be we should obtain the
      private data from struct gpio_chip using a specific gpiochip_get_data
      instead of a generic dev_get_drvdata.
      
      [    0.249424] Unable to handle kernel NULL pointer dereference at virtual
      	       address 000000c8
      [    0.257818] Mem abort info:
      [    0.260704]   ESR = 0x96000005
      [    0.263869]   Exception class = DABT (current EL), IL = 32 bits
      [    0.270011]   SET = 0, FnV = 0
      [    0.273167]   EA = 0, S1PTW = 0
      [    0.276421] Data abort info:
      [    0.279398]   ISV = 0, ISS = 0x00000005
      [    0.283372]   CM = 0, WnR = 0
      [    0.286440] [00000000000000c8] user address but active_mm is swapper
      [    0.293027] Internal error: Oops: 96000005 [#1] PREEMPT SMP
      [    0.298795] Modules linked in:
      [    0.301958] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.16.0-rc1+ #389
      [    0.308716] Hardware name: MediaTek MT7622 RFB1 board (DT)
      [    0.314396] pstate: 80000005 (Nzcv daif -PAN -UAO)
      [    0.319362] pc : mtk_hw_pin_field_get+0x28/0x118
      [    0.324140] lr : mtk_hw_set_value+0x30/0x104
      [    0.328557] sp : ffffff800801b6d0
      [    0.331983] x29: ffffff800801b6d0 x28: ffffff80086b7970
      [    0.337484] x27: 0000000000000000 x26: ffffff80087b8000
      [    0.342986] x25: 0000000000000000 x24: ffffffc00324c230
      [    0.348487] x23: 0000000000000003 x22: 0000000000000000
      [    0.353988] x21: ffffff80087b8000 x20: 0000000000000000
      [    0.359489] x19: 0000000000000054 x18: 00000000fffff7c0
      [    0.364990] x17: 0000000000006300 x16: 000000000000003f
      [    0.370492] x15: 000000000000000e x14: ffffffffffffffff
      [    0.375993] x13: 0000000000000000 x12: 0000000000000020
      [    0.381494] x11: 0000000000000006 x10: 0101010101010101
      [    0.386995] x9 : fffffffffffffffa x8 : 0000000000000007
      [    0.392496] x7 : ffffff80085d63f8 x6 : 0000000000000003
      [    0.397997] x5 : 0000000000000054 x4 : ffffffc0031eb800
      [    0.403499] x3 : ffffff800801b728 x2 : 0000000000000003
      [    0.409000] x1 : 0000000000000054 x0 : 0000000000000000
      [    0.414502] Process swapper/0 (pid: 1, stack limit = 0x000000002a913c1c)
      [    0.421441] Call trace:
      [    0.423968]  mtk_hw_pin_field_get+0x28/0x118
      [    0.428387]  mtk_hw_set_value+0x30/0x104
      [    0.432445]  mtk_gpio_set+0x20/0x28
      [    0.436052]  mtk_gpio_direction_output+0x18/0x30
      [    0.440833]  gpiod_direction_output_raw_commit+0x7c/0xa0
      [    0.446333]  gpiod_direction_output+0x104/0x114
      [    0.451022]  gpiod_configure_flags+0xbc/0xfc
      [    0.455441]  gpiod_hog+0x8c/0x140
      [    0.458869]  of_gpiochip_add+0x27c/0x2d4
      [    0.462928]  gpiochip_add_data_with_key+0x338/0x5f0
      [    0.467976]  mtk_pinctrl_probe+0x388/0x400
      [    0.472217]  platform_drv_probe+0x58/0xa4
      [    0.476365]  driver_probe_device+0x204/0x44c
      [    0.480783]  __device_attach_driver+0xac/0x108
      [    0.485384]  bus_for_each_drv+0x7c/0xac
      [    0.489352]  __device_attach+0xa0/0x144
      [    0.493320]  device_initial_probe+0x10/0x18
      [    0.497647]  bus_probe_device+0x2c/0x8c
      [    0.501616]  device_add+0x2f8/0x540
      [    0.505226]  of_device_add+0x3c/0x44
      [    0.508925]  of_platform_device_create_pdata+0x80/0xb8
      [    0.514245]  of_platform_bus_create+0x290/0x3e8
      [    0.518933]  of_platform_populate+0x78/0x100
      [    0.523352]  of_platform_default_populate+0x24/0x2c
      [    0.528403]  of_platform_default_populate_init+0x94/0xa4
      [    0.533903]  do_one_initcall+0x98/0x130
      [    0.537874]  kernel_init_freeable+0x13c/0x1d4
      [    0.542385]  kernel_init+0x10/0xf8
      [    0.545903]  ret_from_fork+0x10/0x18
      [    0.549603] Code: 900020a1 f9400800 911dcc21 1400001f (f9406401)
      [    0.555916] ---[ end trace de8c34787fdad3b3 ]---
      [    0.560722] Kernel panic - not syncing: Attempted to kill init!
      	       exitcode=0x0000000b
      [    0.560722]
      [    0.570188] SMP: stopping secondary CPUs
      [    0.574253] ---[ end Kernel panic - not syncing: Attempted to kill
      	       init! exitcode=0x0000000b
      [    0.574253]
      
      Cc: stable@vger.kernel.org
      Fixes: d6ed9355 ("pinctrl: mediatek: add pinctrl driver for MT7622 SoC")
      Signed-off-by: default avatarSean Wang <sean.wang@mediatek.com>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      5b1c4bf2
    • Sean Wang's avatar
      pinctrl: mt7622: stop using the deprecated pinctrl_add_gpio_range · de227ed7
      Sean Wang authored
      If the pinctrl node has the gpio-ranges property, the range will be added
      by the gpio core and doesn't need to be added by the pinctrl driver.
      
      But for keeping backward compatibility, an explicit pinctrl_add_gpio_range
      is still needed to be called when there is a missing gpio-ranges in pinctrl
      node in old dts files.
      
      Cc: stable@vger.kernel.org
      Fixes: d6ed9355 ("pinctrl: mediatek: add pinctrl driver for MT7622 SoC")
      Signed-off-by: default avatarSean Wang <sean.wang@mediatek.com>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      de227ed7
    • Sean Wang's avatar
      pinctrl: mt7622: fix that pinctrl_claim_hogs cannot work · ae6efcae
      Sean Wang authored
      To allow claiming hogs by pinctrl, we cannot enable pinctrl until all
      groups and functions are being added done. Also, it's necessary that
      the corresponding gpiochip is being added when the pinctrl device is
      enabled.
      
      Cc: stable@vger.kernel.org
      Fixes: d6ed9355 ("pinctrl: mediatek: add pinctrl driver for MT7622 SoC")
      Signed-off-by: default avatarSean Wang <sean.wang@mediatek.com>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      ae6efcae
    • Sean Wang's avatar
      pinctrl: mt7622: fix initialization sequence between eint and gpiochip · 8875059d
      Sean Wang authored
      Because gpichip applied in the driver must depend on mtk eint to implement
      the input data debouncing and the translation between gpio and irq, it's
      better to keep logic consistent with mtk eint being built prior to gpiochip
      being added.
      
      Cc: stable@vger.kernel.org
      Fixes: e6dabd38 ("pinctrl: mediatek: add EINT support to MT7622 SoC")
      Signed-off-by: default avatarSean Wang <sean.wang@mediatek.com>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      8875059d
    • Sean Wang's avatar
      pinctrl: mt7622: fix error path on failing at groups building · fafa35cc
      Sean Wang authored
      It should be to return an error code when failing at groups building.
      
      Cc: stable@vger.kernel.org
      Fixes: d6ed9355 ("pinctrl: mediatek: add pinctrl driver for MT7622 SoC")
      Signed-off-by: default avatarSean Wang <sean.wang@mediatek.com>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      fafa35cc
  2. 08 Jul, 2018 13 commits
    • Linus Torvalds's avatar
      Linux 4.18-rc4 · 1e4b044d
      Linus Torvalds authored
      1e4b044d
    • Linus Torvalds's avatar
      Merge tag 'armsoc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc · ca04b3cc
      Linus Torvalds authored
      Pull ARM SoC fixes from Olof Johansson:
       "A small collection of fixes, sort of the usual at this point, all for
        i.MX or OMAP:
      
         - Enable ULPI drivers on i.MX to avoid a hang
      
         - Pinctrl fix for touchscreen on i.MX51 ZII RDU1
      
         - Fixes for ethernet clock references on am3517
      
         - mmc0 write protect detection fix for am335x
      
         - kzalloc->kcalloc conversion in an OMAP driver
      
         - USB metastability fix for USB on dra7
      
         - Fix touchscreen wakeup on am437x"
      
      * tag 'armsoc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc:
        ARM: imx_v4_v5_defconfig: Select ULPI support
        ARM: imx_v6_v7_defconfig: Select ULPI support
        ARM: dts: omap3: Fix am3517 mdio and emac clock references
        ARM: dts: am335x-bone-common: Fix mmc0 Write Protect
        bus: ti-sysc: Use 2-factor allocator arguments
        ARM: dts: dra7: Disable metastability workaround for USB2
        ARM: dts: imx51-zii-rdu1: fix touchscreen pinctrl
        ARM: dts: am437x: make edt-ft5x06 a wakeup source
      ca04b3cc
    • Linus Torvalds's avatar
      Merge branch 'x86-pti-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 23adbe6f
      Linus Torvalds authored
      Pull x86/pti updates from Thomas Gleixner:
       "Two small fixes correcting the handling of SSB mitigations on AMD
        processors"
      
      * 'x86-pti-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/bugs: Fix the AMD SSBD usage of the SPEC_CTRL MSR
        x86/bugs: Update when to check for the LS_CFG SSBD mitigation
      23adbe6f
    • Linus Torvalds's avatar
      Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 6f27a640
      Linus Torvalds authored
      Pull x86 fixes from Thomas Gleixner:
      
       - Prevent an out-of-bounds access in mtrr_write()
      
       - Break a circular dependency in the new hyperv IPI acceleration code
      
       - Address the build breakage related to inline functions by enforcing
         gnu_inline and explicitly bringing native_save_fl() out of line,
         which also adds a set of _ARM_ARG macros which provide 32/64bit
         safety.
      
       - Initialize the shadow CR4 per cpu variable before using it.
      
      * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/mtrr: Don't copy out-of-bounds data in mtrr_write
        x86/hyper-v: Fix the circular dependency in IPI enlightenment
        x86/paravirt: Make native_save_fl() extern inline
        x86/asm: Add _ASM_ARG* constants for argument registers to <asm/asm.h>
        compiler-gcc.h: Add __attribute__((gnu_inline)) to all inline declarations
        x86/mm/32: Initialize the CR4 shadow before __flush_tlb_all()
      6f27a640
    • Linus Torvalds's avatar
      Merge branch 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 6fb2489d
      Linus Torvalds authored
      Pull scheduler fixes from Thomas Gleixner:
      
       - The hopefully final fix for the reported race problems in
         kthread_parkme(). The previous attempt still left a hole and was
         partially wrong.
      
       - Plug a race in the remote tick mechanism which triggers a warning
         about updates not being done correctly. That's a false positive if
         the race condition is hit as the remote CPU is idle. Plug it by
         checking the condition again when holding run queue lock.
      
       - Fix a bug in the utilization estimation of a run queue which causes
         the estimation to be 0 when a run queue is throttled.
      
       - Advance the global expiration of the period timer when the timer is
         restarted after a idle period. Otherwise the expiry time is stale and
         the timer fires prematurely.
      
       - Cure the drift between the bandwidth timer and the runqueue
         accounting, which leads to bogus throttling of runqueues
      
       - Place the call to cpufreq_update_util() correctly so the function
         will observe the correct number of running RT tasks and not a stale
         one.
      
      * 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        kthread, sched/core: Fix kthread_parkme() (again...)
        sched/util_est: Fix util_est_dequeue() for throttled cfs_rq
        sched/fair: Advance global expiration when period timer is restarted
        sched/fair: Fix bandwidth timer clock drift condition
        sched/rt: Fix call to cpufreq_update_util()
        sched/nohz: Skip remote tick on idle task entirely
      6fb2489d
    • Linus Torvalds's avatar
      Merge branch 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · f5c926b9
      Linus Torvalds authored
      Pull objtool fix from Thomas Gleixner:
       "A single fix for objtool to address a bug in handling the cold
        subfunction detection for aliased functions which was added recently.
        The bug causes objtool to enter an infinite loop"
      
      * 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        objtool: Support GCC 8 '-fnoreorder-functions'
      f5c926b9
    • Linus Torvalds's avatar
      Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 · 124b99fb
      Linus Torvalds authored
      Pull crypto fixes from Herbert Xu:
      
       - add missing RETs in x86 aegis/morus
      
       - fix build error in arm speck
      
      * 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
        crypto: x86 - Add missing RETs
        crypto: arm/speck - fix building in Thumb2 mode
      124b99fb
    • Linus Torvalds's avatar
      Merge tag 'ext4_for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4 · 70a2dc6a
      Linus Torvalds authored
      Pull ext4 bugfixes from Ted Ts'o:
       "Bug fixes for ext4; most of which relate to vulnerabilities where a
        maliciously crafted file system image can result in a kernel OOPS or
        hang.
      
        At least one fix addresses an inline data bug could be triggered by
        userspace without the need of a crafted file system (although it does
        require that the inline data feature be enabled)"
      
      * tag 'ext4_for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4:
        ext4: check superblock mapped prior to committing
        ext4: add more mount time checks of the superblock
        ext4: add more inode number paranoia checks
        ext4: avoid running out of journal credits when appending to an inline file
        jbd2: don't mark block as modified if the handle is out of credits
        ext4: never move the system.data xattr out of the inode body
        ext4: clear i_data in ext4_inode_info when removing inline data
        ext4: include the illegal physical block in the bad map ext4_error msg
        ext4: verify the depth of extent tree in ext4_find_extent()
        ext4: only look at the bg_flags field if it is valid
        ext4: make sure bitmaps and the inode table don't overlap with bg descriptors
        ext4: always check block group bounds in ext4_init_block_bitmap()
        ext4: always verify the magic number in xattr blocks
        ext4: add corruption check in ext4_xattr_set_entry()
        ext4: add warn_on_error mount option
      70a2dc6a
    • Linus Torvalds's avatar
      Merge tag 'pci-v4.18-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci · 8979319f
      Linus Torvalds authored
      Pull PCI fixes from Bjorn Helgaas:
      
       - Fix a use-after-free in the endpoint code (Dan Carpenter)
      
       - Stop defaulting CONFIG_PCIE_DW_PLAT_HOST to yes (Geert Uytterhoeven)
      
       - Fix an nfp regression caused by a change in how we limit the number
         of VFs we can enable (Jakub Kicinski)
      
       - Fix failure path cleanup issues in the new R-Car gen3 PHY support
         (Marek Vasut)
      
       - Fix leaks of OF nodes in faraday, xilinx-nwl, xilinx (Nicholas Mc
         Guire)
      
      * tag 'pci-v4.18-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci:
        nfp: stop limiting VFs to 0
        PCI/IOV: Reset total_VFs limit after detaching PF driver
        PCI: faraday: Add missing of_node_put()
        PCI: xilinx-nwl: Add missing of_node_put()
        PCI: xilinx: Add missing of_node_put()
        PCI: endpoint: Use after free in pci_epf_unregister_driver()
        PCI: controller: dwc: Do not let PCIE_DW_PLAT_HOST default to yes
        PCI: rcar: Clean up PHY init on failure
        PCI: rcar: Shut the PHY down in failpath
      8979319f
    • Linus Torvalds's avatar
      Merge tag '4.18-rc3-smb3fixes' of git://git.samba.org/sfrench/cifs-2.6 · b2d44d14
      Linus Torvalds authored
      Pull cifs fixes from Steve French:
       "Five smb3/cifs fixes for stable (including for some leaks and memory
        overwrites) and also a few fixes for recent regressions in packet
        signing.
      
        Additional testing at the recent SMB3 test event, and some good work
        by Paulo and others spotted the issues fixed here. In addition to my
        xfstest runs on these, Aurelien and Stefano did additional test runs
        to verify this set"
      
      * tag '4.18-rc3-smb3fixes' of git://git.samba.org/sfrench/cifs-2.6:
        cifs: Fix stack out-of-bounds in smb{2,3}_create_lease_buf()
        cifs: Fix infinite loop when using hard mount option
        cifs: Fix slab-out-of-bounds in send_set_info() on SMB2 ACE setting
        cifs: Fix memory leak in smb2_set_ea()
        cifs: fix SMB1 breakage
        cifs: Fix validation of signed data in smb2
        cifs: Fix validation of signed data in smb3+
        cifs: Fix use after free of a mid_q_entry
      b2d44d14
    • Linus Torvalds's avatar
      Merge tag 'dma-mapping-4.18-3' of git://git.infradead.org/users/hch/dma-mapping · 4f572efd
      Linus Torvalds authored
      Pull dma-mapping fix from Christoph Hellwig:
       "Revert an incorrect dma-mapping commit for 4.18-rc"
      
      * tag 'dma-mapping-4.18-3' of git://git.infradead.org/users/hch/dma-mapping:
        Revert "iommu/intel-iommu: Enable CONFIG_DMA_DIRECT_OPS=y and clean up intel_{alloc,free}_coherent()"
      4f572efd
    • Linus Torvalds's avatar
      Merge tag 'dmaengine-fix-4.18-rc4' of git://git.infradead.org/users/vkoul/slave-dma · 89ac2233
      Linus Torvalds authored
      Pull dmaengine fixes from Vinod Koul:
       "We have few odd driver fixes and one email update change for you this
        time:
      
         - Driver fixes for k3dma (off by one), pl330 (burst residue
           granularity) and omap-dma (incorrect residue_granularity)
      
         - Sinan's email update"
      
      * tag 'dmaengine-fix-4.18-rc4' of git://git.infradead.org/users/vkoul/slave-dma:
        dmaengine: k3dma: Off by one in k3_of_dma_simple_xlate()
        dmaengine: pl330: report BURST residue granularity
        MAINTAINERS: Update email-id of Sinan Kaya
        dmaengine: ti: omap-dma: Fix OMAP1510 incorrect residue_granularity
      89ac2233
    • Linus Torvalds's avatar
      Merge tag 'for-linus-4.18-2' of git://github.com/cminyard/linux-ipmi · ea9561cf
      Linus Torvalds authored
      Pull IPMI fixes from Corey Minyard:
       "A couple of small fixes: one to the BMC side of things that fixes an
        interrupt issue, and one oops fix if init fails in a certain way on
        the client driver"
      
      * tag 'for-linus-4.18-2' of git://github.com/cminyard/linux-ipmi:
        ipmi: kcs_bmc: fix IRQ exception if the channel is not open
        ipmi: Cleanup oops on initialization failure
      ea9561cf
  3. 07 Jul, 2018 4 commits
  4. 06 Jul, 2018 10 commits
  5. 05 Jul, 2018 4 commits
    • Olof Johansson's avatar
      Merge tag 'omap-for-v4.18/fixes-signed' of... · f0463f36
      Olof Johansson authored
      Merge tag 'omap-for-v4.18/fixes-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into fixes
      
      Fixes for omap for v4.18-rc cycle
      
      Few dts fixes for regressions for various SoCs and
      devices for touchscreen wake, dra7 USB quirk, pinmux
      for beaglebone mmc, and emac clock.
      
      Also included is a change for ti-sysc to use kcalloc
      that Kees wanted to get into v4.18 as that's the last
      one he wanted to fix for improved defense against
      allocation overflows.
      
      * tag 'omap-for-v4.18/fixes-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap:
        ARM: dts: omap3: Fix am3517 mdio and emac clock references
        ARM: dts: am335x-bone-common: Fix mmc0 Write Protect
        bus: ti-sysc: Use 2-factor allocator arguments
        ARM: dts: dra7: Disable metastability workaround for USB2
        ARM: dts: am437x: make edt-ft5x06 a wakeup source
      Signed-off-by: default avatarOlof Johansson <olof@lixom.net>
      f0463f36
    • Linus Torvalds's avatar
      Fix up non-directory creation in SGID directories · 0fa3ecd8
      Linus Torvalds authored
      sgid directories have special semantics, making newly created files in
      the directory belong to the group of the directory, and newly created
      subdirectories will also become sgid.  This is historically used for
      group-shared directories.
      
      But group directories writable by non-group members should not imply
      that such non-group members can magically join the group, so make sure
      to clear the sgid bit on non-directories for non-members (but remember
      that sgid without group execute means "mandatory locking", just to
      confuse things even more).
      Reported-by: default avatarJann Horn <jannh@google.com>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      0fa3ecd8
    • Christoph Hellwig's avatar
      Revert "iommu/intel-iommu: Enable CONFIG_DMA_DIRECT_OPS=y and clean up... · 7ec916f8
      Christoph Hellwig authored
      Revert "iommu/intel-iommu: Enable CONFIG_DMA_DIRECT_OPS=y and clean up intel_{alloc,free}_coherent()"
      
      This commit may cause a less than required dma mask to be used for
      some allocations, which apparently leads to module load failures for
      iwlwifi sometimes.
      
      This reverts commit d657c5c7.
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      Reported-by: default avatarFabio Coatti <fabio.coatti@gmail.com>
      Tested-by: default avatarFabio Coatti <fabio.coatti@gmail.com>
      7ec916f8
    • Stefano Brivio's avatar
      cifs: Fix stack out-of-bounds in smb{2,3}_create_lease_buf() · 729c0c9d
      Stefano Brivio authored
      smb{2,3}_create_lease_buf() store a lease key in the lease
      context for later usage on a lease break.
      
      In most paths, the key is currently sourced from data that
      happens to be on the stack near local variables for oplock in
      SMB2_open() callers, e.g. from open_shroot(), whereas
      smb2_open_file() properly allocates space on its stack for it.
      
      The address of those local variables holding the oplock is then
      passed to create_lease_buf handlers via SMB2_open(), and 16
      bytes near oplock are used. This causes a stack out-of-bounds
      access as reported by KASAN on SMB2.1 and SMB3 mounts (first
      out-of-bounds access is shown here):
      
      [  111.528823] BUG: KASAN: stack-out-of-bounds in smb3_create_lease_buf+0x399/0x3b0 [cifs]
      [  111.530815] Read of size 8 at addr ffff88010829f249 by task mount.cifs/985
      [  111.532838] CPU: 3 PID: 985 Comm: mount.cifs Not tainted 4.18.0-rc3+ #91
      [  111.534656] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.2-1 04/01/2014
      [  111.536838] Call Trace:
      [  111.537528]  dump_stack+0xc2/0x16b
      [  111.540890]  print_address_description+0x6a/0x270
      [  111.542185]  kasan_report+0x258/0x380
      [  111.544701]  smb3_create_lease_buf+0x399/0x3b0 [cifs]
      [  111.546134]  SMB2_open+0x1ef8/0x4b70 [cifs]
      [  111.575883]  open_shroot+0x339/0x550 [cifs]
      [  111.591969]  smb3_qfs_tcon+0x32c/0x1e60 [cifs]
      [  111.617405]  cifs_mount+0x4f3/0x2fc0 [cifs]
      [  111.674332]  cifs_smb3_do_mount+0x263/0xf10 [cifs]
      [  111.677915]  mount_fs+0x55/0x2b0
      [  111.679504]  vfs_kern_mount.part.22+0xaa/0x430
      [  111.684511]  do_mount+0xc40/0x2660
      [  111.698301]  ksys_mount+0x80/0xd0
      [  111.701541]  do_syscall_64+0x14e/0x4b0
      [  111.711807]  entry_SYSCALL_64_after_hwframe+0x44/0xa9
      [  111.713665] RIP: 0033:0x7f372385b5fa
      [  111.715311] Code: 48 8b 0d 99 78 2c 00 f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 66 78 2c 00 f7 d8 64 89 01 48
      [  111.720330] RSP: 002b:00007ffff27049d8 EFLAGS: 00000206 ORIG_RAX: 00000000000000a5
      [  111.722601] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f372385b5fa
      [  111.724842] RDX: 000055c2ecdc73b2 RSI: 000055c2ecdc73f9 RDI: 00007ffff270580f
      [  111.727083] RBP: 00007ffff2705804 R08: 000055c2ee976060 R09: 0000000000001000
      [  111.729319] R10: 0000000000000000 R11: 0000000000000206 R12: 00007f3723f4d000
      [  111.731615] R13: 000055c2ee976060 R14: 00007f3723f4f90f R15: 0000000000000000
      
      [  111.735448] The buggy address belongs to the page:
      [  111.737420] page:ffffea000420a7c0 count:0 mapcount:0 mapping:0000000000000000 index:0x0
      [  111.739890] flags: 0x17ffffc0000000()
      [  111.741750] raw: 0017ffffc0000000 0000000000000000 dead000000000200 0000000000000000
      [  111.744216] raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000
      [  111.746679] page dumped because: kasan: bad access detected
      
      [  111.750482] Memory state around the buggy address:
      [  111.752562]  ffff88010829f100: 00 f2 f2 f2 f2 f2 f2 f2 00 00 00 00 00 00 00 00
      [  111.754991]  ffff88010829f180: 00 00 f2 f2 00 00 00 00 00 00 00 00 00 00 00 00
      [  111.757401] >ffff88010829f200: 00 00 00 00 00 f1 f1 f1 f1 01 f2 f2 f2 f2 f2 f2
      [  111.759801]                                               ^
      [  111.762034]  ffff88010829f280: f2 02 f2 f2 f2 f2 f2 f2 f2 00 00 00 00 00 00 00
      [  111.764486]  ffff88010829f300: f2 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
      [  111.766913] ==================================================================
      
      Lease keys are however already generated and stored in fid data
      on open and create paths: pass them down to the lease context
      creation handlers and use them.
      Suggested-by: default avatarAurélien Aptel <aaptel@suse.com>
      Reviewed-by: default avatarAurelien Aptel <aaptel@suse.com>
      Fixes: b8c32dbb ("CIFS: Request SMB2.1 leases")
      Signed-off-by: default avatarStefano Brivio <sbrivio@redhat.com>
      Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
      729c0c9d