1. 22 Oct, 2018 1 commit
    • Jack Wang's avatar
      md: fix memleak for mempool · 6aaa58c9
      Jack Wang authored
      I noticed kmemleak report memory leak when run create/stop
      md in a loop, backtrace:
      [<000000001ca975e7>] mempool_create_node+0x86/0xd0
      [<0000000095576bcd>] md_run+0x1057/0x1410 [md_mod]
      [<000000007b45c5fc>] do_md_run+0x15/0x130 [md_mod]
      [<000000001ede9ec0>] md_ioctl+0x1f49/0x25d0 [md_mod]
      [<000000004142cacf>] blkdev_ioctl+0x680/0xd00
      
      The root cause is we alloc mddev->flush_pool and
      mddev->flush_bio_pool in md_run, but from do_md_stop
      will not call into md_stop but __md_stop, move the
      mempool_destroy to __md_stop fixes the problem for me.
      
      The bug was introduced in 5a409b4f, the fixes should go to
      4.18+
      
      Fixes: 5a409b4f ("MD: fix lock contention for flush bios")
      Signed-off-by: default avatarJack Wang <jinpu.wang@profitbricks.com>
      Reviewed-by: default avatarXiao Ni <xni@redhat.com>
      Signed-off-by: default avatarShaohua Li <shli@fb.com>
      6aaa58c9
  2. 18 Oct, 2018 8 commits
  3. 15 Oct, 2018 1 commit
  4. 10 Oct, 2018 2 commits
  5. 03 Oct, 2018 1 commit
    • NeilBrown's avatar
      md: allow metadata updates while suspending an array - fix · 059421e0
      NeilBrown authored
      Commit 35bfc521 ("md: allow metadata update while suspending.")
      added support for allowing md_check_recovery() to still perform
      metadata updates while the array is entering the 'suspended' state.
      This is needed to allow the processes of entering the state to
      complete.
      
      Unfortunately, the patch doesn't really work.  The test for
      "mddev->suspended" at the start of md_check_recovery() means that the
      function doesn't try to do anything at all while entering suspend.
      
      This patch moves the code of updating the metadata while suspending to
      *before* the test on mddev->suspended.
      Reported-by: default avatarJeff Mahoney <jeffm@suse.com>
      Fixes: 35bfc521 ("md: allow metadata update while suspending.")
      Signed-off-by: default avatarNeilBrown <neilb@suse.com>
      Signed-off-by: default avatarShaohua Li <shli@fb.com>
      059421e0
  6. 02 Oct, 2018 1 commit
  7. 28 Sep, 2018 5 commits
    • Alex Wu's avatar
      md/raid10: Fix raid10 replace hang when new added disk faulty · ee37d731
      Alex Wu authored
      [Symptom]
      
      Resync thread hang when new added disk faulty during replacing.
      
      [Root Cause]
      
      In raid10_sync_request(), we expect to issue a bio with callback
      end_sync_read(), and a bio with callback end_sync_write().
      
      In normal situation, we will add resyncing sectors into
      mddev->recovery_active when raid10_sync_request() returned, and sub
      resynced sectors from mddev->recovery_active when end_sync_write()
      calls end_sync_request().
      
      If new added disk, which are replacing the old disk, is set faulty,
      there is a race condition:
          1. In the first rcu protected section, resync thread did not detect
             that mreplace is set faulty and pass the condition.
          2. In the second rcu protected section, mreplace is set faulty.
          3. But, resync thread will prepare the read object first, and then
             check the write condition.
          4. It will find that mreplace is set faulty and do not have to
             prepare write object.
      This cause we add resync sectors but never sub it.
      
      [How to Reproduce]
      
      This issue can be easily reproduced by the following steps:
          mdadm -C /dev/md0 --assume-clean -l 10 -n 4 /dev/sd[abcd]
          mdadm /dev/md0 -a /dev/sde
          mdadm /dev/md0 --replace /dev/sdd
          sleep 1
          mdadm /dev/md0 -f /dev/sde
      
      [How to Fix]
      
      This issue can be fixed by using local variables to record the result
      of test conditions. Once the conditions are satisfied, we can make sure
      that we need to issue a bio for read and a bio for write.
      
      Previous 'commit 24afd80d ("md/raid10: handle recovery of
      replacement devices.")' will also check whether bio is NULL, but leave
      the comment saying that it is a pointless test. So we remove this dummy
      check.
      Reported-by: default avatarAlex Chen <alexchen@synology.com>
      Reviewed-by: default avatarAllen Peng <allenpeng@synology.com>
      Reviewed-by: default avatarBingJing Chang <bingjingc@synology.com>
      Signed-off-by: default avatarAlex Wu <alexwu@synology.com>
      Signed-off-by: default avatarShaohua Li <shli@fb.com>
      ee37d731
    • Mariusz Tkaczyk's avatar
      raid5: block failing device if raid will be failed · fb73b357
      Mariusz Tkaczyk authored
      Currently there is an inconsistency for failing the member drives
      for arrays with different RAID levels. For RAID456 - there is a possibility
      to fail all of the devices. However - for other RAID levels - kernel blocks
      removing the member drive, if the operation results in array's FAIL state
      (EBUSY is returned). For example - removing last drive from RAID1 is not
      possible.
      This kind of blocker was never implemented for raid456 and we cannot see
      the reason why.
      
      We had tested following patch and did not observe any regression, so do you
      have any comments/reasons for current approach, or we can send the proper
      patch for this?
      Signed-off-by: default avatarMariusz Tkaczyk <mariusz.tkaczyk@intel.com>
      Signed-off-by: default avatarShaohua Li <shli@fb.com>
      fb73b357
    • Greg Kroah-Hartman's avatar
      Merge tag 'drm-fixes-2018-09-28' of git://anongit.freedesktop.org/drm/drm · f151f57b
      Greg Kroah-Hartman authored
      Dave writes:
        "drm fixes for 4.19-rc6
      
         Looks like a pretty normal week for graphics,
      
         core: syncobj fix, panel link regression revert
         amd: suspend/resume fixes, EDID emulation fix
         mali-dp: NV12 writeback and vblank reset fixes
         etnaviv: DMA setup fix"
      
      * tag 'drm-fixes-2018-09-28' of git://anongit.freedesktop.org/drm/drm:
        drm/amd/display: Fix Edid emulation for linux
        drm/amd/display: Fix Vega10 lightup on S3 resume
        drm/amdgpu: Fix vce work queue was not cancelled when suspend
        Revert "drm/panel: Add device_link from panel device to DRM device"
        drm/syncobj: Don't leak fences when WAIT_FOR_SUBMIT is set
        drm/malidp: Fix writeback in NV12
        drm: mali-dp: Call drm_crtc_vblank_reset on device init
        drm/etnaviv: add DMA configuration for etnaviv platform device
      f151f57b
    • Greg Kroah-Hartman's avatar
      Merge tag 'riscv-for-linus-4.19-rc6' of... · ed1b3f4c
      Greg Kroah-Hartman authored
      Merge tag 'riscv-for-linus-4.19-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/palmer/riscv-linux
      
      Palmer writes:
        "A Single RISC-V Update for 4.19-rc6
      
         The Debian guys have been pushing on our port and found some
         unversioned symbols leaking into modules.  This PR contains a single
         fix for that issue."
      
      * tag 'riscv-for-linus-4.19-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/palmer/riscv-linux:
        RISC-V: include linux/ftrace.h in asm-prototypes.h
      ed1b3f4c
    • Greg Kroah-Hartman's avatar
      Merge tag 'pci-v4.19-fixes-2' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/helgaas/pci · 278e59a0
      Greg Kroah-Hartman authored
      Bjorn writes:
        "PCI fixes:
      
        - Fix ACPI hotplug issue that causes black screen crash at boot (Mika
          Westerberg)
      
        - Fix DesignWare "scheduling while atomic" issues (Jisheng Zhang)
      
        - Add PPC contacts to MAINTAINERS for PCI core error handling (Bjorn
          Helgaas)
      
        - Sort Mobiveil MAINTAINERS entry (Lorenzo Pieralisi)"
      
      * tag 'pci-v4.19-fixes-2' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/helgaas/pci:
        ACPI / hotplug / PCI: Don't scan for non-hotplug bridges if slot is not bridge
        PCI: dwc: Fix scheduling while atomic issues
        MAINTAINERS: Move mobiveil PCI driver entry where it belongs
        MAINTAINERS: Update PPC contacts for PCI core error handling
      278e59a0
  8. 27 Sep, 2018 10 commits
  9. 26 Sep, 2018 4 commits
  10. 25 Sep, 2018 7 commits
    • Parav Pandit's avatar
      RDMA/core: Set right entry state before releasing reference · 5c5702e2
      Parav Pandit authored
      Currently add_modify_gid() for IB link layer has followong issue
      in cache update path.
      
      When GID update event occurs, core releases reference to the GID
      table without updating its state and/or entry pointer.
      
      CPU-0                              CPU-1
      ------                             -----
      ib_cache_update()                    IPoIB ULP
         add_modify_gid()                   [..]
            put_gid_entry()
            refcnt = 0, but
            state = valid,
            entry is valid.
            (work item is not yet executed).
                                         ipoib_create_ah()
                                           rdma_create_ah()
                                              rdma_get_gid_attr() <--
                                         	Tries to acquire gid_attr
                                              which has refcnt = 0.
                                         	This is incorrect.
      
      GID entry state and entry pointer is provides the accurate GID enty
      state. Such fields must be updated with rwlock to protect against
      readers and, such fields must be in sane state before refcount can drop
      to zero. Otherwise above race condition can happen leading to
      use-after-free situation.
      
      Following backtrace has been observed when cache update for an IB port
      is triggered while IPoIB ULP is creating an AH.
      
      Therefore, when updating GID entry, first mark a valid entry as invalid
      through state and set the barrier so that no callers can acquired
      the GID entry, followed by release reference to it.
      
      refcount_t: increment on 0; use-after-free.
      WARNING: CPU: 4 PID: 29106 at lib/refcount.c:153 refcount_inc_checked+0x30/0x50
      Workqueue: ib-comp-unb-wq ib_cq_poll_work [ib_core]
      RIP: 0010:refcount_inc_checked+0x30/0x50
      RSP: 0018:ffff8802ad36f600 EFLAGS: 00010082
      RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000
      RDX: 0000000000000002 RSI: 0000000000000008 RDI: ffffffff86710100
      RBP: ffff8802d6e60a30 R08: ffffed005d67bf8b R09: ffffed005d67bf8b
      R10: 0000000000000001 R11: ffffed005d67bf8a R12: ffff88027620cee8
      R13: ffff8802d6e60988 R14: ffff8802d6e60a78 R15: 0000000000000202
      FS: 0000000000000000(0000) GS:ffff8802eb200000(0000) knlGS:0000000000000000
      CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      CR2: 00007f3ab35e5c88 CR3: 00000002ce84a000 CR4: 00000000000006e0
      IPv6: ADDRCONF(NETDEV_CHANGE): ib1: link becomes ready
      Call Trace:
      rdma_get_gid_attr+0x220/0x310 [ib_core]
      ? lock_acquire+0x145/0x3a0
      rdma_fill_sgid_attr+0x32c/0x470 [ib_core]
      rdma_create_ah+0x89/0x160 [ib_core]
      ? rdma_fill_sgid_attr+0x470/0x470 [ib_core]
      ? ipoib_create_ah+0x52/0x260 [ib_ipoib]
      ipoib_create_ah+0xf5/0x260 [ib_ipoib]
      ipoib_mcast_join_complete+0xbbe/0x2540 [ib_ipoib]
      
      Fixes: b150c386 ("IB/core: Introduce GID entry reference counts")
      Signed-off-by: default avatarParav Pandit <parav@mellanox.com>
      Signed-off-by: default avatarLeon Romanovsky <leonro@mellanox.com>
      Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
      5c5702e2
    • Yishai Hadas's avatar
      IB/mlx5: Destroy the DEVX object upon error flow · e8ef090a
      Yishai Hadas authored
      Upon DEVX object creation the object must be destroyed upon a follows
      error flow.
      
      Fixes: 7efce369 ("IB/mlx5: Add obj create and destroy functionality")
      Signed-off-by: default avatarYishai Hadas <yishaih@mellanox.com>
      Reviewed-by: default avatarArtemy Kovalyov <artemyko@mellanox.com>
      Signed-off-by: default avatarLeon Romanovsky <leonro@mellanox.com>
      Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
      e8ef090a
    • Mark Bloch's avatar
      IB/uverbs: Free uapi on destroy · a9360abd
      Mark Bloch authored
      Make sure we free struct uverbs_api once we clean the radix tree. It was
      allocated by uverbs_alloc_api().
      
      Fixes: 9ed3e5f4 ("IB/uverbs: Build the specs into a radix tree at runtime")
      Reported-by: default avatarBart Van Assche <bvanassche@acm.org>
      Signed-off-by: default avatarMark Bloch <markb@mellanox.com>
      Signed-off-by: default avatarLeon Romanovsky <leonro@mellanox.com>
      Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
      a9360abd
    • Greg Kroah-Hartman's avatar
      erge tag 'libnvdimm-fixes-4.19-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm · a3852318
      Greg Kroah-Hartman authored
      Dan writes:
        "libnvdimm/dax for 4.19-rc6
      
        * (2) fixes for the dax error handling updates that were merged for
        v4.19-rc1. My mails to Al have been bouncing recently, so I do not have
        his ack but the uaccess change is of the trivial / obviously correct
        variety. The address_space_operations fixes a regression.
      
        * A filesystem-dax fix to correct the zero page lookup to be compatible
         with non-x86 (mips and s390) architectures."
      
      * tag 'libnvdimm-fixes-4.19-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm:
        device-dax: Add missing address_space_operations
        uaccess: Fix is_source param for check_copy_size() in copy_to_iter_mcsafe()
        filesystem-dax: Fix use of zero page
      a3852318
    • Greg Kroah-Hartman's avatar
      Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi · 846e8dd4
      Greg Kroah-Hartman authored
      James writes:
        "SCSI fixes on 20180925
      
         Nine obvious bug fixes mostly in individual drivers.  The target fix
         is of particular importance because it's CVE related."
      
      * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
        scsi: sd: don't crash the host on invalid commands
        scsi: ipr: System hung while dlpar adding primary ipr adapter back
        scsi: target: iscsi: Use bin2hex instead of a re-implementation
        scsi: target: iscsi: Use hex2bin instead of a re-implementation
        scsi: lpfc: Synchronize access to remoteport via rport
        scsi: ufs: Disable blk-mq for now
        scsi: sd: Contribute to randomness when running rotational device
        scsi: ibmvscsis: Ensure partition name is properly NUL terminated
        scsi: ibmvscsis: Fix a stringop-overflow warning
      846e8dd4
    • Greg Kroah-Hartman's avatar
      Merge tag 'usb-4.19-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb · bfb0e9b4
      Greg Kroah-Hartman authored
      I wrote:
        "USB fixes for 4.19-rc6
      
         Here are some small USB core and driver fixes for reported issues for
         4.19-rc6.
      
         The most visible is the oops fix for when the USB core is built into the
         kernel that is present in 4.18.  Turns out not many people actually do
         that so it went unnoticed for a while.  The rest is some tiny typec,
         musb, and other core fixes.
      
         All have been in linux-next with no reported issues."
      
      * tag 'usb-4.19-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
        usb: typec: mux: Take care of driver module reference counting
        usb: core: safely deal with the dynamic quirk lists
        usb: roles: Take care of driver module reference counting
        USB: handle NULL config in usb_find_alt_setting()
        USB: fix error handling in usb_driver_claim_interface()
        USB: remove LPM management from usb_driver_claim_interface()
        USB: usbdevfs: restore warning for nonsensical flags
        USB: usbdevfs: sanitize flags more
        Revert "usb: cdc-wdm: Fix a sleep-in-atomic-context bug in service_outstanding_interrupt()"
        usb: musb: dsps: do not disable CPPI41 irq in driver teardown
      bfb0e9b4
    • Greg Kroah-Hartman's avatar
      Merge tag 'tty-4.19-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty · ccf791e5
      Greg Kroah-Hartman authored
      I wrote:
        "TTY/Serial driver fixes for 4.19-rc6
      
         Here are a number of small tty and serial driver fixes for reported
         issues for 4.19-rc6.
      
         One should hopefully resolve a much-reported issue that syzbot has found
         in the tty layer.  Although there are still more issues there, getting
         this fixed is nice to see finally happen.
      
         All of these have been in linux-next for a while with no reported
         issues."
      
      * tag 'tty-4.19-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
        serial: imx: restore handshaking irq for imx1
        tty: vt_ioctl: fix potential Spectre v1
        tty: Drop tty->count on tty_reopen() failure
        serial: cpm_uart: return immediately from console poll
        tty: serial: lpuart: avoid leaking struct tty_struct
        serial: mvebu-uart: Fix reporting of effective CSIZE to userspace
      ccf791e5