<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-stable.git/drivers/infiniband, branch v3.2.85</title>
<subtitle>Linux kernel stable tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/'/>
<entry>
<title>IB/mlx4: Fix create CQ error flow</title>
<updated>2017-02-23T03:51:00+00:00</updated>
<author>
<name>Matan Barak</name>
<email>matanb@mellanox.com</email>
</author>
<published>2016-11-10T09:30:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=84907cb3cc8846bc5e07b18e26e5ee49568d0aeb'/>
<id>84907cb3cc8846bc5e07b18e26e5ee49568d0aeb</id>
<content type='text'>
commit 593ff73bcfdc79f79a8a0df55504f75ad3e5d1a9 upstream.

Currently, if ib_copy_to_udata fails, the CQ
won't be deleted from the radix tree and the HW (HW2SW).

Fixes: 225c7b1feef1 ('IB/mlx4: Add a driver Mellanox ConnectX InfiniBand adapters')
Signed-off-by: Matan Barak &lt;matanb@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: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 593ff73bcfdc79f79a8a0df55504f75ad3e5d1a9 upstream.

Currently, if ib_copy_to_udata fails, the CQ
won't be deleted from the radix tree and the HW (HW2SW).

Fixes: 225c7b1feef1 ('IB/mlx4: Add a driver Mellanox ConnectX InfiniBand adapters')
Signed-off-by: Matan Barak &lt;matanb@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: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>IB/uverbs: Fix leak of XRC target QPs</title>
<updated>2017-02-23T03:51:00+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=c24d23cd017402dbb0c785bcaff94f2d613ffd23'/>
<id>c24d23cd017402dbb0c785bcaff94f2d613ffd23</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: Ben Hutchings &lt;ben@decadent.org.uk&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: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>IB/ipoib: Don't allow MC joins during light MC flush</title>
<updated>2016-11-20T01:01:41+00:00</updated>
<author>
<name>Alex Vesker</name>
<email>valex@mellanox.com</email>
</author>
<published>2016-09-12T06:55:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=a289c65ca49d2680a3d797e633e57a45573d1df2'/>
<id>a289c65ca49d2680a3d797e633e57a45573d1df2</id>
<content type='text'>
commit 344bacca8cd811809fc33a249f2738ab757d327f upstream.

This fix solves a race between light flush and on the fly joins.
Light flush doesn't set the device to down and unset IPOIB_OPER_UP
flag, this means that if while flushing we have a MC join in progress
and the QP was attached to BC MGID we can have a mismatches when
re-attaching a QP to the BC MGID.

The light flush would set the broadcast group to NULL causing an on
the fly join to rejoin and reattach to the BC MCG as well as adding
the BC MGID to the multicast list. The flush process would later on
remove the BC MGID and detach it from the QP. On the next flush
the BC MGID is present in the multicast list but not found when trying
to detach it because of the previous double attach and single detach.

