Commit Graph

637562 Commits

Author SHA1 Message Date
Max Filippov
92ac0a477b xtensa: move parse_tag_fdt out of #ifdef CONFIG_BLK_DEV_INITRD
am: a7b9c9ddb6

Change-Id: Ibb93922bbf0c49b31d80ffa31de23f058f7e08d1
2017-03-15 02:24:12 +00:00
Clemens Gruber
59d39c255b pwm: pca9685: Fix period change with same duty cycle
am: 019c088dc4

Change-Id: Id57b7144856bd8bd082638dc16d98556d388195d
2017-03-15 02:24:03 +00:00
Trond Myklebust
49fe05a803 nlm: Ensure callback code also checks that the files match
am: 1f2f16c7b7

Change-Id: I43a97d53ff81c6eb8ae23b92ede80f3917806ede
2017-03-15 02:23:54 +00:00
Gavin Shan
9e380d66bc drivers/pci/hotplug: Fix initial state for empty slot
am: 4f77c55c3a

Change-Id: I06aecc89657e692b88615195afccf6e47ed6b136
2017-03-15 02:23:46 +00:00
Gavin Shan
07163c8825 drivers/pci/hotplug: Handle presence detection change properly
am: 1afe7b4ac3

Change-Id: Ia1259f87fb6dcb038d42ca40a35fb43f7167b001
2017-03-15 02:23:37 +00:00
Nicholas Bellinger
c45b44d5d8 target: Fix NULL dereference during LUN lookup + active I/O shutdown
am: 17ea11d553

Change-Id: I2c9b9e4596cdb9bb666de90603c41d4dfc26aaea
2017-03-15 02:23:28 +00:00
Gavin Shan
9ac636111c pci/hotplug/pnv-php: Disable surprise hotplug capability on conflicts
am: 54eff720c9

Change-Id: I1420772893847955dfd3ae3c1746a72e8cb849e3
2017-03-15 02:23:19 +00:00
Gavin Shan
867461fafe pci/hotplug/pnv-php: Remove WARN_ON() in pnv_php_put_slot()
am: 4ee3508f7a

Change-Id: I284c8381fe4eafd18062463a0e204f335dc3ccca
2017-03-15 02:23:10 +00:00
Jeff Layton
0f0cab5276 ceph: remove req from unsafe list when unregistering it
am: 5da90d0018

Change-Id: I7bfcdd15b663f7f79098beedc2e8baaa7db23331
2017-03-15 02:23:01 +00:00
Steven Rostedt (VMware)
ce337fd88d ktest: Fix child exit code processing
am: ff61e0123b

Change-Id: I48042d180623cda33ac13019be30c802a00722fc
2017-03-15 02:22:51 +00:00
Boris Brezillon
6fa9f8055f memory/atmel-ebi: Fix ns <-> cycles conversions
am: 1f2ca141ec

Change-Id: I1e564f59c0cae201de5bf92275a2809024b7fd49
2017-03-15 02:22:42 +00:00
Peter Zijlstra
debf88db0f orangefs: Use RCU for destroy_inode
am: b2b0f6ffd3

Change-Id: I89639d90d673b86119bdf6043ba608f30cf3f0fb
2017-03-15 02:22:34 +00:00
Eric W. Biederman
5feec54044 fs: Better permission checking for submounts
am: d3381fab77

Change-Id: I5f0019d2c86afd0a055f823f6751db9f6378e38f
2017-03-15 02:22:24 +00:00
Bart Van Assche
a2898ad07e IB/srp: Fix race conditions related to task management
am: 48e2181b0b

Change-Id: I171e07c10757212c74ebc5c01341b2b9752bf1f6
2017-03-15 02:22:15 +00:00
Bart Van Assche
23011815f9 IB/srp: Avoid that duplicate responses trigger a kernel bug
am: d5d1d2cc4b

Change-Id: I1d6058be1db22b0853190d0a932dc9c1136a5110
2017-03-15 02:22:05 +00:00
Bart Van Assche
9b6ab4a0c2 IB/SRP: Avoid using IB_MR_TYPE_SG_GAPS
am: 516a12ab11

