<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-stable.git/drivers/infiniband, branch linux-3.10.y</title>
<subtitle>Linux kernel stable tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/'/>
<entry>
<title>IB/qib: fix false-postive maybe-uninitialized warning</title>
<updated>2017-11-02T09:46:02+00:00</updated>
<author>
<name>Arnd Bergmann</name>
<email>arnd@arndb.de</email>
</author>
<published>2017-03-14T12:18:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=75840f10809bea0e3eb963d5a2fdb827044577a8'/>
<id>75840f10809bea0e3eb963d5a2fdb827044577a8</id>
<content type='text'>
commit f6aafac184a3e46e919769dd4faa8bf0dc436534 upstream.

aarch64-linux-gcc-7 complains about code it doesn't fully understand:

drivers/infiniband/hw/qib/qib_iba7322.c: In function 'qib_7322_txchk_change':
include/asm-generic/bitops/non-atomic.h:105:35: error: 'shadow' may be used uninitialized in this function [-Werror=maybe-uninitialized]

The code is right, and despite trying hard, I could not come up with a version
that I liked better than just adding a fake initialization here to shut up the
warning.

Fixes: f931551bafe1 ("IB/qib: Add new qib driver for QLogic PCIe InfiniBand adapters")
Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Acked-by: Ira Weiny &lt;ira.weiny@intel.com&gt;
Signed-off-by: Doug Ledford &lt;dledford@redhat.com&gt;
Signed-off-by: Willy Tarreau &lt;w@1wt.eu&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit f6aafac184a3e46e919769dd4faa8bf0dc436534 upstream.

aarch64-linux-gcc-7 complains about code it doesn't fully understand:

drivers/infiniband/hw/qib/qib_iba7322.c: In function 'qib_7322_txchk_change':
include/asm-generic/bitops/non-atomic.h:105:35: error: 'shadow' may be used uninitialized in this function [-Werror=maybe-uninitialized]

The code is right, and despite trying hard, I could not come up with a version
that I liked better than just adding a fake initialization here to shut up the
warning.

Fixes: f931551bafe1 ("IB/qib: Add new qib driver for QLogic PCIe InfiniBand adapters")
Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Acked-by: Ira Weiny &lt;ira.weiny@intel.com&gt;
Signed-off-by: Doug Ledford &lt;dledford@redhat.com&gt;
Signed-off-by: Willy Tarreau &lt;w@1wt.eu&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>IB/ipoib: rtnl_unlock can not come after free_netdev</title>
<updated>2017-11-02T09:46:02+00:00</updated>
<author>
<name>Feras Daoud</name>
<email>ferasda@mellanox.com</email>
</author>
<published>2016-12-28T12:47:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=90326945a4f4939725d32e62b8b31d0375950958'/>
<id>90326945a4f4939725d32e62b8b31d0375950958</id>
<content type='text'>
commit 89a3987ab7a923c047c6dec008e60ad6f41fac22 upstream.

The ipoib_vlan_add function calls rtnl_unlock after free_netdev,
rtnl_unlock not only releases the lock, but also calls netdev_run_todo.
The latter function browses the net_todo_list array and completes the
unregistration of all its net_device instances. If we call free_netdev
before rtnl_unlock, then netdev_run_todo call over the freed device causes
panic.
To fix, move rtnl_unlock call before free_netdev call.

Fixes: 9baa0b036410 ("IB/ipoib: Add rtnl_link_ops support")
Cc: Or Gerlitz &lt;ogerlitz@mellanox.com&gt;
Signed-off-by: Feras Daoud &lt;ferasda@mellanox.com&gt;
Signed-off-by: Erez Shitrit &lt;erezsh@mellanox.com&gt;
Reviewed-by: Yuval Shaia &lt;yuval.shaia@oracle.com&gt;
Signed-off-by: Leon Romanovsky &lt;leon@kernel.org&gt;
Signed-off-by: Doug Ledford &lt;dledford@redhat.com&gt;
Signed-off-by: Willy Tarreau &lt;w@1wt.eu&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 89a3987ab7a923c047c6dec008e60ad6f41fac22 upstream.

The ipoib_vlan_add function calls rtnl_unlock after free_netdev,
rtnl_unlock not only releases the lock, but also calls netdev_run_todo.
The latter function browses the net_todo_list array and completes the
unregistration of all its net_device instances. If we call free_netdev
before rtnl_unlock, then netdev_run_todo call over the freed device causes
panic.
To fix, move rtnl_unlock call before free_netdev call.