[18332.714265] ------------[ cut here ]------------
[18332.717775] WARNING: CPU: 6 PID: 3767 at drivers/infiniband/core/verbs.c:280 ib_dealloc_pd+0xff/0x120 [ib_core]
...
[18332.775198] Hardware name: Red Hat KVM, BIOS Bochs 01/01/2011
[18332.779411]  0000000000000000 ffff8800b50dfbb0 ffffffff813fed47 0000000000000000
[18332.784960]  0000000000000000 ffff8800b50dfbf0 ffffffff8109add1 0000011832f58300
[18332.790547]  ffff880226a596c0 ffff880032482000 ffff880032482830 ffff880226a59280
[18332.796199] Call Trace:
[18332.798015]  [&lt;ffffffff813fed47&gt;] dump_stack+0x63/0x8c
[18332.801831]  [&lt;ffffffff8109add1&gt;] __warn+0xd1/0xf0
[18332.805403]  [&lt;ffffffff8109aebd&gt;] warn_slowpath_null+0x1d/0x20
[18332.809706]  [&lt;ffffffffa025d90f&gt;] ib_dealloc_pd+0xff/0x120 [ib_core]
[18332.814384]  [&lt;ffffffffa04f3d7c&gt;] ipoib_transport_dev_cleanup+0xfc/0x1d0 [ib_ipoib]
[18332.820031]  [&lt;ffffffffa04ed648&gt;] ipoib_ib_dev_cleanup+0x98/0x110 [ib_ipoib]
[18332.825220]  [&lt;ffffffffa04e62c8&gt;] ipoib_dev_cleanup+0x2d8/0x550 [ib_ipoib]
[18332.830290]  [&lt;ffffffffa04e656f&gt;] ipoib_uninit+0x2f/0x40 [ib_ipoib]
[18332.834911]  [&lt;ffffffff81772a8a&gt;] rollback_registered_many+0x1aa/0x2c0
[18332.839741]  [&lt;ffffffff81772bd1&gt;] rollback_registered+0x31/0x40
[18332.844091]  [&lt;ffffffff81773b18&gt;] unregister_netdevice_queue+0x48/0x80
[18332.848880]  [&lt;ffffffffa04f489b&gt;] ipoib_vlan_delete+0x1fb/0x290 [ib_ipoib]
[18332.853848]  [&lt;ffffffffa04df1cd&gt;] delete_child+0x7d/0xf0 [ib_ipoib]
[18332.858474]  [&lt;ffffffff81520c08&gt;] dev_attr_store+0x18/0x30
[18332.862510]  [&lt;ffffffff8127fe4a&gt;] sysfs_kf_write+0x3a/0x50
[18332.866349]  [&lt;ffffffff8127f4e0&gt;] kernfs_fop_write+0x120/0x170
[18332.870471]  [&lt;ffffffff81207198&gt;] __vfs_write+0x28/0xe0
[18332.874152]  [&lt;ffffffff810e09bf&gt;] ? percpu_down_read+0x1f/0x50
[18332.878274]  [&lt;ffffffff81208062&gt;] vfs_write+0xa2/0x1a0
[18332.881896]  [&lt;ffffffff812093a6&gt;] SyS_write+0x46/0xa0
[18332.885632]  [&lt;ffffffff810039b7&gt;] do_syscall_64+0x57/0xb0
[18332.889709]  [&lt;ffffffff81883321&gt;] entry_SYSCALL64_slow_path+0x25/0x25
[18332.894727] ---[ end trace 09ebbe31f831ef17 ]---

Fixes: ee1e2c82c245 ("IPoIB: Refresh paths instead of flushing them on SM change events")
Signed-off-by: Alex Vesker &lt;valex@mellanox.com&gt;
Signed-off-by: Leon Romanovsky &lt;leon@kernel.org&gt;
Signed-off-by: Doug Ledford &lt;dledford@redhat.com&gt;
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 344bacca8cd811809fc33a249f2738ab757d327f upstream.

This fix solves a race between light flush and on the fly joins.
Light flush doesn't set the device to down and unset IPOIB_OPER_UP
flag, this means that if while flushing we have a MC join in progress
and the QP was attached to BC MGID we can have a mismatches when
re-attaching a QP to the BC MGID.

The light flush would set the broadcast group to NULL causing an on
the fly join to rejoin and reattach to the BC MCG as well as adding
the BC MGID to the multicast list. The flush process would later on
remove the BC MGID and detach it from the QP. On the next flush
the BC MGID is present in the multicast list but not found when trying
to detach it because of the previous double attach and single detach.

