Skip to content
  1. Mar 31, 2018
  2. Mar 30, 2018
    • Linus Torvalds's avatar
      Merge tag 'for-4.16/dm-fixes-4' of... · c2a98384
      Linus Torvalds authored
      Merge tag 'for-4.16/dm-fixes-4' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm
      
      Pull device mapper fixes from Mike Snitzer:
      
       - Fix a DM multipath regression introduced in a v4.16-rc6 commit:
         restore support for loading, and attaching, scsi_dh modules during
         multipath table load. Otherwise some users may find themselves unable
         to boot, as was reported today:
      
           https://marc.info/?l=linux-scsi&m=152231276114962&w=2
      
       - Fix a DM core ioctl permission check regression introduced in a
         v4.16-rc5 commit.
      
      * tag 'for-4.16/dm-fixes-4' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm:
        dm: fix dropped return code from dm_get_bdev_for_ioctl
        dm mpath: fix support for loading scsi_dh modules during table load
      c2a98384
    • Linus Torvalds's avatar
      Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma · d89b9f50
      Linus Torvalds authored
      Pull rdma fixes from Jason Gunthorpe:
       "It has been fairly silent lately on our -rc front. Big queue of
        patches on the mailing list going to for-next though.
      
        Bug fixes:
         - qedr driver bugfixes causing application hangs, wrong uapi errnos,
           and a race condition
         - three syzkaller found bugfixes in the ucma uapi
      
        Regression fixes for things introduced in 4.16:
         - Crash on error introduced in mlx5 UMR flow
         - Crash on module unload/etc introduced by bad interaction of
           restrack and mlx5 patches this cycle
         - Typo in a two line syzkaller bugfix causing a bad regression
         - Coverity report of nonsense code in hns driver"
      
      * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma:
        RDMA/ucma: Introduce safer rdma_addr_size() variants
        RDMA/hns: ensure for-loop actually iterates and free's buffers
        RDMA/ucma: Check that device exists prior to accessing it
        RDMA/ucma: Check that device is connected prior to access it
        RDMA/rdma_cm: Fix use after free race with process_one_req
        RDMA/qedr: Fix QP state initialization race
        RDMA/qedr: Fix rc initialization on CNQ allocation failure
        RDMA/qedr: fix QP's ack timeout configuration
        RDMA/ucma: Correct option size check using optlen
        RDMA/restrack: Move restrack_clean to be symmetrical to restrack_init
        IB/mlx5: Don't clean uninitialized UMR resources
      d89b9f50
    • Linus Torvalds's avatar
      Merge tag 'mtd/fixes-for-4.16' of git://git.infradead.org/linux-mtd · ab12762b
      Linus Torvalds authored
      Pull MTD fixes from Boris Brezillon:
       "Two fixes, one in the atmel NAND driver and another one in the
        CFI/JEDEC code.
      
        Summary:
      
         - Fix a bug in Atmel ECC engine driver
      
         - Fix a bug in the CFI/JEDEC driver"
      
      * tag 'mtd/fixes-for-4.16' of git://git.infradead.org/linux-mtd:
        mtd: jedec_probe: Fix crash in jedec_read_mfr()
        mtd: nand: atmel: Fix get_sectorsize() function
      ab12762b
    • Mike Snitzer's avatar
      dm: fix dropped return code from dm_get_bdev_for_ioctl · da5dadb4
      Mike Snitzer authored
      
      
      dm_get_bdev_for_ioctl()'s return of 0 or 1 must be the result from
      prepare_ioctl (1 means the ioctl was issued to a partition, 0 means it
      wasn't).  Unfortunately commit 519049af ("dm: use blkdev_get rather
      than bdgrab when issuing pass-through ioctl") reused the variable 'r'
      to store the return from blkdev_get() that follows prepare_ioctl()
      -- whereby dropping prepare_ioctl()'s result on the floor.
      
      This can lead to an ioctl or persistent reservation being issued to a
      partition going unnoticed, which implies the extra permission check for
      CAP_SYS_RAWIO is skipped.
      
      Fix this by using a different variable to store blkdev_get()'s return.
      
      Fixes: 519049af ("dm: use blkdev_get rather than bdgrab when issuing pass-through ioctl")
      Reported-by: default avatarAlasdair G Kergon <agk@redhat.com>
      Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
      da5dadb4
    • Mike Snitzer's avatar
      dm mpath: fix support for loading scsi_dh modules during table load · e457edf0
      Mike Snitzer authored
      
      
      The ability to have multipath dynamically attach a scsi_dh, that the user
      specified in the multipath table, was broken by commit e8f74a0f ("dm
      mpath: eliminate need to use scsi_device_from_queue").
      
      Restore the ability to load, and attach, a particular scsi_dh module if
      one is specified (as noticed by checking m->hw_handler_name).
      
      Fixes: e8f74a0f ("dm mpath: eliminate need to use scsi_device_from_queue")
      Reported-by: default avatarPaul Mackerras <paulus@ozlabs.org>
      Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
      e457edf0
    • Linus Walleij's avatar
      mtd: jedec_probe: Fix crash in jedec_read_mfr() · 87a73eb5
      Linus Walleij authored
      
      
      It turns out that the loop where we read manufacturer
      jedec_read_mfd() can under some circumstances get a
      CFI_MFR_CONTINUATION repeatedly, making the loop go
      over all banks and eventually hit the end of the
      map and crash because of an access violation:
      
      Unable to handle kernel paging request at virtual address c4980000
      pgd = (ptrval)
      [c4980000] *pgd=03808811, *pte=00000000, *ppte=00000000
      Internal error: Oops: 7 [#1] PREEMPT ARM
      CPU: 0 PID: 1 Comm: swapper Not tainted 4.16.0-rc1+ #150
      Hardware name: Gemini (Device Tree)
      PC is at jedec_probe_chip+0x6ec/0xcd0
      LR is at 0x4
      pc : [<c03a2bf4>]    lr : [<00000004>]    psr: 60000013
      sp : c382dd18  ip : 0000ffff  fp : 00000000
      r10: c0626388  r9 : 00020000  r8 : c0626340
      r7 : 00000000  r6 : 00000001  r5 : c3a71afc  r4 : c382dd70
      r3 : 00000001  r2 : c4900000  r1 : 00000002  r0 : 00080000
      Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment none
      Control: 0000397f  Table: 00004000  DAC: 00000053
      Process swapper (pid: 1, stack limit = 0x(ptrval))
      
      Fix this by breaking the loop with a return 0 if
      the offset exceeds the map size.
      
      Fixes: 5c9c11e1 ("[MTD] [NOR] Add support for flash chips with ID in bank other than 0")
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: default avatarBoris Brezillon <boris.brezillon@bootlin.com>
      87a73eb5
    • Boris Brezillon's avatar
      mtd: nand: atmel: Fix get_sectorsize() function · 2b1b1b4a
      Boris Brezillon authored
      
      
      get_sectorsize() was not using the appropriate macro to extract the
      ECC sector size from the config cache, which led to buggy ECC when
      using 1024 byte sectors.
      
      Fixes: f88fc122 ("mtd: nand: Cleanup/rework the atmel_nand driver")
      Cc: <stable@vger.kernel.org>
      Reported-by: default avatarOlivier Schonken <olivier.schonken@gmail.com>
      Signed-off-by: default avatarBoris Brezillon <boris.brezillon@bootlin.com>
      Reviewed-by: default avatarRichard Weinberger <richard@nod.at>
      Acked-by: default avatarNicolas Ferre <nicolas.ferre@microchip.com>
      Tested-by: default avatarOlivier Schonken <olivier.schonken@gmail.com>
      2b1b1b4a
  3. Mar 29, 2018
    • Linus Torvalds's avatar
      Merge tag 'drm-fixes-for-v4.16-rc8' of git://people.freedesktop.org/~airlied/linux · 0b412605
      Linus Torvalds authored
      Pull drm fixes from Dave Airlie:
       "Nothing serious, two amdkfd and two tegra fixes"
      
      * tag 'drm-fixes-for-v4.16-rc8' of git://people.freedesktop.org/~airlied/linux:
        drm/tegra: dc: Using NULL instead of plain integer
        drm/amdkfd: Deallocate SDMA queues correctly
        drm/amdkfd: Fix scratch memory with HWS enabled
        drm/tegra: dc: Use correct format array for Tegra124
      0b412605
    • Linus Torvalds's avatar
      Merge branch 'akpm' (patches from Andrew) · 68b8dffc
      Linus Torvalds authored
      Merge misc fixes from Andrew Morton:
       "8 fixes"
      
      * emailed patches from Andrew Morton <akpm@linux-foundation.org>:
        MAINTAINERS: demote ARM port to "odd fixes"
        MAINTAINERS: correct rmk's email address
        mm/kmemleak.c: wait for scan completion before disabling free
        mm/memcontrol.c: fix parameter description mismatch
        mm/vmstat.c: fix vmstat_update() preemption BUG
        mm/page_owner: fix recursion bug after changing skip entries
        ipc/shm.c: add split function to shm_vm_ops
        mm, slab: memcg_link the SLAB's kmem_cache
      68b8dffc
    • Dave Airlie's avatar
      Merge tag 'drm/tegra/for-4.16-fixes' of git://anongit.freedesktop.org/tegra/linux into drm-fixes · ef55d153
      Dave Airlie authored
      drm/tegra: Fixes for v4.16
      
      This contains two small fixes, one which fixes a typo that causes a
      crash with the new framebuffer modifier query support and another that
      fixes a build warning.
      
      * tag 'drm/tegra/for-4.16-fixes' of git://anongit.freedesktop.org/tegra/linux:
        drm/tegra: dc: Using NULL instead of plain integer
        drm/tegra: dc: Use correct format array for Tegra124
      ef55d153
    • Linus Torvalds's avatar
      Merge tag 'powerpc-4.16-6' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux · a2601d78
      Linus Torvalds authored
      Pull powerpc fixes from Michael Ellerman:
       "Some more powerpc fixes for 4.16. Apologies if this is a bit big at
        rc7, but they're all reasonably important fixes. None are actually for
        new code, so they aren't indicative of 4.16 being in bad shape from
        our point of view.
      
         - Fix missing AT_BASE_PLATFORM (in auxv) when we're using a new
           firmware interface for describing CPU features.
      
         - Fix lost pending interrupts due to a race in our interrupt
           soft-masking code.
      
         - A workaround for a nest MMU bug with TLB invalidations on Power9.
      
         - A workaround for broadcast TLB invalidations on Power9.
      
         - Fix a bug in our instruction SLB miss handler, when handling bad
           addresses (eg. >= TASK_SIZE), which could corrupt non-volatile user
           GPRs.
      
        Thanks to: Aneesh Kumar K.V, Balbir Singh, Benjamin Herrenschmidt,
        Nicholas Piggin"
      
      * tag 'powerpc-4.16-6' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
        powerpc/64s: Fix i-side SLB miss bad address handler saving nonvolatile GPRs
        powerpc/mm: Fixup tlbie vs store ordering issue on POWER9
        powerpc/mm/radix: Move the functions that does the actual tlbie closer
        powerpc/mm/radix: Remove unused code
        powerpc/mm: Workaround Nest MMU bug with TLB invalidations
        powerpc/mm: Add tracking of the number of coprocessors using a context
        powerpc/64s: Fix lost pending interrupt due to race causing lost update to irq_happened
        powerpc/64s: Fix NULL AT_BASE_PLATFORM when using DT CPU features
      a2601d78
    • Linus Torvalds's avatar
      Merge tag 'armsoc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc · 616d8cf0
      Linus Torvalds authored
      Pull ARM SoC fixes from Arnd Bergmann:
       "Here are are a couple of last-minute fixes for 4.16, mostly for
        regressions. As usual, the majory are device tree changes:
      
         - USB 3 support on rk3399 didn't work and is being reverted for now
      
         - One fix for an old suspend/resume bug on rk3399
      
         - A few regulator related fixes on Banana Pi M2, and on imx7d-sdb
      
         - A boot regression fix for all Aspeed SoCs failing to find their
           memory
      
         - One more dtc warning fix
      
        The other changes are:
      
         - A few updates to the MAINTAINERS file
      
         - A revert for an incorrect orion5x cleanup
      
         - Two power management fixes for OMAP"
      
      * tag 'armsoc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc:
        ARM: OMAP: Fix SRAM W+X mapping
        ARM: dts: aspeed: Add default memory node
        mailmap: Update email address for Gregory CLEMENT
        ARM: davinci: fix the GPIO lookup for omapl138-hawk
        MAINTAINERS: Update Tegra IOMMU maintainer
        ARM: dts: imx7d-sdb: Fix regulator-usb-otg2-vbus node name
        ARM: ux500: Fix PMU IRQ regression
        ARM: dts: rockchip: Add missing #sound-dai-cells on rk3288
        Revert "arm64: dts: rockchip: add usb3-phy otg-port support for rk3399"
        arm64: dts: rockchip: Fix rk3399-gru-* s2r (pinctrl hogs, wifi reset)
        ARM: OMAP: Fix dmtimer init for omap1
        MAINTAINERS: update email address for Maxime Ripard
        ARM: dts: sun6i: a31s: bpi-m2: add missing regulators
        ARM: dts: sun6i: a31s: bpi-m2: improve pmic properties
      616d8cf0
    • Russell King's avatar
      MAINTAINERS: demote ARM port to "odd fixes" · 18bd4904
      Russell King authored
      As of the start of 2018, I am no longer paid to support the core 32-bit
      ARM architecture code.  This means that this code is no longer
      commercially supported, and is now only supported through voluntary
      effort.
      
      I will continue to merge patches as and when able, but this will be at a
      lower priority than before (which means a longer latency.) I have also
      be scaled back the amount of time spent reading email, so email that is
      intended for my attention needs to make itself plainly obvious, or I
      will miss it.
      
      In an attempt to reduce the amount of email Cc'd to me, exclude
      arch/arm/boot/dts from the maintainers patterns, but add entries for the
      SolidRun platforms I look after.
      
      Link: http://lkml.kernel.org/r/E1ezkgn-0002fO-52@rmk-PC.armlinux.org.uk
      
      
      Signed-off-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      18bd4904
    • Russell King's avatar
      5b634e8e
    • Vinayak Menon's avatar
      mm/kmemleak.c: wait for scan completion before disabling free · 914b6dff
      Vinayak Menon authored
      A crash is observed when kmemleak_scan accesses the object->pointer,
      likely due to the following race.
      
        TASK A             TASK B                     TASK C
        kmemleak_write
         (with "scan" and
         NOT "scan=on")
        kmemleak_scan()
                           create_object
                           kmem_cache_alloc fails
                           kmemleak_disable
                           kmemleak_do_cleanup
                           kmemleak_free_enabled = 0
                                                      kfree
                                                      kmemleak_free bails out
                                                       (kmemleak_free_enabled is 0)
                                                      slub frees object->pointer
        update_checksum
        crash - object->pointer
         freed (DEBUG_PAGEALLOC)
      
      kmemleak_do_cleanup waits for the scan thread to complete, but not for
      direct call to kmemleak_scan via kmemleak_write.  So add a wait for
      kmemleak_scan completion before disabling kmemleak_free, and while at it
      fix the comment on stop_scan_thread.
      
      [vinmenon@codeaurora.org: fix stop_scan_thread comment]
        Link: http://lkml.kernel.org/r/1522219972-22809-1-git-send-email-vinmenon@codeaurora.org
      Link: http://lkml.kernel.org/r/1522063429-18992-1-git-send-email-vinmenon@codeaurora.org
      
      
      Signed-off-by: default avatarVinayak Menon <vinmenon@codeaurora.org>
      Reviewed-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      914b6dff
    • Honglei Wang's avatar
      mm/memcontrol.c: fix parameter description mismatch · b213b54f
      Honglei Wang authored
      There are a couple of places where parameter description and function
      name do not match the actual code.  Fix it.
      
      Link: http://lkml.kernel.org/r/1520843448-17347-1-git-send-email-honglei.wang@oracle.com
      
      
      Signed-off-by: default avatarHonglei Wang <honglei.wang@oracle.com>
      Acked-by: default avatarTejun Heo <tj@kernel.org>
      Cc: Johannes Weiner <hannes@cmpxchg.org>
      Cc: Michal Hocko <mhocko@kernel.org>
      Cc: Vladimir Davydov <vdavydov.dev@gmail.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      b213b54f
    • Steven J. Hill's avatar
      mm/vmstat.c: fix vmstat_update() preemption BUG · c7f26ccf
      Steven J. Hill authored
      Attempting to hotplug CPUs with CONFIG_VM_EVENT_COUNTERS enabled can
      cause vmstat_update() to report a BUG due to preemption not being
      disabled around smp_processor_id().
      
      Discovered on Ubiquiti EdgeRouter Pro with Cavium Octeon II processor.
      
        BUG: using smp_processor_id() in preemptible [00000000] code:
        kworker/1:1/269
        caller is vmstat_update+0x50/0xa0
        CPU: 0 PID: 269 Comm: kworker/1:1 Not tainted
        4.16.0-rc4-Cavium-Octeon-00009-gf83bbd5-dirty #1
        Workqueue: mm_percpu_wq vmstat_update
        Call Trace:
          show_stack+0x94/0x128
          dump_stack+0xa4/0xe0
          check_preemption_disabled+0x118/0x120
          vmstat_update+0x50/0xa0
          process_one_work+0x144/0x348
          worker_thread+0x150/0x4b8
          kthread+0x110/0x140
          ret_from_kernel_thread+0x14/0x1c
      
      Link: http://lkml.kernel.org/r/1520881552-25659-1-git-send-email-steven.hill@cavium.com
      
      
      Signed-off-by: default avatarSteven J. Hill <steven.hill@cavium.com>
      Reviewed-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Cc: Tejun Heo <htejun@gmail.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      c7f26ccf
    • Maninder Singh's avatar
      mm/page_owner: fix recursion bug after changing skip entries · 299815a4
      Maninder Singh authored
      This patch fixes commit 5f48f0bd ("mm, page_owner: skip unnecessary
      stack_trace entries").
      
      Because if we skip first two entries then logic of checking count value
      as 2 for recursion is broken and code will go in one depth recursion.
      
      so we need to check only one call of _RET_IP(__set_page_owner) while
      checking for recursion.
      
      Current Backtrace while checking for recursion:-
      
        (save_stack)             from (__set_page_owner)  // (But recursion returns true here)
        (__set_page_owner)       from (get_page_from_freelist)
        (get_page_from_freelist) from (__alloc_pages_nodemask)
        (__alloc_pages_nodemask) from (depot_save_stack)
        (depot_save_stack)       from (save_stack)       // recursion should return true here
        (save_stack)             from (__set_page_owner)
        (__set_page_owner)       from (get_page_from_freelist)
        (get_page_from_freelist) from (__alloc_pages_nodemask+)
        (__alloc_pages_nodemask) from (depot_save_stack)
        (depot_save_stack)       from (save_stack)
        (save_stack)             from (__set_page_owner)
        (__set_page_owner)       from (get_page_from_freelist)
      
      Correct Backtrace with fix:
      
        (save_stack)             from (__set_page_owner) // recursion returned true here
        (__set_page_owner)       from (get_page_from_freelist)
        (get_page_from_freelist) from (__alloc_pages_nodemask+)
        (__alloc_pages_nodemask) from (depot_save_stack)
        (depot_save_stack)       from (save_stack)
        (save_stack)             from (__set_page_owner)
        (__set_page_owner)       from (get_page_from_freelist)
      
      Link: http://lkml.kernel.org/r/1521607043-34670-1-git-send-email-maninder1.s@samsung.com
      
      
      Fixes: 5f48f0bd ("mm, page_owner: skip unnecessary stack_trace entries")
      Signed-off-by: default avatarManinder Singh <maninder1.s@samsung.com>
      Signed-off-by: default avatarVaneet Narang <v.narang@samsung.com>
      Acked-by: default avatarVlastimil Babka <vbabka@suse.cz>
      Cc: Michal Hocko <mhocko@suse.com>
      Cc: Oscar Salvador <osalvador@techadventures.net>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Ayush Mittal <ayush.m@samsung.com>
      Cc: Prakash Gupta <guptap@codeaurora.org>
      Cc: Vinayak Menon <vinmenon@codeaurora.org>
      Cc: Vasyl Gomonovych <gomonovych@gmail.com>
      Cc: Amit Sahrawat <a.sahrawat@samsung.com>
      Cc: <pankaj.m@samsung.com>
      Cc: Vaneet Narang <v.narang@samsung.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      299815a4
    • Mike Kravetz's avatar
      ipc/shm.c: add split function to shm_vm_ops · 3d942ee0
      Mike Kravetz authored
      If System V shmget/shmat operations are used to create a hugetlbfs
      backed mapping, it is possible to munmap part of the mapping and split
      the underlying vma such that it is not huge page aligned.  This will
      untimately result in the following BUG:
      
        kernel BUG at /build/linux-jWa1Fv/linux-4.15.0/mm/hugetlb.c:3310!
        Oops: Exception in kernel mode, sig: 5 [#1]
        LE SMP NR_CPUS=2048 NUMA PowerNV
        Modules linked in: kcm nfc af_alg caif_socket caif phonet fcrypt
        CPU: 18 PID: 43243 Comm: trinity-subchil Tainted: G         C  E 4.15.0-10-generic #11-Ubuntu
        NIP:  c00000000036e764 LR: c00000000036ee48 CTR: 0000000000000009
        REGS: c000003fbcdcf810 TRAP: 0700   Tainted: G         C  E (4.15.0-10-generic)
        MSR:  9000000000029033 <SF,HV,EE,ME,IR,DR,RI,LE>  CR: 24002222  XER: 20040000
        CFAR: c00000000036ee44 SOFTE: 1
        NIP __unmap_hugepage_range+0xa4/0x760
        LR __unmap_hugepage_range_final+0x28/0x50
        Call Trace:
          0x7115e4e00000 (unreliable)
          __unmap_hugepage_r...
      3d942ee0
    • Shakeel Butt's avatar
      mm, slab: memcg_link the SLAB's kmem_cache · 880cd276
      Shakeel Butt authored
      All the root caches are linked into slab_root_caches which was
      introduced by the commit 510ded33 ("slab: implement slab_root_caches
      list") but it missed to add the SLAB's kmem_cache.
      
      While experimenting with opt-in/opt-out kmem accounting, I noticed
      system crashes due to NULL dereference inside cache_from_memcg_idx()
      while deferencing kmem_cache.memcg_params.memcg_caches.  The upstream
      clean kernel will not see these crashes but SLAB should be consistent
      with SLUB which does linked its boot caches (kmem_cache_node and
      kmem_cache) into slab_root_caches.
      
      Link: http://lkml.kernel.org/r/20180319210020.60289-1-shakeelb@google.com
      
      
      Fixes: 510ded33 ("slab: implement slab_root_caches list")
      Signed-off-by: default avatarShakeel Butt <shakeelb@google.com>
      Cc: Tejun Heo <tj@kernel.org>
      Cc: Vladimir Davydov <vdavydov.dev@gmail.com>
      Cc: Greg Thelen <gthelen@google.com>
      Cc: Christoph Lameter <cl@linux.com>
      Cc: Pekka Enberg <penberg@kernel.org>
      Cc: David Rientjes <rientjes@google.com>
      Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
      Cc: Johannes Weiner <hannes@cmpxchg.org>
      Cc: Michal Hocko <mhocko@kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      880cd276
    • Roland Dreier's avatar
      RDMA/ucma: Introduce safer rdma_addr_size() variants · 84652aef
      Roland Dreier authored
      
      
      There are several places in the ucma ABI where userspace can pass in a
      sockaddr but set the address family to AF_IB.  When that happens,
      rdma_addr_size() will return a size bigger than sizeof struct sockaddr_in6,
      and the ucma kernel code might end up copying past the end of a buffer
      not sized for a struct sockaddr_ib.
      
      Fix this by introducing new variants
      
          int rdma_addr_size_in6(struct sockaddr_in6 *addr);
          int rdma_addr_size_kss(struct __kernel_sockaddr_storage *addr);
      
      that are type-safe for the types used in the ucma ABI and return 0 if the
      size computed is bigger than the size of the type passed in.  We can use
      these new variants to check what size userspace has passed in before
      copying any addresses.
      
      Reported-by: default avatar <syzbot+6800425d54ed3ed8135d@syzkaller.appspotmail.com>
      Signed-off-by: default avatarRoland Dreier <roland@purestorage.com>
      Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
      84652aef
  4. Mar 28, 2018
    • Wei Yongjun's avatar
      drm/tegra: dc: Using NULL instead of plain integer · ef1b204a
      Wei Yongjun authored
      
      
      Fixes the following sparse warnings:
      
      drivers/gpu/drm/tegra/dc.c:2181:69: warning:
        Using plain integer as NULL pointer
      
      Signed-off-by: default avatarWei Yongjun <weiyongjun1@huawei.com>
      Signed-off-by: default avatarThierry Reding <treding@nvidia.com>
      ef1b204a
    • Linus Torvalds's avatar
      Merge branch 'fixes' of git://git.armlinux.org.uk/~rmk/linux-arm · d2b35e00
      Linus Torvalds authored
      Pull ARM fixes from Russell King:
       "A small number of small fixes for ARM, mostly for some build issues.
      
        One fix for a regression caused by the cpu hotplug conversion from a
        few kernel versions ago"
      
      * 'fixes' of git://git.armlinux.org.uk/~rmk/linux-arm:
        ARM: 8750/1: deflate_xip_data.sh: minor fixes
        ARM: 8748/1: mm: Define vdso_start, vdso_end as array
        ARM: 8747/1: make CONFIG_DEBUG_WX depend on MMU
        ARM: 8746/1: vfp: Go back to clearing vfp_current_hw_state[]
      d2b35e00
    • Linus Torvalds's avatar
      Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi · fd9adc40
      Linus Torvalds authored
      Pull SCSI fixes from James Bottomley:
       "Two driver fixes (ibmvfc, iscsi_tcp) and a USB fix for devices that
        give the wrong return to Read Capacity and cause a huge log spew.
      
        The remaining five patches all try to fix commit 84676c1f
        ("genirq/affinity: assign vectors to all possible CPUs") which broke
        the non-mq I/O path"
      
      * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
        scsi: iscsi_tcp: set BDI_CAP_STABLE_WRITES when data digest enabled
        scsi: sd: Remember that READ CAPACITY(16) succeeded
        scsi: ibmvfc: Avoid unnecessary port relogin
        scsi: virtio_scsi: unify scsi_host_template
        scsi: virtio_scsi: fix IO hang caused by automatic irq vector affinity
        scsi: core: introduce force_blk_mq
        scsi: megaraid_sas: fix selection of reply queue
        scsi: hpsa: fix selection of reply queue
      fd9adc40
    • Colin Ian King's avatar
      RDMA/hns: ensure for-loop actually iterates and free's buffers · 38759d61
      Colin Ian King authored
      
      
      The current for-loop zeros variable i and only loops once, hence
      not all the buffers are free'd.  Fix this by setting i correctly.
      
      Detected by CoverityScan, CID#1463415 ("Operands don't affect result")
      
      Fixes: a5073d60 ("RDMA/hns: Add eq support of hip08")
      Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
      Reviewed-by: default avatarYixian Liu <liuyixian@huawei.com>
      Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
      38759d61
    • Leon Romanovsky's avatar
      RDMA/ucma: Check that device exists prior to accessing it · c8d3bcbf
      Leon Romanovsky authored
      
      
      Ensure that device exists prior to accessing its properties.
      
      Reported-by: default avatar <syzbot+71655d44855ac3e76366@syzkaller.appspotmail.com>
      Fixes: 75216638 ("RDMA/cma: Export rdma cm interface to userspace")
      Signed-off-by: default avatarLeon Romanovsky <leonro@mellanox.com>
      Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
      c8d3bcbf
    • Leon Romanovsky's avatar
      RDMA/ucma: Check that device is connected prior to access it · 4b658d1b
      Leon Romanovsky authored
      
      
      Add missing check that device is connected prior to access it.
      
      [   55.358652] BUG: KASAN: null-ptr-deref in rdma_init_qp_attr+0x4a/0x2c0
      [   55.359389] Read of size 8 at addr 00000000000000b0 by task qp/618
      [   55.360255]
      [   55.360432] CPU: 1 PID: 618 Comm: qp Not tainted 4.16.0-rc1-00071-gcaf61b1b8b88 #91
      [   55.361693] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.11.0-0-g63451fca13-prebuilt.qemu-project.org 04/01/2014
      [   55.363264] Call Trace:
      [   55.363833]  dump_stack+0x5c/0x77
      [   55.364215]  kasan_report+0x163/0x380
      [   55.364610]  ? rdma_init_qp_attr+0x4a/0x2c0
      [   55.365238]  rdma_init_qp_attr+0x4a/0x2c0
      [   55.366410]  ucma_init_qp_attr+0x111/0x200
      [   55.366846]  ? ucma_notify+0xf0/0xf0
      [   55.367405]  ? _get_random_bytes+0xea/0x1b0
      [   55.367846]  ? urandom_read+0x2f0/0x2f0
      [   55.368436]  ? kmem_cache_alloc_trace+0xd2/0x1e0
      [   55.369104]  ? refcount_inc_not_zero+0x9/0x60
      [   55.369583]  ? refcount_inc+0x5/0x30
      [   55.370155]  ? rdma_create_id+0x215/0x240
      [   55.370937]  ? _copy_to_user+0x4f/0x60
      [   55.371620]  ? mem_cgroup_commit_charge+0x1f5/0x290
      [   55.372127]  ? _copy_from_user+0x5e/0x90
      [   55.372720]  ucma_write+0x174/0x1f0
      [   55.373090]  ? ucma_close_id+0x40/0x40
      [   55.373805]  ? __lru_cache_add+0xa8/0xd0
      [   55.374403]  __vfs_write+0xc4/0x350
      [   55.374774]  ? kernel_read+0xa0/0xa0
      [   55.375173]  ? fsnotify+0x899/0x8f0
      [   55.375544]  ? fsnotify_unmount_inodes+0x170/0x170
      [   55.376689]  ? __fsnotify_update_child_dentry_flags+0x30/0x30
      [   55.377522]  ? handle_mm_fault+0x174/0x320
      [   55.378169]  vfs_write+0xf7/0x280
      [   55.378864]  SyS_write+0xa1/0x120
      [   55.379270]  ? SyS_read+0x120/0x120
      [   55.379643]  ? mm_fault_error+0x180/0x180
      [   55.380071]  ? task_work_run+0x7d/0xd0
      [   55.380910]  ? __task_pid_nr_ns+0x120/0x140
      [   55.381366]  ? SyS_read+0x120/0x120
      [   55.381739]  do_syscall_64+0xeb/0x250
      [   55.382143]  entry_SYSCALL_64_after_hwframe+0x21/0x86
      [   55.382841] RIP: 0033:0x7fc2ef803e99
      [   55.383227] RSP: 002b:00007fffcc5f3be8 EFLAGS: 00000217 ORIG_RAX: 0000000000000001
      [   55.384173] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007fc2ef803e99
      [   55.386145] RDX: 0000000000000057 RSI: 0000000020000080 RDI: 0000000000000003
      [   55.388418] RBP: 00007fffcc5f3c00 R08: 0000000000000000 R09: 0000000000000000
      [   55.390542] R10: 0000000000000000 R11: 0000000000000217 R12: 0000000000400480
      [   55.392916] R13: 00007fffcc5f3cf0 R14: 0000000000000000 R15: 0000000000000000
      [   55.521088] Code: e5 4d 1e ff 48 89 df 44 0f b6 b3 b8 01 00 00 e8 65 50 1e ff 4c 8b 2b 49
      8d bd b0 00 00 00 e8 56 50 1e ff 41 0f b6 c6 48 c1 e0 04 <49> 03 85 b0 00 00 00 48 8d 78 08
      48 89 04 24 e8 3a 4f 1e ff 48
      [   55.525980] RIP: rdma_init_qp_attr+0x52/0x2c0 RSP: ffff8801e2c2f9d8
      [   55.532648] CR2: 00000000000000b0
      [   55.534396] ---[ end trace 70cee64090251c0b ]---
      
      Fixes: 75216638 ("RDMA/cma: Export rdma cm interface to userspace")
      Fixes: d541e455 ("IB/core: Convert ah_attr from OPA to IB when copying to user")
      Reported-by: default avatar <syzbot+7b62c837c2516f8f38c8@syzkaller.appspotmail.com>
      Signed-off-by: default avatarLeon Romanovsky <leonro@mellanox.com>
      Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
      4b658d1b
    • Jason Gunthorpe's avatar
      RDMA/rdma_cm: Fix use after free race with process_one_req · 9137108c
      Jason Gunthorpe authored
      
      
      process_one_req() can race with rdma_addr_cancel():
      
                 CPU0                                 CPU1
                 ====                                 ====
       process_one_work()
        debug_work_deactivate(work);
        process_one_req()
                                              rdma_addr_cancel()
      	                                  mutex_lock(&lock);
       			    	           set_timeout(&req->work,..);
                                                    __queue_work()
      				   	       debug_work_activate(work);
      	                                  mutex_unlock(&lock);
      
         mutex_lock(&lock);
      [..]
      	list_del(&req->list);
         mutex_unlock(&lock);
      [..]
      
         // ODEBUG explodes since the work is still queued.
         kfree(req);
      
      Causing ODEBUG to detect the use after free:
      
      ODEBUG: free active (active state 0) object type: work_struct hint: process_one_req+0x0/0x6c0 include/net/dst.h:165
      WARNING: CPU: 0 PID: 79 at lib/debugobjects.c:291 debug_print_object+0x166/0x220 lib/debugobjects.c:288
      kvm: emulating exchange as write
      Kernel panic - not syncing: panic_on_warn set ...
      
      CPU: 0 PID: 79 Comm: kworker/u4:3 Not tainted 4.16.0-rc6+ #361
      Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
      Workqueue: ib_addr process_one_req
      Call Trace:
       __dump_stack lib/dump_stack.c:17 [inline]
       dump_stack+0x194/0x24d lib/dump_stack.c:53
       panic+0x1e4/0x41c kernel/panic.c:183
       __warn+0x1dc/0x200 kernel/panic.c:547
       report_bug+0x1f4/0x2b0 lib/bug.c:186
       fixup_bug.part.11+0x37/0x80 arch/x86/kernel/traps.c:178
       fixup_bug arch/x86/kernel/traps.c:247 [inline]
       do_error_trap+0x2d7/0x3e0 arch/x86/kernel/traps.c:296
       do_invalid_op+0x1b/0x20 arch/x86/kernel/traps.c:315
       invalid_op+0x1b/0x40 arch/x86/entry/entry_64.S:986
      RIP: 0010:debug_print_object+0x166/0x220 lib/debugobjects.c:288
      RSP: 0000:ffff8801d966f210 EFLAGS: 00010086
      RAX: dffffc0000000008 RBX: 0000000000000003 RCX: ffffffff815acd6e
      RDX: 0000000000000000 RSI: 1ffff1003b2cddf2 RDI: 0000000000000000
      RBP: ffff8801d966f250 R08: 0000000000000000 R09: 1ffff1003b2cddc8
      R10: ffffed003b2cde71 R11: ffffffff86f39a98 R12: 0000000000000001
      R13: ffffffff86f15540 R14: ffffffff86408700 R15: ffffffff8147c0a0
       __debug_check_no_obj_freed lib/debugobjects.c:745 [inline]
       debug_check_no_obj_freed+0x662/0xf1f lib/debugobjects.c:774
       kfree+0xc7/0x260 mm/slab.c:3799
       process_one_req+0x2e7/0x6c0 drivers/infiniband/core/addr.c:592
       process_one_work+0xc47/0x1bb0 kernel/workqueue.c:2113
       worker_thread+0x223/0x1990 kernel/workqueue.c:2247
       kthread+0x33c/0x400 kernel/kthread.c:238
       ret_from_fork+0x3a/0x50 arch/x86/entry/entry_64.S:406
      
      Fixes: 5fff41e1 ("IB/core: Fix race condition in resolving IP to MAC")
      Reported-by: default avatar <syzbot+3b4acab09b6463472d0a@syzkaller.appspotmail.com>
      Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
      9137108c
  5. Mar 27, 2018
  6. Mar 26, 2018