Fixes: 9baa0b036410 ("IB/ipoib: Add rtnl_link_ops support")
Cc: Or Gerlitz &lt;ogerlitz@mellanox.com&gt;
Signed-off-by: Feras Daoud &lt;ferasda@mellanox.com&gt;
Signed-off-by: Erez Shitrit &lt;erezsh@mellanox.com&gt;
Reviewed-by: Yuval Shaia &lt;yuval.shaia@oracle.com&gt;
Signed-off-by: Leon Romanovsky &lt;leon@kernel.org&gt;
Signed-off-by: Doug Ledford &lt;dledford@redhat.com&gt;
Signed-off-by: Willy Tarreau &lt;w@1wt.eu&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>rdma_cm: fail iwarp accepts w/o connection params</title>
<updated>2017-06-20T12:04:24+00:00</updated>
<author>
<name>Steve Wise</name>
<email>swise@opengridcomputing.com</email>
</author>
<published>2017-02-21T19:21:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=11f43b27cb874a0c791044d64a84096688ebc5f1'/>
<id>11f43b27cb874a0c791044d64a84096688ebc5f1</id>
<content type='text'>
commit f2625f7db4dd0bbd16a9c7d2950e7621f9aa57ad upstream.

cma_accept_iw() needs to return an error if conn_params is NULL.
Since this is coming from user space, we can crash.

Reported-by: Shaobo He &lt;shaobo@cs.utah.edu&gt;
Acked-by: Sean Hefty &lt;sean.hefty@intel.com&gt;
Signed-off-by: Steve Wise &lt;swise@opengridcomputing.com&gt;
Signed-off-by: Doug Ledford &lt;dledford@redhat.com&gt;
Signed-off-by: Willy Tarreau &lt;w@1wt.eu&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit f2625f7db4dd0bbd16a9c7d2950e7621f9aa57ad upstream.

cma_accept_iw() needs to return an error if conn_params is NULL.
Since this is coming from user space, we can crash.

Reported-by: Shaobo He &lt;shaobo@cs.utah.edu&gt;
Acked-by: Sean Hefty &lt;sean.hefty@intel.com&gt;
Signed-off-by: Steve Wise &lt;swise@opengridcomputing.com&gt;
Signed-off-by: Doug Ledford &lt;dledford@redhat.com&gt;
Signed-off-by: Willy Tarreau &lt;w@1wt.eu&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>IB/ipoib: Fix deadlock between rmmod and set_mode</title>
<updated>2017-06-07T22:47:02+00:00</updated>
<author>
<name>Feras Daoud</name>
<email>ferasda@mellanox.com</email>
</author>
<published>2016-12-28T12:47:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=2c318737ecf7239eeae448d8333ee2643d42a85d'/>
<id>2c318737ecf7239eeae448d8333ee2643d42a85d</id>
<content type='text'>
commit 0a0007f28304cb9fc87809c86abb80ec71317f20 upstream.

When calling set_mode from sys/fs, the call flow locks the sys/fs lock
first and then tries to lock rtnl_lock (when calling ipoib_set_mod).
On the other hand, the rmmod call flow takes the rtnl_lock first
(when calling unregister_netdev) and then tries to take the sys/fs
lock. Deadlock a-&gt;b, b-&gt;a.