[18332.714265] ------------[ cut here ]------------
[18332.717775] WARNING: CPU: 6 PID: 3767 at drivers/infiniband/core/verbs.c:280 ib_dealloc_pd+0xff/0x120 [ib_core]
...
[18332.775198] Hardware name: Red Hat KVM, BIOS Bochs 01/01/2011
[18332.779411]  0000000000000000 ffff8800b50dfbb0 ffffffff813fed47 0000000000000000
[18332.784960]  0000000000000000 ffff8800b50dfbf0 ffffffff8109add1 0000011832f58300
[18332.790547]  ffff880226a596c0 ffff880032482000 ffff880032482830 ffff880226a59280
[18332.796199] Call Trace:
[18332.798015]  [&lt;ffffffff813fed47&gt;] dump_stack+0x63/0x8c
[18332.801831]  [&lt;ffffffff8109add1&gt;] __warn+0xd1/0xf0
[18332.805403]  [&lt;ffffffff8109aebd&gt;] warn_slowpath_null+0x1d/0x20
[18332.809706]  [&lt;ffffffffa025d90f&gt;] ib_dealloc_pd+0xff/0x120 [ib_core]
[18332.814384]  [&lt;ffffffffa04f3d7c&gt;] ipoib_transport_dev_cleanup+0xfc/0x1d0 [ib_ipoib]
[18332.820031]  [&lt;ffffffffa04ed648&gt;] ipoib_ib_dev_cleanup+0x98/0x110 [ib_ipoib]
[18332.825220]  [&lt;ffffffffa04e62c8&gt;] ipoib_dev_cleanup+0x2d8/0x550 [ib_ipoib]
[18332.830290]  [&lt;ffffffffa04e656f&gt;] ipoib_uninit+0x2f/0x40 [ib_ipoib]
[18332.834911]  [&lt;ffffffff81772a8a&gt;] rollback_registered_many+0x1aa/0x2c0
[18332.839741]  [&lt;ffffffff81772bd1&gt;] rollback_registered+0x31/0x40
[18332.844091]  [&lt;ffffffff81773b18&gt;] unregister_netdevice_queue+0x48/0x80
[18332.848880]  [&lt;ffffffffa04f489b&gt;] ipoib_vlan_delete+0x1fb/0x290 [ib_ipoib]
[18332.853848]  [&lt;ffffffffa04df1cd&gt;] delete_child+0x7d/0xf0 [ib_ipoib]
[18332.858474]  [&lt;ffffffff81520c08&gt;] dev_attr_store+0x18/0x30
[18332.862510]  [&lt;ffffffff8127fe4a&gt;] sysfs_kf_write+0x3a/0x50
[18332.866349]  [&lt;ffffffff8127f4e0&gt;] kernfs_fop_write+0x120/0x170
[18332.870471]  [&lt;ffffffff81207198&gt;] __vfs_write+0x28/0xe0
[18332.874152]  [&lt;ffffffff810e09bf&gt;] ? percpu_down_read+0x1f/0x50
[18332.878274]  [&lt;ffffffff81208062&gt;] vfs_write+0xa2/0x1a0
[18332.881896]  [&lt;ffffffff812093a6&gt;] SyS_write+0x46/0xa0
[18332.885632]  [&lt;ffffffff810039b7&gt;] do_syscall_64+0x57/0xb0
[18332.889709]  [&lt;ffffffff81883321&gt;] entry_SYSCALL64_slow_path+0x25/0x25
[18332.894727] ---[ end trace 09ebbe31f831ef17 ]---

Fixes: ee1e2c82c245 ("IPoIB: Refresh paths instead of flushing them on SM change events")
Signed-off-by: Alex Vesker &lt;valex@mellanox.com&gt;
Signed-off-by: Leon Romanovsky &lt;leon@kernel.org&gt;
Signed-off-by: Doug Ledford &lt;dledford@redhat.com&gt;
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>IB/ipoib: Fix memory corruption in ipoib cm mode connect flow</title>
<updated>2016-11-20T01:01:36+00:00</updated>
<author>
<name>Erez Shitrit</name>
<email>erezsh@mellanox.com</email>
</author>
<published>2016-08-28T07:58:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=8391d8964e605454e5da7c248128dac672d80173'/>
<id>8391d8964e605454e5da7c248128dac672d80173</id>
<content type='text'>
commit 546481c2816ea3c061ee9d5658eb48070f69212e upstream.

When a new CM connection is being requested, ipoib driver copies data
from the path pointer in the CM/tx object, the path object might be
invalid at the point and memory corruption will happened later when now
the CM driver will try using that data.

The next scenario demonstrates it:
	neigh_add_path --&gt; ipoib_cm_create_tx --&gt;
	queue_work (pointer to path is in the cm/tx struct)
	#while the work is still in the queue,
	#the port goes down and causes the ipoib_flush_paths:
	ipoib_flush_paths --&gt; path_free --&gt; kfree(path)
	#at this point the work scheduled starts.
	ipoib_cm_tx_start --&gt; copy from the (invalid)path pointer:
	(memcpy(&amp;pathrec, &amp;p-&gt;path-&gt;pathrec, sizeof pathrec);)
	 -&gt; memory corruption.

To fix that the driver now starts the CM/tx connection only if that
specific path exists in the general paths database.
This check is protected with the relevant locks, and uses the gid from
the neigh member in the CM/tx object which is valid according to the ref
count that was taken by the CM/tx.

Fixes: 839fcaba35 ('IPoIB: Connected mode experimental support')
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;
[bwh: Backported to 3.2: s/neigh-&gt;daddr/neigh-&gt;neighbour-&gt;ha/]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 546481c2816ea3c061ee9d5658eb48070f69212e upstream.

When a new CM connection is being requested, ipoib driver copies data
from the path pointer in the CM/tx object, the path object might be
invalid at the point and memory corruption will happened later when now
the CM driver will try using that data.

The next scenario demonstrates it:
	neigh_add_path --&gt; ipoib_cm_create_tx --&gt;
	queue_work (pointer to path is in the cm/tx struct)
	#while the work is still in the queue,
	#the port goes down and causes the ipoib_flush_paths:
	ipoib_flush_paths --&gt; path_free --&gt; kfree(path)
	#at this point the work scheduled starts.
	ipoib_cm_tx_start --&gt; copy from the (invalid)path pointer:
	(memcpy(&amp;pathrec, &amp;p-&gt;path-&gt;pathrec, sizeof pathrec);)
	 -&gt; memory corruption.