Change-Id: I07efb0732a142e665ff782a7a9d6fc89d6609f12
2017-03-15 02:21:56 +00:00
Leon Romanovsky
9d68e9eae5 IB/mlx5: Fix out-of-bound access
am: 04f16db056

Change-Id: Id1506c11832c0efa03ec281d877295fe4a077ac4
2017-03-15 02:21:45 +00:00
Erez Shitrit
dbb1b56f08 IB/IPoIB: Add destination address when re-queue packet
am: 2e539fa49e

Change-Id: I9b71a393645f4fb1123a9981ccc819344165a3ce
2017-03-15 02:21:35 +00:00
Feras Daoud
e66ad7b980 IB/ipoib: Fix deadlock between rmmod and set_mode
am: 1626076b8e

Change-Id: I7df6daf518ff5cdf9ca2cd2babc936b4f12fe91c
2017-03-15 02:21:26 +00:00
Eric W. Biederman
d4ffcb8e2b mnt: Tuck mounts under others instead of creating shadow/side mounts.
am: 808e83e5ad

Change-Id: I58cb7df80b45193d209f697846c9fd0daa73e0a3
2017-03-15 02:21:16 +00:00
Gavin Li
29b9417a6c brcmfmac: fix incorrect event channel deduction
am: c9b3f3173f

Change-Id: I9faee9b23ccc60d13e81681b72de8106d05db3e6
2017-03-15 02:21:07 +00:00
Andrew Donnellan
e8fce0ca34 cxl: fix nested locking hang during EEH hotplug
am: 53d43706f2

Change-Id: I2d209e2170524b6aab237f883b17f8a50e94e811
2017-03-15 02:20:57 +00:00
Andrew Donnellan
477599e91b cxl: Prevent read/write to AFU config space while AFU not configured
am: 411d0b0ced

Change-Id: Ic0950806e04cbd6c16f10cb8a54a2feedb02709d
2017-03-15 02:20:48 +00:00
Thomas Petazzoni
8b2f89f8b2 net: mvpp2: fix DMA address calculation in mvpp2_txq_inc_put()
am: 60037aa689

Change-Id: Iad626208b9a7450963d3ab1f85f234c3196a24fa
2017-03-15 02:20:38 +00:00
Heiko Carstens
7be3c5fee9 s390: use correct input data address for setup_randomness
am: e067f68db2

Change-Id: I39d088b359b3013110b8d7050bf0a31bb3dfecb8
2017-03-15 02:20:28 +00:00
Heiko Carstens
55648739c7 s390: make setup_randomness work
am: 321081d522

Change-Id: I7513e1f4e3dbc1c856b9379f68578d3196888cb9
2017-03-15 02:20:20 +00:00
Martin Schwidefsky
fae88a1ff8 s390: TASK_SIZE for kernel threads
am: 9d38fd6a4f

Change-Id: Ideddfa572cbe56465d33c1ea23f579ca79a5c736
2017-03-15 02:20:10 +00:00
Peter Oberparleiter
7f8383d4a5 s390/chsc: Add exception handler for CHSC instruction
am: dc31841fcd

Change-Id: I8319561164624bb5257953980b634c1b1433cc85
2017-03-15 02:20:01 +00:00
Michael Holzheu
84872e1cda s390/kdump: Use "LINUX" ELF note name instead of "CORE"
am: 91cfcaa6ed

Change-Id: Ib1e184c24c5bd48b20364997700f101e88a32c64
2017-03-15 02:19:51 +00:00
Gerald Schaefer
0889880eac s390/dcssblk: fix device size calculation in dcssblk_direct_access()
am: b848102542

Change-Id: I2679898d49b6ebb1295baac47fe024d1148f445e
2017-03-15 02:19:42 +00:00
Julian Wiedmann
b74ce883de s390/qdio: clear DSCI prior to scanning multiple input queues
am: 5cec5e32ba

Change-Id: I86e1d78d1a1455fb19e8e29fbc3ac60dca8ce52d
2017-03-15 02:19:32 +00:00
Dmitry Tunin
d1b059b109 Bluetooth: Add another AR3012 04ca:3018 device
am: 519b6cead2