The problem starts when ipoib_set_mod frees it's rtnl_lck and tries
to get it after that.

    set_mod:
    [&lt;ffffffff8104f2bd&gt;] ? check_preempt_curr+0x6d/0x90
    [&lt;ffffffff814fee8e&gt;] __mutex_lock_slowpath+0x13e/0x180
    [&lt;ffffffff81448655&gt;] ? __rtnl_unlock+0x15/0x20
    [&lt;ffffffff814fed2b&gt;] mutex_lock+0x2b/0x50
    [&lt;ffffffff81448675&gt;] rtnl_lock+0x15/0x20
    [&lt;ffffffffa02ad807&gt;] ipoib_set_mode+0x97/0x160 [ib_ipoib]
    [&lt;ffffffffa02b5f5b&gt;] set_mode+0x3b/0x80 [ib_ipoib]
    [&lt;ffffffff8134b840&gt;] dev_attr_store+0x20/0x30
    [&lt;ffffffff811f0fe5&gt;] sysfs_write_file+0xe5/0x170
    [&lt;ffffffff8117b068&gt;] vfs_write+0xb8/0x1a0
    [&lt;ffffffff8117ba81&gt;] sys_write+0x51/0x90
    [&lt;ffffffff8100b0f2&gt;] system_call_fastpath+0x16/0x1b

    rmmod:
    [&lt;ffffffff81279ffc&gt;] ? put_dec+0x10c/0x110
    [&lt;ffffffff8127a2ee&gt;] ? number+0x2ee/0x320
    [&lt;ffffffff814fe6a5&gt;] schedule_timeout+0x215/0x2e0
    [&lt;ffffffff8127cc04&gt;] ? vsnprintf+0x484/0x5f0
    [&lt;ffffffff8127b550&gt;] ? string+0x40/0x100
    [&lt;ffffffff814fe323&gt;] wait_for_common+0x123/0x180
    [&lt;ffffffff81060250&gt;] ? default_wake_function+0x0/0x20
    [&lt;ffffffff8119661e&gt;] ? ifind_fast+0x5e/0xb0
    [&lt;ffffffff814fe43d&gt;] wait_for_completion+0x1d/0x20
    [&lt;ffffffff811f2e68&gt;] sysfs_addrm_finish+0x228/0x270
    [&lt;ffffffff811f2fb3&gt;] sysfs_remove_dir+0xa3/0xf0
    [&lt;ffffffff81273f66&gt;] kobject_del+0x16/0x40
    [&lt;ffffffff8134cd14&gt;] device_del+0x184/0x1e0
    [&lt;ffffffff8144e59b&gt;] netdev_unregister_kobject+0xab/0xc0
    [&lt;ffffffff8143c05e&gt;] rollback_registered+0xae/0x130
    [&lt;ffffffff8143c102&gt;] unregister_netdevice+0x22/0x70
    [&lt;ffffffff8143c16e&gt;] unregister_netdev+0x1e/0x30
    [&lt;ffffffffa02a91b0&gt;] ipoib_remove_one+0xe0/0x120 [ib_ipoib]
    [&lt;ffffffffa01ed95f&gt;] ib_unregister_device+0x4f/0x100 [ib_core]
    [&lt;ffffffffa021f5e1&gt;] mlx4_ib_remove+0x41/0x180 [mlx4_ib]
    [&lt;ffffffffa01ab771&gt;] mlx4_remove_device+0x71/0x90 [mlx4_core]

Fixes: 862096a8bbf8 ("IB/ipoib: Add more rtnl_link_ops callbacks")
Cc: Or Gerlitz &lt;ogerlitz@mellanox.com&gt;
Signed-off-by: Feras Daoud &lt;ferasda@mellanox.com&gt;
Signed-off-by: Erez Shitrit &lt;erezsh@mellanox.com&gt;
Signed-off-by: Leon Romanovsky &lt;leon@kernel.org&gt;
Signed-off-by: Doug Ledford &lt;dledford@redhat.com&gt;
Signed-off-by: Willy Tarreau &lt;w@1wt.eu&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 0a0007f28304cb9fc87809c86abb80ec71317f20 upstream.

When calling set_mode from sys/fs, the call flow locks the sys/fs lock
first and then tries to lock rtnl_lock (when calling ipoib_set_mod).
On the other hand, the rmmod call flow takes the rtnl_lock first
(when calling unregister_netdev) and then tries to take the sys/fs
lock. Deadlock a-&gt;b, b-&gt;a.