To fix that the driver now starts the CM/tx connection only if that
specific path exists in the general paths database.
This check is protected with the relevant locks, and uses the gid from
the neigh member in the CM/tx object which is valid according to the ref
count that was taken by the CM/tx.

Fixes: 839fcaba35 ('IPoIB: Connected mode experimental support')
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;
[bwh: Backported to 3.2: s/neigh-&gt;daddr/neigh-&gt;neighbour-&gt;ha/]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>IB/core: Fix use after free in send_leave function</title>
<updated>2016-11-20T01:01:36+00:00</updated>
<author>
<name>Erez Shitrit</name>
<email>erezsh@mellanox.com</email>
</author>
<published>2016-08-28T07:58:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=59079b3ffccd4844a1e866cdf5076d0b38b520f5'/>
<id>59079b3ffccd4844a1e866cdf5076d0b38b520f5</id>
<content type='text'>
commit 68c6bcdd8bd00394c234b915ab9b97c74104130c upstream.

The function send_leave sets the member: group-&gt;query_id
(group-&gt;query_id = ret) after calling the sa_query, but leave_handler
can be executed before the setting and it might delete the group object,
and will get a memory corruption.

Additionally, this patch gets rid of group-&gt;query_id variable which is
not used.

Fixes: faec2f7b96b5 ('IB/sa: Track multicast join/leave requests')
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: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 68c6bcdd8bd00394c234b915ab9b97c74104130c upstream.

The function send_leave sets the member: group-&gt;query_id
(group-&gt;query_id = ret) after calling the sa_query, but leave_handler
can be executed before the setting and it might delete the group object,
and will get a memory corruption.

Additionally, this patch gets rid of group-&gt;query_id variable which is
not used.

Fixes: faec2f7b96b5 ('IB/sa: Track multicast join/leave requests')
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: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>IB/mlx4: Fix the SQ size of an RC QP</title>
<updated>2016-08-22T21:37:16+00:00</updated>
<author>
<name>Yishai Hadas</name>
<email>yishaih@mellanox.com</email>
</author>
<published>2016-06-22T14:27:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=c68f2be6350f4a10c7761eec3ca30b18ff9ff35e'/>
<id>c68f2be6350f4a10c7761eec3ca30b18ff9ff35e</id>
<content type='text'>
commit f2940e2c76bb554a7fbdd28ca5b90904117a9e96 upstream.

When calculating the required size of an RC QP send queue, leave
enough space for masked atomic operations, which require more space than
"regular" atomic operation.

Fixes: 6fa8f719844b ("IB/mlx4: Add support for masked atomic operations")
Signed-off-by: Yishai Hadas &lt;yishaih@mellanox.com&gt;
Reviewed-by: Jack Morgenstein &lt;jackm@mellanox.co.il&gt;
Reviewed-by: Eran Ben Elisha &lt;eranbe@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: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit f2940e2c76bb554a7fbdd28ca5b90904117a9e96 upstream.

When calculating the required size of an RC QP send queue, leave
enough space for masked atomic operations, which require more space than
"regular" atomic operation.

Fixes: 6fa8f719844b ("IB/mlx4: Add support for masked atomic operations")
Signed-off-by: Yishai Hadas &lt;yishaih@mellanox.com&gt;
Reviewed-by: Jack Morgenstein &lt;jackm@mellanox.co.il&gt;
Reviewed-by: Eran Ben Elisha &lt;eranbe@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: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>IB/mlx4: Properly initialize GRH TClass and FlowLabel in AHs</title>
<updated>2016-08-22T21:37:15+00:00</updated>
<author>
<name>Jason Gunthorpe</name>
<email>jgunthorpe@obsidianresearch.com</email>
</author>
<published>2016-06-08T23:28:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=807e8c8101d068fe51e635243104933ae4beb458'/>
<id>807e8c8101d068fe51e635243104933ae4beb458</id>
<content type='text'>
commit 8c5122e45a10a9262f872b53f151a592e870f905 upstream.

When this code was reworked for IBoE support the order of assignments
for the sl_tclass_flowlabel got flipped around resulting in
TClass &amp; FlowLabel being permanently set to 0 in the packet headers.

This breaks IB routers that rely on these headers, but only affects
kernel users - libmlx4 does this properly for user space.