Change-Id: Id17f9e756deb493c568c13aca827639ea035c182
2017-03-15 02:19:23 +00:00
Chao Peng
45c8680aa4 KVM: VMX: use correct vmcs_read/write for guest segment selector/base
am: 7c3bab189c

Change-Id: Ide6a1352ee12abfaf8955dd9da5edda7895c34c9
2017-03-15 02:19:15 +00:00
Janosch Frank
d0f5a21737 KVM: s390: Disable dirty log retrieval for UCONTROL guests
am: 035dcc8e87

Change-Id: Id0932f5e4d600beb7c56f0288511119120c3f379
2017-03-15 02:19:05 +00:00
Ian Abbott
70ce5ca1e2 serial: 8250_pci: Add MKS Tenta SCOM-0800 and SCOM-0801 cards
am: c4c590be49

Change-Id: I82600c181818e85112ae82a97ed9820ca21b78ea
2017-03-15 02:18:56 +00:00
Alexander Popov
7f6d22e4cc tty: n_hdlc: get rid of racy n_hdlc.tbuf
am: e5b9778761

Change-Id: Id987aff27c13ebb71b0a1e6cd0ebdc39841f7657
2017-03-15 02:18:47 +00:00
Max Filippov
a7b9c9ddb6 xtensa: move parse_tag_fdt out of #ifdef CONFIG_BLK_DEV_INITRD
commit 4ab18701c6 upstream.

FDT tag parsing is not related to whether BLK_DEV_INITRD is configured
or not, move it out of the corresponding #ifdef/#endif block.
This fixes passing external FDT to the kernel configured w/o
BLK_DEV_INITRD support.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-15 10:02:47 +08:00
Clemens Gruber
019c088dc4 pwm: pca9685: Fix period change with same duty cycle
commit 8d254a340e upstream.

When first implementing support for changing the output frequency, an
optimization was added to continue the PWM after changing the prescaler
without having to reprogram the ON and OFF registers for the duty cycle,
in case the duty cycle stayed the same. This was flawed, because we
compared the absolute value of the duty cycle in nanoseconds instead of
the ratio to the period.

Fix the problem by removing the shortcut.

Fixes: 01ec847200 ("pwm-pca9685: Support changing the output frequency")
Signed-off-by: Clemens Gruber <clemens.gruber@pqgruber.com>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-15 10:02:46 +08:00
Trond Myklebust
1f2f16c7b7 nlm: Ensure callback code also checks that the files match
commit 251af29c32 upstream.

It is not sufficient to just check that the lock pids match when
granting a callback, we also need to ensure that we're granting
the callback on the right file.

Reported-by: Pankaj Singh <psingh.ait@gmail.com>
Fixes: 1da177e4c3 ("Linux-2.6.12-rc2")
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-15 10:02:46 +08:00
Gavin Shan
4f77c55c3a drivers/pci/hotplug: Fix initial state for empty slot
commit d0c424971f upstream.

In PowerNV PCI hotplug driver, the initial PCI slot's state is set
to PNV_PHP_STATE_POPULATED if no PCI devices are connected to the
slot. The PCI devices that are hot added to the slot won't be probed
and populated because of the check in pnv_php_enable():

        /* Check if the slot has been configured */
        if (php_slot->state != PNV_PHP_STATE_REGISTERED)
                return 0;

This fixes the issue by leaving the slot in PNV_PHP_STATE_REGISTERED
state initially if nothing is connected to the slot.

Fixes: 360aebd85a ("drivers/pci/hotplug: Support surprise hotplug in powernv driver")
Reported-by: Hank Chang <hankmax0000@gmail.com>
Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
Tested-by: Willie Liauw <williel@supermicro.com.tw>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-15 10:02:46 +08:00
Gavin Shan
1afe7b4ac3 drivers/pci/hotplug: Handle presence detection change properly
commit d7d55536c6 upstream.