The problem starts when ipoib_set_mod frees it's rtnl_lck and tries
to get it after that.

    set_mod:
    [&lt;ffffffff8104f2bd&gt;] ? check_preempt_curr+0x6d/0x90
    [&lt;ffffffff814fee8e&gt;] __mutex_lock_slowpath+0x13e/0x180
    [&lt;ffffffff81448655&gt;] ? __rtnl_unlock+0x15/0x20
    [&lt;ffffffff814fed2b&gt;] mutex_lock+0x2b/0x50
    [&lt;ffffffff81448675&gt;] rtnl_lock+0x15/0x20
    [&lt;ffffffffa02ad807&gt;] ipoib_set_mode+0x97/0x160 [ib_ipoib]
    [&lt;ffffffffa02b5f5b&gt;] set_mode+0x3b/0x80 [ib_ipoib]
    [&lt;ffffffff8134b840&gt;] dev_attr_store+0x20/0x30
    [&lt;ffffffff811f0fe5&gt;] sysfs_write_file+0xe5/0x170
    [&lt;ffffffff8117b068&gt;] vfs_write+0xb8/0x1a0
    [&lt;ffffffff8117ba81&gt;] sys_write+0x51/0x90
    [&lt;ffffffff8100b0f2&gt;] system_call_fastpath+0x16/0x1b

    rmmod:
    [&lt;ffffffff81279ffc&gt;] ? put_dec+0x10c/0x110
    [&lt;ffffffff8127a2ee&gt;] ? number+0x2ee/0x320
    [&lt;ffffffff814fe6a5&gt;] schedule_timeout+0x215/0x2e0
    [&lt;ffffffff8127cc04&gt;] ? vsnprintf+0x484/0x5f0
    [&lt;ffffffff8127b550&gt;] ? string+0x40/0x100
    [&lt;ffffffff814fe323&gt;] wait_for_common+0x123/0x180
    [&lt;ffffffff81060250&gt;] ? default_wake_function+0x0/0x20
    [&lt;ffffffff8119661e&gt;] ? ifind_fast+0x5e/0xb0
    [&lt;ffffffff814fe43d&gt;] wait_for_completion+0x1d/0x20
    [&lt;ffffffff811f2e68&gt;] sysfs_addrm_finish+0x228/0x270
    [&lt;ffffffff811f2fb3&gt;] sysfs_remove_dir+0xa3/0xf0
    [&lt;ffffffff81273f66&gt;] kobject_del+0x16/0x40
    [&lt;ffffffff8134cd14&gt;] device_del+0x184/0x1e0
    [&lt;ffffffff8144e59b&gt;] netdev_unregister_kobject+0xab/0xc0
    [&lt;ffffffff8143c05e&gt;] rollback_registered+0xae/0x130
    [&lt;ffffffff8143c102&gt;] unregister_netdevice+0x22/0x70
    [&lt;ffffffff8143c16e&gt;] unregister_netdev+0x1e/0x30
    [&lt;ffffffffa02a91b0&gt;] ipoib_remove_one+0xe0/0x120 [ib_ipoib]
    [&lt;ffffffffa01ed95f&gt;] ib_unregister_device+0x4f/0x100 [ib_core]
    [&lt;ffffffffa021f5e1&gt;] mlx4_ib_remove+0x41/0x180 [mlx4_ib]
    [&lt;ffffffffa01ab771&gt;] mlx4_remove_device+0x71/0x90 [mlx4_core]

Fixes: 862096a8bbf8 ("IB/ipoib: Add more rtnl_link_ops callbacks")
Cc: Or Gerlitz &lt;ogerlitz@mellanox.com&gt;
Signed-off-by: Feras Daoud &lt;ferasda@mellanox.com&gt;
Signed-off-by: Erez Shitrit &lt;erezsh@mellanox.com&gt;
Signed-off-by: Leon Romanovsky &lt;leon@kernel.org&gt;
Signed-off-by: Doug Ledford &lt;dledford@redhat.com&gt;
Signed-off-by: Willy Tarreau &lt;w@1wt.eu&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>IB/mlx4: Fix port query for 56Gb Ethernet links</title>
<updated>2017-06-07T22:46:55+00:00</updated>
<author>
<name>Saeed Mahameed</name>
<email>saeedm@mellanox.com</email>
</author>
<published>2016-11-10T09:30:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=7d26287eee2e0f91137a6910204c8ebacca48d4b'/>
<id>7d26287eee2e0f91137a6910204c8ebacca48d4b</id>
<content type='text'>
commit 6fa26208206c406fa529cd73f7ae6bf4181e270b upstream.

Report the correct speed in the port attributes when using a 56Gbps
ethernet link.  Without this change the field is incorrectly set to 10.

Fixes: a9c766bb75ee ('IB/mlx4: Fix info returned when querying IBoE ports')
Fixes: 2e96691c31ec ('IB: Use central enum for speed instead of hard-coded values')
Signed-off-by: Saeed Mahameed &lt;saeedm@mellanox.com&gt;
Signed-off-by: Yishai Hadas &lt;yishaih@mellanox.com&gt;
Signed-off-by: Daniel Jurgens &lt;danielj@mellanox.com&gt;
Signed-off-by: Leon Romanovsky &lt;leon@kernel.org&gt;
Signed-off-by: Doug Ledford &lt;dledford@redhat.com&gt;
Signed-off-by: Willy Tarreau &lt;w@1wt.eu&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 6fa26208206c406fa529cd73f7ae6bf4181e270b upstream.

Report the correct speed in the port attributes when using a 56Gbps
ethernet link.  Without this change the field is incorrectly set to 10.