Fixes: fa417f7b520e ("IB/mlx4: Add support for IBoE")
Signed-off-by: Jason Gunthorpe &lt;jgunthorpe@obsidianresearch.com&gt;
Signed-off-by: Doug Ledford &lt;dledford@redhat.com&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 8c5122e45a10a9262f872b53f151a592e870f905 upstream.

When this code was reworked for IBoE support the order of assignments
for the sl_tclass_flowlabel got flipped around resulting in
TClass &amp; FlowLabel being permanently set to 0 in the packet headers.

This breaks IB routers that rely on these headers, but only affects
kernel users - libmlx4 does this properly for user space.

Fixes: fa417f7b520e ("IB/mlx4: Add support for IBoE")
Signed-off-by: Jason Gunthorpe &lt;jgunthorpe@obsidianresearch.com&gt;
Signed-off-by: Doug Ledford &lt;dledford@redhat.com&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>RDMA/cxgb3: device driver frees DMA memory with different size</title>
<updated>2016-08-22T21:37:12+00:00</updated>
<author>
<name>Honggang Li</name>
<email>honli@redhat.com</email>
</author>
<published>2016-05-23T00:32:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=5dcc3d8f2ad997c87973665dd143809be4f84076'/>
<id>5dcc3d8f2ad997c87973665dd143809be4f84076</id>
<content type='text'>
commit 0de4cbb3dddca35ecd06b95918f38439c9c6401f upstream.

[  598.852037] ------------[ cut here ]------------
[  598.856698] WARNING: at lib/dma-debug.c:887 check_unmap+0xf8/0x920()
[  598.863079] cxgb3 0000:01:00.0: DMA-API: device driver frees DMA memory with different size [device address=0x0000000003310000] [map size=17 bytes] [unmap size=16 bytes]
[  598.878265] Modules linked in: xprtrdma ib_isert iscsi_target_mod ib_iser libiscsi scsi_transport_iscsi ib_srpt target_core_mod ib_srp scsi_transport_srp scsi_tgt ib_ipoib rdma_ucm ib_ucm ib_uverbs ib_umad rdma_cm ib_cm iw_cm ib_sa ib_mad kvm_amd kvm ipmi_devintf ipmi_ssif dcdbas pcspkr ipmi_si sg ipmi_msghandler acpi_power_meter amd64_edac_mod shpchp edac_core sp5100_tco k10temp edac_mce_amd i2c_piix4 acpi_cpufreq nfsd auth_rpcgss nfs_acl lockd grace sunrpc ip_tables xfs libcrc32c sd_mod crc_t10dif crct10dif_generic crct10dif_common ata_generic iw_cxgb3 pata_acpi ib_core ib_addr mgag200 syscopyarea sysfillrect sysimgblt i2c_algo_bit drm_kms_helper ttm pata_atiixp drm ahci libahci serio_raw i2c_core cxgb3 libata bnx2 mdio dm_mirror dm_region_hash dm_log dm_mod
[  598.946822] CPU: 3 PID: 11820 Comm: cmtime Not tainted 3.10.0-327.el7.x86_64.debug #1
[  598.954681] Hardware name: Dell Inc. PowerEdge R415/0GXH08, BIOS 2.0.2 10/22/2012
[  598.962193]  ffff8808077479a8 000000000381a432 ffff880807747960 ffffffff81700918
[  598.969663]  ffff880807747998 ffffffff8108b6c0 ffff880807747a80 ffff8808063f55c0
[  598.977132]  ffffffff833ca850 0000000000000282 ffff88080b1bb800 ffff880807747a00
[  598.984602] Call Trace:
[  598.987062]  [&lt;ffffffff81700918&gt;] dump_stack+0x19/0x1b
[  598.992224]  [&lt;ffffffff8108b6c0&gt;] warn_slowpath_common+0x70/0xb0
[  598.998254]  [&lt;ffffffff8108b75c&gt;] warn_slowpath_fmt+0x5c/0x80
[  599.004033]  [&lt;ffffffff813903b8&gt;] check_unmap+0xf8/0x920
[  599.009369]  [&lt;ffffffff81025959&gt;] ? sched_clock+0x9/0x10
[  599.014702]  [&lt;ffffffff81390cee&gt;] debug_dma_free_coherent+0x7e/0xa0
[  599.021008]  [&lt;ffffffffa01ece2c&gt;] cxio_destroy_cq+0xcc/0x160 [iw_cxgb3]
[  599.027654]  [&lt;ffffffffa01e8da0&gt;] iwch_destroy_cq+0xf0/0x140 [iw_cxgb3]
[  599.034307]  [&lt;ffffffffa01c4bfe&gt;] ib_destroy_cq+0x1e/0x30 [ib_core]
[  599.040601]  [&lt;ffffffffa04ff2d2&gt;] ib_uverbs_close+0x302/0x4d0 [ib_uverbs]
[  599.047417]  [&lt;ffffffff812335a2&gt;] __fput+0x102/0x310
[  599.052401]  [&lt;ffffffff8123388e&gt;] ____fput+0xe/0x10
[  599.057297]  [&lt;ffffffff810bbde4&gt;] task_work_run+0xb4/0xe0
[  599.062719]  [&lt;ffffffff81092a84&gt;] do_exit+0x304/0xc60
[  599.067789]  [&lt;ffffffff81025905&gt;] ? native_sched_clock+0x35/0x80
[  599.073820]  [&lt;ffffffff81025959&gt;] ? sched_clock+0x9/0x10
[  599.079153]  [&lt;ffffffff8170a49c&gt;] ? _raw_spin_unlock_irq+0x2c/0x50
[  599.085358]  [&lt;ffffffff8109346c&gt;] do_group_exit+0x4c/0xc0
[  599.090779]  [&lt;ffffffff810a8661&gt;] get_signal_to_deliver+0x2e1/0x960
[  599.097071]  [&lt;ffffffff8101c497&gt;] do_signal+0x57/0x6e0
[  599.102229]  [&lt;ffffffff81714bd1&gt;] ? sysret_signal+0x5/0x4e
[  599.107738]  [&lt;ffffffff8101cb7f&gt;] do_notify_resume+0x5f/0xb0
[  599.113418]  [&lt;ffffffff81714e7d&gt;] int_signal+0x12/0x17
[  599.118576] ---[ end trace 1e4653102e7e7019 ]---
[  599.123211] Mapped at:
[  599.125577]  [&lt;ffffffff8138ed8b&gt;] debug_dma_alloc_coherent+0x2b/0x80
[  599.131968]  [&lt;ffffffffa01ec862&gt;] cxio_create_cq+0xf2/0x1f0 [iw_cxgb3]
[  599.139920]  [&lt;ffffffffa01e9c05&gt;] iwch_create_cq+0x105/0x4e0 [iw_cxgb3]
[  599.147895]  [&lt;ffffffffa0500584&gt;] create_cq.constprop.14+0x184/0x2e0 [ib_uverbs]
[  599.156649]  [&lt;ffffffffa05027fb&gt;] ib_uverbs_create_cq+0x10b/0x140 [ib_uverbs]