The surprise hotplug is driven by interrupt in PowerNV PCI hotplug
driver. In the interrupt handler, pnv_php_interrupt(), we bail when
pnv_pci_get_presence_state() returns zero wrongly. It causes the
presence change event is always ignored incorrectly.

This fixes the issue by bailing on error (non-zero value) returned
from pnv_pci_get_presence_state().

Fixes: 360aebd85a ("drivers/pci/hotplug: Support surprise hotplug in powernv driver")
Reported-by: Hank Chang <hankmax0000@gmail.com>
Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
Tested-by: Willie Liauw <williel@supermicro.com.tw>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-15 10:02:46 +08:00
Nicholas Bellinger
17ea11d553 target: Fix NULL dereference during LUN lookup + active I/O shutdown
commit bd4e2d2907 upstream.

When transport_clear_lun_ref() is shutting down a se_lun via
configfs with new I/O in-flight, it's possible to trigger a
NULL pointer dereference in transport_lookup_cmd_lun() due
to the fact percpu_ref_get() doesn't do any __PERCPU_REF_DEAD
checking before incrementing lun->lun_ref.count after
lun->lun_ref has switched to atomic_t mode.

This results in a NULL pointer dereference as LUN shutdown
code in core_tpg_remove_lun() continues running after the
existing ->release() -> core_tpg_lun_ref_release() callback
completes, and clears the RCU protected se_lun->lun_se_dev
pointer.

During the OOPs, the state of lun->lun_ref in the process
which triggered the NULL pointer dereference looks like
the following on v4.1.y stable code:

struct se_lun {
  lun_link_magic = 4294932337,
  lun_status = TRANSPORT_LUN_STATUS_FREE,

  .....

  lun_se_dev = 0x0,
  lun_sep = 0x0,

  .....

  lun_ref = {
    count = {
      counter = 1
    },
    percpu_count_ptr = 3,
    release = 0xffffffffa02fa1e0 <core_tpg_lun_ref_release>,
    confirm_switch = 0x0,
    force_atomic = false,
    rcu = {
      next = 0xffff88154fa1a5d0,
      func = 0xffffffff8137c4c0 <percpu_ref_switch_to_atomic_rcu>
    }
  }
}

To address this bug, use percpu_ref_tryget_live() to ensure
once __PERCPU_REF_DEAD is visable on all CPUs and ->lun_ref
has switched to atomic_t, all new I/Os will fail to obtain
a new lun->lun_ref reference.

Also use an explicit percpu_ref_kill_and_confirm() callback
to block on ->lun_ref_comp to allow the first stage and
associated RCU grace period to complete, and then block on
->lun_ref_shutdown waiting for the final percpu_ref_put()
to drop the last reference via transport_lun_remove_cmd()
before continuing with core_tpg_remove_lun() shutdown.

Reported-by: Rob Millner <rlm@daterainc.com>
Tested-by: Rob Millner <rlm@daterainc.com>
Cc: Rob Millner <rlm@daterainc.com>
Tested-by: Vaibhav Tandon <vst@datera.io>
Cc: Vaibhav Tandon <vst@datera.io>
Tested-by: Bryant G. Ly <bryantly@linux.vnet.ibm.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-15 10:02:46 +08:00
Gavin Shan
54eff720c9 pci/hotplug/pnv-php: Disable surprise hotplug capability on conflicts
commit 303529d6ef upstream.