Fixes: a9c766bb75ee ('IB/mlx4: Fix info returned when querying IBoE ports')
Fixes: 2e96691c31ec ('IB: Use central enum for speed instead of hard-coded values')
Signed-off-by: Saeed Mahameed &lt;saeedm@mellanox.com&gt;
Signed-off-by: Yishai Hadas &lt;yishaih@mellanox.com&gt;
Signed-off-by: Daniel Jurgens &lt;danielj@mellanox.com&gt;
Signed-off-by: Leon Romanovsky &lt;leon@kernel.org&gt;
Signed-off-by: Doug Ledford &lt;dledford@redhat.com&gt;
Signed-off-by: Willy Tarreau &lt;w@1wt.eu&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>IB/mlx4: Set traffic class in AH</title>
<updated>2017-06-07T22:46:55+00:00</updated>
<author>
<name>Maor Gottlieb</name>
<email>maorg@mellanox.com</email>
</author>
<published>2016-11-10T09:30:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=dcb7311dc3a8abe166c8c8a154b98d8e70d1fa9b'/>
<id>dcb7311dc3a8abe166c8c8a154b98d8e70d1fa9b</id>
<content type='text'>
commit af4295c117b82a521b05d0daf39ce879d26e6cb1 upstream.

Set traffic class within sl_tclass_flowlabel when create iboe AH.
Without this the TOS value will be empty when running VLAN tagged
traffic, because the TOS value is taken from the traffic class in the
address handle attributes.

Fixes: 9106c4106974 ('IB/mlx4: Fix SL to 802.1Q priority-bits mapping for IBoE')
Signed-off-by: Maor Gottlieb &lt;maorg@mellanox.com&gt;
Signed-off-by: Daniel Jurgens &lt;danielj@mellanox.com&gt;
Reviewed-by: Mark Bloch &lt;markb@mellanox.com&gt;
Signed-off-by: Leon Romanovsky &lt;leon@kernel.org&gt;
Signed-off-by: Doug Ledford &lt;dledford@redhat.com&gt;
Signed-off-by: Willy Tarreau &lt;w@1wt.eu&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit af4295c117b82a521b05d0daf39ce879d26e6cb1 upstream.

Set traffic class within sl_tclass_flowlabel when create iboe AH.
Without this the TOS value will be empty when running VLAN tagged
traffic, because the TOS value is taken from the traffic class in the
address handle attributes.

Fixes: 9106c4106974 ('IB/mlx4: Fix SL to 802.1Q priority-bits mapping for IBoE')
Signed-off-by: Maor Gottlieb &lt;maorg@mellanox.com&gt;
Signed-off-by: Daniel Jurgens &lt;danielj@mellanox.com&gt;
Reviewed-by: Mark Bloch &lt;markb@mellanox.com&gt;
Signed-off-by: Leon Romanovsky &lt;leon@kernel.org&gt;
Signed-off-by: Doug Ledford &lt;dledford@redhat.com&gt;
Signed-off-by: Willy Tarreau &lt;w@1wt.eu&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>IB/multicast: Check ib_find_pkey() return value</title>
<updated>2017-06-07T22:46:50+00:00</updated>
<author>
<name>Bart Van Assche</name>
<email>bart.vanassche@sandisk.com</email>
</author>
<published>2016-11-21T18:22:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=029555a52a2bcc709ed6ad6b1c8b208f53011f9f'/>
<id>029555a52a2bcc709ed6ad6b1c8b208f53011f9f</id>
<content type='text'>
commit d3a2418ee36a59bc02e9d454723f3175dcf4bfd9 upstream.

This patch avoids that Coverity complains about not checking the
ib_find_pkey() return value.

Fixes: commit 547af76521b3 ("IB/multicast: Report errors on multicast groups if P_key changes")
Signed-off-by: Bart Van Assche &lt;bart.vanassche@sandisk.com&gt;
Cc: Sean Hefty &lt;sean.hefty@intel.com&gt;
Signed-off-by: Doug Ledford &lt;dledford@redhat.com&gt;
Signed-off-by: Willy Tarreau &lt;w@1wt.eu&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit d3a2418ee36a59bc02e9d454723f3175dcf4bfd9 upstream.

This patch avoids that Coverity complains about not checking the
ib_find_pkey() return value.