Fixes: b955150ea784 ('RDMA/cxgb3: When a user QP is marked in error, also mark the CQs in error')
Signed-off-by: Honggang Li &lt;honli@redhat.com&gt;
Reviewed-by: Leon Romanovsky &lt;leonro@mellanox.com&gt;
Reviewed-by: Steve Wise &lt;swise@opengridcomputing.com&gt;
Signed-off-by: Doug Ledford &lt;dledford@redhat.com&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 0de4cbb3dddca35ecd06b95918f38439c9c6401f upstream.

[  598.852037] ------------[ cut here ]------------
[  598.856698] WARNING: at lib/dma-debug.c:887 check_unmap+0xf8/0x920()
[  598.863079] cxgb3 0000:01:00.0: DMA-API: device driver frees DMA memory with different size [device address=0x0000000003310000] [map size=17 bytes] [unmap size=16 bytes]
[  598.878265] Modules linked in: xprtrdma ib_isert iscsi_target_mod ib_iser libiscsi scsi_transport_iscsi ib_srpt target_core_mod ib_srp scsi_transport_srp scsi_tgt ib_ipoib rdma_ucm ib_ucm ib_uverbs ib_umad rdma_cm ib_cm iw_cm ib_sa ib_mad kvm_amd kvm ipmi_devintf ipmi_ssif dcdbas pcspkr ipmi_si sg ipmi_msghandler acpi_power_meter amd64_edac_mod shpchp edac_core sp5100_tco k10temp edac_mce_amd i2c_piix4 acpi_cpufreq nfsd auth_rpcgss nfs_acl lockd grace sunrpc ip_tables xfs libcrc32c sd_mod crc_t10dif crct10dif_generic crct10dif_common ata_generic iw_cxgb3 pata_acpi ib_core ib_addr mgag200 syscopyarea sysfillrect sysimgblt i2c_algo_bit drm_kms_helper ttm pata_atiixp drm ahci libahci serio_raw i2c_core cxgb3 libata bnx2 mdio dm_mirror dm_region_hash dm_log dm_mod
[  598.946822] CPU: 3 PID: 11820 Comm: cmtime Not tainted 3.10.0-327.el7.x86_64.debug #1
[  598.954681] Hardware name: Dell Inc. PowerEdge R415/0GXH08, BIOS 2.0.2 10/22/2012
[  598.962193]  ffff8808077479a8 000000000381a432 ffff880807747960 ffffffff81700918
[  598.969663]  ffff880807747998 ffffffff8108b6c0 ffff880807747a80 ffff8808063f55c0
[  598.977132]  ffffffff833ca850 0000000000000282 ffff88080b1bb800 ffff880807747a00
[  598.984602] Call Trace:
[  598.987062]  [&lt;ffffffff81700918&gt;] dump_stack+0x19/0x1b
[  598.992224]  [&lt;ffffffff8108b6c0&gt;] warn_slowpath_common+0x70/0xb0
[  598.998254]  [&lt;ffffffff8108b75c&gt;] warn_slowpath_fmt+0x5c/0x80
[  599.004033]  [&lt;ffffffff813903b8&gt;] check_unmap+0xf8/0x920
[  599.009369]  [&lt;ffffffff81025959&gt;] ? sched_clock+0x9/0x10
[  599.014702]  [&lt;ffffffff81390cee&gt;] debug_dma_free_coherent+0x7e/0xa0
[  599.021008]  [&lt;ffffffffa01ece2c&gt;] cxio_destroy_cq+0xcc/0x160 [iw_cxgb3]
[  599.027654]  [&lt;ffffffffa01e8da0&gt;] iwch_destroy_cq+0xf0/0x140 [iw_cxgb3]
[  599.034307]  [&lt;ffffffffa01c4bfe&gt;] ib_destroy_cq+0x1e/0x30 [ib_core]
[  599.040601]  [&lt;ffffffffa04ff2d2&gt;] ib_uverbs_close+0x302/0x4d0 [ib_uverbs]
[  599.047417]  [&lt;ffffffff812335a2&gt;] __fput+0x102/0x310
[  599.052401]  [&lt;ffffffff8123388e&gt;] ____fput+0xe/0x10
[  599.057297]  [&lt;ffffffff810bbde4&gt;] task_work_run+0xb4/0xe0
[  599.062719]  [&lt;ffffffff81092a84&gt;] do_exit+0x304/0xc60
[  599.067789]  [&lt;ffffffff81025905&gt;] ? native_sched_clock+0x35/0x80
[  599.073820]  [&lt;ffffffff81025959&gt;] ? sched_clock+0x9/0x10
[  599.079153]  [&lt;ffffffff8170a49c&gt;] ? _raw_spin_unlock_irq+0x2c/0x50
[  599.085358]  [&lt;ffffffff8109346c&gt;] do_group_exit+0x4c/0xc0
[  599.090779]  [&lt;ffffffff810a8661&gt;] get_signal_to_deliver+0x2e1/0x960
[  599.097071]  [&lt;ffffffff8101c497&gt;] do_signal+0x57/0x6e0
[  599.102229]  [&lt;ffffffff81714bd1&gt;] ? sysret_signal+0x5/0x4e
[  599.107738]  [&lt;ffffffff8101cb7f&gt;] do_notify_resume+0x5f/0xb0
[  599.113418]  [&lt;ffffffff81714e7d&gt;] int_signal+0x12/0x17
[  599.118576] ---[ end trace 1e4653102e7e7019 ]---
[  599.123211] Mapped at:
[  599.125577]  [&lt;ffffffff8138ed8b&gt;] debug_dma_alloc_coherent+0x2b/0x80
[  599.131968]  [&lt;ffffffffa01ec862&gt;] cxio_create_cq+0xf2/0x1f0 [iw_cxgb3]
[  599.139920]  [&lt;ffffffffa01e9c05&gt;] iwch_create_cq+0x105/0x4e0 [iw_cxgb3]
[  599.147895]  [&lt;ffffffffa0500584&gt;] create_cq.constprop.14+0x184/0x2e0 [ib_uverbs]
[  599.156649]  [&lt;ffffffffa05027fb&gt;] ib_uverbs_create_cq+0x10b/0x140 [ib_uverbs]