The root port or PCIe switch downstream port might have been associated
with driver other than pnv-php. The MSI or MSIx might also have been
enabled by that driver (e.g. pcieport_drv). Attempt to enable MSI incurs
below backtrace:

 PowerPC PowerNV PCI Hotplug Driver version: 0.1
 ------------[ cut here ]------------
 WARNING: CPU: 19 PID: 1004 at drivers/pci/msi.c:1071 \
                              __pci_enable_msi_range+0x84/0x4e0
 NIP [c000000000665c34] __pci_enable_msi_range+0x84/0x4e0
 LR [c000000000665c24] __pci_enable_msi_range+0x74/0x4e0
 Call Trace:
 [c000000384d67600] [c000000000665c24] __pci_enable_msi_range+0x74/0x4e0
 [c000000384d676e0] [d00000000aa31b04] pnv_php_register+0x564/0x5a0 [pnv_php]
 [c000000384d677c0] [d00000000aa31658] pnv_php_register+0xb8/0x5a0 [pnv_php]
 [c000000384d678a0] [d00000000aa31658] pnv_php_register+0xb8/0x5a0 [pnv_php]
 [c000000384d67980] [d00000000aa31dfc] pnv_php_init+0x60/0x98 [pnv_php]
 [c000000384d679f0] [c00000000000cfdc] do_one_initcall+0x6c/0x1d0
 [c000000384d67ab0] [c000000000b92354] do_init_module+0x94/0x254
 [c000000384d67b40] [c00000000019719c] load_module+0x258c/0x2c60
 [c000000384d67d30] [c000000000197bb0] SyS_finit_module+0xf0/0x170
 [c000000384d67e30] [c00000000000b184] system_call+0x38/0xe0

This fixes the issue by skipping enabling the surprise hotplug
capability if the MSI or MSIx on the PCI slot's upstream port has
been enabled by other driver.

Fixes: 360aebd85a ("drivers/pci/hotplug: Support surprise hotplug in powernv driver")
Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
Tested-by: Vaibhav Jain <vaibhav@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-15 10:02:45 +08:00
Gavin Shan
4ee3508f7a pci/hotplug/pnv-php: Remove WARN_ON() in pnv_php_put_slot()
commit 36c7c9da40 upstream.

The WARN_ON() causes unnecessary backtrace when putting the parent
slot, which is likely to be NULL.

 WARNING: CPU: 2 PID: 1071 at drivers/pci/hotplug/pnv_php.c:85 \
                              pnv_php_release+0xcc/0x150 [pnv_php]
    :
 Call Trace:
 [c0000003bc007c10] [d00000000ad613c4] pnv_php_release+0x144/0x150 [pnv_php]
 [c0000003bc007c40] [c0000000006641d8] pci_hp_deregister+0x238/0x330
 [c0000003bc007cd0] [d00000000ad61440] pnv_php_unregister_one+0x70/0xa0 [pnv_php]
 [c0000003bc007d10] [d00000000ad614c0] pnv_php_unregister+0x50/0x80 [pnv_php]
 [c0000003bc007d40] [d00000000ad61e84] pnv_php_exit+0x50/0xcb4 [pnv_php]
 [c0000003bc007d70] [c00000000019499c] SyS_delete_module+0x1fc/0x2a0
 [c0000003bc007e30] [c00000000000b184] system_call+0x38/0xe0

Fixes: 66725152fb ("PCI/hotplug: PowerPC PowerNV PCI hotplug driver")
Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
Tested-by: Vaibhav Jain <vaibhav@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-15 10:02:45 +08:00
Jeff Layton
5da90d0018 ceph: remove req from unsafe list when unregistering it
commit df963ea8a0 upstream.

There's no reason a request should ever be on a s_unsafe list but not
in the request tree.

Link: http://tracker.ceph.com/issues/18474
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Reviewed-by: Yan, Zheng <zyan@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-15 10:02:45 +08:00
Steven Rostedt (VMware)
ff61e0123b ktest: Fix child exit code processing
commit 32677207dc upstream.

The child_exit errno needs to be shifted by 8 bits to compare against the
return values for the bisect variables.

Fixes: c5dacb88f0 ("ktest: Allow overriding bisect test results")
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-15 10:02:45 +08:00
Boris Brezillon
1f2ca141ec memory/atmel-ebi: Fix ns <-> cycles conversions
commit ee19428950 upstream.

at91sam9_ebi_get_config() is incorrectly converting timings in clock
cycles into timings in nanoseconds by multiplying the cycle values by
the clk rate instead of the clk period.

at91sam9_ebi_xslate_config() has the same problem for the
tdf_ns -> tdf_cycles conversion.

Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Reported-by: Chris Leahy <leahycm@gmail.com>
Fixes: 6a4ec4cd08 ("memory: add Atmel EBI (External Bus Interface) driver")
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-15 10:02:45 +08:00
Peter Zijlstra
b2b0f6ffd3 orangefs: Use RCU for destroy_inode
commit 0695d7dc1d upstream.