Fixes: commit 547af76521b3 ("IB/multicast: Report errors on multicast groups if P_key changes")
Signed-off-by: Bart Van Assche &lt;bart.vanassche@sandisk.com&gt;
Cc: Sean Hefty &lt;sean.hefty@intel.com&gt;
Signed-off-by: Doug Ledford &lt;dledford@redhat.com&gt;
Signed-off-by: Willy Tarreau &lt;w@1wt.eu&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>IB/mad: Fix an array index check</title>
<updated>2017-06-07T22:46:50+00:00</updated>
<author>
<name>Bart Van Assche</name>
<email>bart.vanassche@sandisk.com</email>
</author>
<published>2016-11-21T18:21:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=67ae25b4d158d01576b5e545643c8ad4ff84c0fd'/>
<id>67ae25b4d158d01576b5e545643c8ad4ff84c0fd</id>
<content type='text'>
commit 2fe2f378dd45847d2643638c07a7658822087836 upstream.

The array ib_mad_mgmt_class_table.method_table has MAX_MGMT_CLASS
(80) elements. Hence compare the array index with that value instead
of with IB_MGMT_MAX_METHODS (128). This patch avoids that Coverity
reports the following:

Overrunning array class-&gt;method_table of 80 8-byte elements at element index 127 (byte offset 1016) using index convert_mgmt_class(mad_hdr-&gt;mgmt_class) (which evaluates to 127).

Fixes: commit b7ab0b19a85f ("IB/mad: Verify mgmt class in received MADs")
Signed-off-by: Bart Van Assche &lt;bart.vanassche@sandisk.com&gt;
Cc: Sean Hefty &lt;sean.hefty@intel.com&gt;
Reviewed-by: Hal Rosenstock &lt;hal@mellanox.com&gt;
Signed-off-by: Doug Ledford &lt;dledford@redhat.com&gt;
Signed-off-by: Willy Tarreau &lt;w@1wt.eu&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 2fe2f378dd45847d2643638c07a7658822087836 upstream.

The array ib_mad_mgmt_class_table.method_table has MAX_MGMT_CLASS
(80) elements. Hence compare the array index with that value instead
of with IB_MGMT_MAX_METHODS (128). This patch avoids that Coverity
reports the following:

Overrunning array class-&gt;method_table of 80 8-byte elements at element index 127 (byte offset 1016) using index convert_mgmt_class(mad_hdr-&gt;mgmt_class) (which evaluates to 127).

Fixes: commit b7ab0b19a85f ("IB/mad: Verify mgmt class in received MADs")
Signed-off-by: Bart Van Assche &lt;bart.vanassche@sandisk.com&gt;
Cc: Sean Hefty &lt;sean.hefty@intel.com&gt;
Reviewed-by: Hal Rosenstock &lt;hal@mellanox.com&gt;
Signed-off-by: Doug Ledford &lt;dledford@redhat.com&gt;
Signed-off-by: Willy Tarreau &lt;w@1wt.eu&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>IB/cm: Mark stale CM id's whenever the mad agent was unregistered</title>
<updated>2017-02-10T10:03:38+00:00</updated>
<author>
<name>Mark Bloch</name>
<email>markb@mellanox.com</email>
</author>
<published>2016-10-27T13:36:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=aa19a88935f6d93b6b5468dc4b8ca4da9cb2ef29'/>
<id>aa19a88935f6d93b6b5468dc4b8ca4da9cb2ef29</id>
<content type='text'>
commit 9db0ff53cb9b43ed75bacd42a89c1a0ab048b2b0 upstream.

When there is a CM id object that has port assigned to it, it means that
the cm-id asked for the specific port that it should go by it, but if
that port was removed (hot-unplug event) the cm-id was not updated.
In order to fix that the port keeps a list of all the cm-id's that are
planning to go by it, whenever the port is removed it marks all of them
as invalid.