Fixes: b955150ea784 ('RDMA/cxgb3: When a user QP is marked in error, also mark the CQs in error')
Signed-off-by: Honggang Li &lt;honli@redhat.com&gt;
Reviewed-by: Leon Romanovsky &lt;leonro@mellanox.com&gt;
Reviewed-by: Steve Wise &lt;swise@opengridcomputing.com&gt;
Signed-off-by: Doug Ledford &lt;dledford@redhat.com&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>IB/security: Restrict use of the write() interface</title>
<updated>2016-06-15T20:28:13+00:00</updated>
<author>
<name>Jason Gunthorpe</name>
<email>jgunthorpe@obsidianresearch.com</email>
</author>
<published>2016-04-11T01:13:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=7cd419255d03561d98c94fad1a027a539c4a7484'/>
<id>7cd419255d03561d98c94fad1a027a539c4a7484</id>
<content type='text'>
commit e6bd18f57aad1a2d1ef40e646d03ed0f2515c9e3 upstream.

The drivers/infiniband stack uses write() as a replacement for
bi-directional ioctl().  This is not safe. There are ways to
trigger write calls that result in the return structure that
is normally written to user space being shunted off to user
specified kernel memory instead.

For the immediate repair, detect and deny suspicious accesses to
the write API.

For long term, update the user space libraries and the kernel API
to something that doesn't present the same security vulnerabilities
(likely a structured ioctl() interface).