freeing of inodes must be RCU-delayed on all filesystems

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-15 10:02:44 +08:00
Eric W. Biederman
d3381fab77 fs: Better permission checking for submounts
commit 93faccbbfa upstream.

To support unprivileged users mounting filesystems two permission
checks have to be performed: a test to see if the user allowed to
create a mount in the mount namespace, and a test to see if
the user is allowed to access the specified filesystem.

The automount case is special in that mounting the original filesystem
grants permission to mount the sub-filesystems, to any user who
happens to stumble across the their mountpoint and satisfies the
ordinary filesystem permission checks.

Attempting to handle the automount case by using override_creds
almost works.  It preserves the idea that permission to mount
the original filesystem is permission to mount the sub-filesystem.
Unfortunately using override_creds messes up the filesystems
ordinary permission checks.

Solve this by being explicit that a mount is a submount by introducing
vfs_submount, and using it where appropriate.

vfs_submount uses a new mount internal mount flags MS_SUBMOUNT, to let
sget and friends know that a mount is a submount so they can take appropriate
action.

sget and sget_userns are modified to not perform any permission checks
on submounts.

follow_automount is modified to stop using override_creds as that
has proven problemantic.

do_mount is modified to always remove the new MS_SUBMOUNT flag so
that we know userspace will never by able to specify it.

autofs4 is modified to stop using current_real_cred that was put in
there to handle the previous version of submount permission checking.

cifs is modified to pass the mountpoint all of the way down to vfs_submount.

debugfs is modified to pass the mountpoint all of the way down to
trace_automount by adding a new parameter.  To make this change easier
a new typedef debugfs_automount_t is introduced to capture the type of
the debugfs automount function.

Fixes: 069d5ac9ae ("autofs:  Fix automounts by using current_real_cred()->uid")
Fixes: aeaa4a79ff ("fs: Call d_automount with the filesystems creds")
Reviewed-by: Trond Myklebust <trond.myklebust@primarydata.com>
Reviewed-by: Seth Forshee <seth.forshee@canonical.com>
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-15 10:02:44 +08:00
Bart Van Assche
48e2181b0b IB/srp: Fix race conditions related to task management
commit 0a6fdbdeb1 upstream.

Avoid that srp_process_rsp() overwrites the status information
in ch if the SRP target response timed out and processing of
another task management function has already started. Avoid that
issuing multiple task management functions concurrently triggers
list corruption. This patch prevents that the following stack
trace appears in the system log:

WARNING: CPU: 8 PID: 9269 at lib/list_debug.c:52 __list_del_entry_valid+0xbc/0xc0
list_del corruption. prev->next should be ffffc90004bb7b00, but was ffff8804052ecc68
CPU: 8 PID: 9269 Comm: sg_reset Tainted: G        W       4.10.0-rc7-dbg+ #3
Call Trace:
 dump_stack+0x68/0x93
 __warn+0xc6/0xe0
 warn_slowpath_fmt+0x4a/0x50
 __list_del_entry_valid+0xbc/0xc0
 wait_for_completion_timeout+0x12e/0x170
 srp_send_tsk_mgmt+0x1ef/0x2d0 [ib_srp]
 srp_reset_device+0x5b/0x110 [ib_srp]
 scsi_ioctl_reset+0x1c7/0x290
 scsi_ioctl+0x12a/0x420
 sd_ioctl+0x9d/0x100
 blkdev_ioctl+0x51e/0x9f0
 block_ioctl+0x38/0x40
 do_vfs_ioctl+0x8f/0x700
 SyS_ioctl+0x3c/0x70
 entry_SYSCALL_64_fastpath+0x18/0xad

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Cc: Israel Rukshin <israelr@mellanox.com>
Cc: Max Gurtovoy <maxg@mellanox.com>
Cc: Laurence Oberman <loberman@redhat.com>
Cc: Steve Feeley <Steve.Feeley@sandisk.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-15 10:02:44 +08:00