This commit fixes a kernel panic which happens when running traffic between
guests and we force reboot a guest mid traffic, it triggers a kernel panic:

 Call Trace:
  [&lt;ffffffff815271fa&gt;] ? panic+0xa7/0x16f
  [&lt;ffffffff8152b534&gt;] ? oops_end+0xe4/0x100
  [&lt;ffffffff8104a00b&gt;] ? no_context+0xfb/0x260
  [&lt;ffffffff81084db2&gt;] ? del_timer_sync+0x22/0x30
  [&lt;ffffffff8104a295&gt;] ? __bad_area_nosemaphore+0x125/0x1e0
  [&lt;ffffffff81084240&gt;] ? process_timeout+0x0/0x10
  [&lt;ffffffff8104a363&gt;] ? bad_area_nosemaphore+0x13/0x20
  [&lt;ffffffff8104aabf&gt;] ? __do_page_fault+0x31f/0x480
  [&lt;ffffffff81065df0&gt;] ? default_wake_function+0x0/0x20
  [&lt;ffffffffa0752675&gt;] ? free_msg+0x55/0x70 [mlx5_core]
  [&lt;ffffffffa0753434&gt;] ? cmd_exec+0x124/0x840 [mlx5_core]
  [&lt;ffffffff8105a924&gt;] ? find_busiest_group+0x244/0x9f0
  [&lt;ffffffff8152d45e&gt;] ? do_page_fault+0x3e/0xa0
  [&lt;ffffffff8152a815&gt;] ? page_fault+0x25/0x30
  [&lt;ffffffffa024da25&gt;] ? cm_alloc_msg+0x35/0xc0 [ib_cm]
  [&lt;ffffffffa024e821&gt;] ? ib_send_cm_dreq+0xb1/0x1e0 [ib_cm]
  [&lt;ffffffffa024f836&gt;] ? cm_destroy_id+0x176/0x320 [ib_cm]
  [&lt;ffffffffa024fb00&gt;] ? ib_destroy_cm_id+0x10/0x20 [ib_cm]
  [&lt;ffffffffa034f527&gt;] ? ipoib_cm_free_rx_reap_list+0xa7/0x110 [ib_ipoib]
  [&lt;ffffffffa034f590&gt;] ? ipoib_cm_rx_reap+0x0/0x20 [ib_ipoib]
  [&lt;ffffffffa034f5a5&gt;] ? ipoib_cm_rx_reap+0x15/0x20 [ib_ipoib]
  [&lt;ffffffff81094d20&gt;] ? worker_thread+0x170/0x2a0
  [&lt;ffffffff8109b2a0&gt;] ? autoremove_wake_function+0x0/0x40
  [&lt;ffffffff81094bb0&gt;] ? worker_thread+0x0/0x2a0
  [&lt;ffffffff8109aef6&gt;] ? kthread+0x96/0xa0
  [&lt;ffffffff8100c20a&gt;] ? child_rip+0xa/0x20
  [&lt;ffffffff8109ae60&gt;] ? kthread+0x0/0xa0
  [&lt;ffffffff8100c200&gt;] ? child_rip+0x0/0x20

Fixes: a977049dacde ("[PATCH] IB: Add the kernel CM implementation")
Signed-off-by: Mark Bloch &lt;markb@mellanox.com&gt;
Signed-off-by: Erez Shitrit &lt;erezsh@mellanox.com&gt;
Reviewed-by: Maor Gottlieb &lt;maorg@mellanox.com&gt;
Signed-off-by: Leon Romanovsky &lt;leon@kernel.org&gt;
Signed-off-by: Doug Ledford &lt;dledford@redhat.com&gt;
Signed-off-by: Willy Tarreau &lt;w@1wt.eu&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 9db0ff53cb9b43ed75bacd42a89c1a0ab048b2b0 upstream.

When there is a CM id object that has port assigned to it, it means that
the cm-id asked for the specific port that it should go by it, but if
that port was removed (hot-unplug event) the cm-id was not updated.
In order to fix that the port keeps a list of all the cm-id's that are
planning to go by it, whenever the port is removed it marks all of them
as invalid.