The impacted uAPI interfaces are generally only available if
hardware from drivers/infiniband is installed in the system.

Reported-by: Jann Horn &lt;jann@thejh.net&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Jason Gunthorpe &lt;jgunthorpe@obsidianresearch.com&gt;
[ Expanded check to all known write() entry points ]
Signed-off-by: Doug Ledford &lt;dledford@redhat.com&gt;
[bwh: Backported to 3.2:
 - Drop changes to hfi1
 - include/rdma/ib.h didn't exist, so create it with the usual header guard
   and include it in drivers/infiniband/core/ucma.c
 - ipath_write() has the same problem, so add the same restriction there]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit e6bd18f57aad1a2d1ef40e646d03ed0f2515c9e3 upstream.

The drivers/infiniband stack uses write() as a replacement for
bi-directional ioctl().  This is not safe. There are ways to
trigger write calls that result in the return structure that
is normally written to user space being shunted off to user
specified kernel memory instead.

For the immediate repair, detect and deny suspicious accesses to
the write API.

For long term, update the user space libraries and the kernel API
to something that doesn't present the same security vulnerabilities
(likely a structured ioctl() interface).

The impacted uAPI interfaces are generally only available if
hardware from drivers/infiniband is installed in the system.

Reported-by: Jann Horn &lt;jann@thejh.net&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Jason Gunthorpe &lt;jgunthorpe@obsidianresearch.com&gt;
[ Expanded check to all known write() entry points ]
Signed-off-by: Doug Ledford &lt;dledford@redhat.com&gt;
[bwh: Backported to 3.2:
 - Drop changes to hfi1
 - include/rdma/ib.h didn't exist, so create it with the usual header guard
   and include it in drivers/infiniband/core/ucma.c
 - ipath_write() has the same problem, so add the same restriction there]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>IB/core: Use GRH when the path hop-limit &gt; 0</title>
<updated>2016-04-01T00:54:36+00:00</updated>
<author>
<name>Or Gerlitz</name>
<email>ogerlitz@mellanox.com</email>
</author>
<published>2016-03-01T16:52:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=a1663179bb1707a285258870914536a64cc1c90a'/>
<id>a1663179bb1707a285258870914536a64cc1c90a</id>
<content type='text'>
commit 11d8d645343efba0c975aefe7c2cf3b33c836c75 upstream.

According to IBTA spec v1.3 section 12.7.19, QPs should use GRH when
the path returned by the SA has hop-limit &gt; 0. Currently, we do that
only for the &gt; 1 case, fix that.

Fixes: 6d969a471ba1 ('IB/sa: Add ib_init_ah_from_path()')
Signed-off-by: Or Gerlitz &lt;ogerlitz@mellanox.com&gt;
Reviewed-by: Jason Gunthorpe &lt;jgunthorpe@obsidianresearch.com&gt;
Signed-off-by: Doug Ledford &lt;dledford@redhat.com&gt;
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 11d8d645343efba0c975aefe7c2cf3b33c836c75 upstream.

According to IBTA spec v1.3 section 12.7.19, QPs should use GRH when
the path returned by the SA has hop-limit &gt; 0. Currently, we do that
only for the &gt; 1 case, fix that.

Fixes: 6d969a471ba1 ('IB/sa: Add ib_init_ah_from_path()')
Signed-off-by: Or Gerlitz &lt;ogerlitz@mellanox.com&gt;
Reviewed-by: Jason Gunthorpe &lt;jgunthorpe@obsidianresearch.com&gt;
Signed-off-by: Doug Ledford &lt;dledford@redhat.com&gt;
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</pre>
</div>
</content>
</entry>
</feed>