This commit fixes a kernel panic which happens when running traffic between
guests and we force reboot a guest mid traffic, it triggers a kernel panic:

 Call Trace:
  [&lt;ffffffff815271fa&gt;] ? panic+0xa7/0x16f
  [&lt;ffffffff8152b534&gt;] ? oops_end+0xe4/0x100
  [&lt;ffffffff8104a00b&gt;] ? no_context+0xfb/0x260
  [&lt;ffffffff81084db2&gt;] ? del_timer_sync+0x22/0x30
  [&lt;ffffffff8104a295&gt;] ? __bad_area_nosemaphore+0x125/0x1e0
  [&lt;ffffffff81084240&gt;] ? process_timeout+0x0/0x10
  [&lt;ffffffff8104a363&gt;] ? bad_area_nosemaphore+0x13/0x20
  [&lt;ffffffff8104aabf&gt;] ? __do_page_fault+0x31f/0x480
  [&lt;ffffffff81065df0&gt;] ? default_wake_function+0x0/0x20
  [&lt;ffffffffa0752675&gt;] ? free_msg+0x55/0x70 [mlx5_core]
  [&lt;ffffffffa0753434&gt;] ? cmd_exec+0x124/0x840 [mlx5_core]
  [&lt;ffffffff8105a924&gt;] ? find_busiest_group+0x244/0x9f0
  [&lt;ffffffff8152d45e&gt;] ? do_page_fault+0x3e/0xa0
  [&lt;ffffffff8152a815&gt;] ? page_fault+0x25/0x30
  [&lt;ffffffffa024da25&gt;] ? cm_alloc_msg+0x35/0xc0 [ib_cm]
  [&lt;ffffffffa024e821&gt;] ? ib_send_cm_dreq+0xb1/0x1e0 [ib_cm]
  [&lt;ffffffffa024f836&gt;] ? cm_destroy_id+0x176/0x320 [ib_cm]
  [&lt;ffffffffa024fb00&gt;] ? ib_destroy_cm_id+0x10/0x20 [ib_cm]
  [&lt;ffffffffa034f527&gt;] ? ipoib_cm_free_rx_reap_list+0xa7/0x110 [ib_ipoib]
  [&lt;ffffffffa034f590&gt;] ? ipoib_cm_rx_reap+0x0/0x20 [ib_ipoib]
  [&lt;ffffffffa034f5a5&gt;] ? ipoib_cm_rx_reap+0x15/0x20 [ib_ipoib]
  [&lt;ffffffff81094d20&gt;] ? worker_thread+0x170/0x2a0
  [&lt;ffffffff8109b2a0&gt;] ? autoremove_wake_function+0x0/0x40
  [&lt;ffffffff81094bb0&gt;] ? worker_thread+0x0/0x2a0
  [&lt;ffffffff8109aef6&gt;] ? kthread+0x96/0xa0
  [&lt;ffffffff8100c20a&gt;] ? child_rip+0xa/0x20
  [&lt;ffffffff8109ae60&gt;] ? kthread+0x0/0xa0
  [&lt;ffffffff8100c200&gt;] ? child_rip+0x0/0x20

Fixes: a977049dacde ("[PATCH] IB: Add the kernel CM implementation")
Signed-off-by: Mark Bloch &lt;markb@mellanox.com&gt;
Signed-off-by: Erez Shitrit &lt;erezsh@mellanox.com&gt;
Reviewed-by: Maor Gottlieb &lt;maorg@mellanox.com&gt;
Signed-off-by: Leon Romanovsky &lt;leon@kernel.org&gt;
Signed-off-by: Doug Ledford &lt;dledford@redhat.com&gt;
Signed-off-by: Willy Tarreau &lt;w@1wt.eu&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>IB/uverbs: Fix leak of XRC target QPs</title>
<updated>2017-02-10T10:03:38+00:00</updated>
<author>
<name>Tariq Toukan</name>
<email>tariqt@mellanox.com</email>
</author>
<published>2016-10-27T13:36:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=52aac91d3a712331ea4a7c99415a6dfc782d875d'/>
<id>52aac91d3a712331ea4a7c99415a6dfc782d875d</id>
<content type='text'>
commit 5b810a242c28e1d8d64d718cebe75b79d86a0b2d upstream.

The real QP is destroyed in case of the ref count reaches zero, but
for XRC target QPs this call was missed and caused to QP leaks.

Let's call to destroy for all flows.

Fixes: 0e0ec7e0638e ('RDMA/core: Export ib_open_qp() to share XRC...')
Signed-off-by: Tariq Toukan &lt;tariqt@mellanox.com&gt;
Signed-off-by: Noa Osherovich &lt;noaos@mellanox.com&gt;
Signed-off-by: Leon Romanovsky &lt;leon@kernel.org&gt;
Signed-off-by: Doug Ledford &lt;dledford@redhat.com&gt;
Signed-off-by: Willy Tarreau &lt;w@1wt.eu&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 5b810a242c28e1d8d64d718cebe75b79d86a0b2d upstream.

The real QP is destroyed in case of the ref count reaches zero, but
for XRC target QPs this call was missed and caused to QP leaks.

Let's call to destroy for all flows.

Fixes: 0e0ec7e0638e ('RDMA/core: Export ib_open_qp() to share XRC...')
Signed-off-by: Tariq Toukan &lt;tariqt@mellanox.com&gt;
Signed-off-by: Noa Osherovich &lt;noaos@mellanox.com&gt;
Signed-off-by: Leon Romanovsky &lt;leon@kernel.org&gt;
Signed-off-by: Doug Ledford &lt;dledford@redhat.com&gt;
Signed-off-by: Willy Tarreau &lt;w@1wt.eu&gt;
</pre>
</div>
</content>
</entry>
</feed>
