<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux.git/drivers/infiniband/core, branch v4.4.24</title>
<subtitle>Clone of https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git</subtitle>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/'/>
<entry>
<title>IB/core: Fix use after free in send_leave function</title>
<updated>2016-10-07T13:23:46+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.exis.tech/linux.git/commit/?id=23bd03de926aacbea149e3bab29f05132885177c'/>
<id>23bd03de926aacbea149e3bab29f05132885177c</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: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&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: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>IB/uverbs: Fix race between uverbs_close and remove_one</title>
<updated>2016-09-24T08:07:37+00:00</updated>
<author>
<name>Jason Gunthorpe</name>
<email>jgunthorpe@obsidianresearch.com</email>
</author>
<published>2016-07-03T12:28:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=abe5aabf5c46788320bc3c74f888ef48f0cc1e2a'/>
<id>abe5aabf5c46788320bc3c74f888ef48f0cc1e2a</id>
<content type='text'>
commit d1e09f304a1d9651c5059ebfeb696dc2effc9b32 upstream.

Fixes an oops that might happen if uverbs_close races with
remove_one.

Both contexts may run ib_uverbs_cleanup_ucontext, it depends
on the flow.

Currently, there is no protection for a case that remove_one
didn't make the cleanup it runs to its end, the underlying
ib_device was freed then uverbs_close will call
ib_uverbs_cleanup_ucontext and OOPs.

Above might happen if uverbs_close deleted the file from the list
then remove_one didn't find it and runs to its end.

Fixes to protect against that case by a new cleanup lock so that
ib_uverbs_cleanup_ucontext will be called always before that
remove_one is ended.

Fixes: 35d4a0b63dc0 ("IB/uverbs: Fix race between ib_uverbs_open and remove_one")
Reported-by: Devesh Sharma &lt;devesh.sharma@broadcom.com&gt;
Signed-off-by: Jason Gunthorpe &lt;jgunthorpe@obsidianresearch.com&gt;
Signed-off-by: Yishai Hadas &lt;yishaih@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: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit d1e09f304a1d9651c5059ebfeb696dc2effc9b32 upstream.

Fixes an oops that might happen if uverbs_close races with
remove_one.

Both contexts may run ib_uverbs_cleanup_ucontext, it depends
on the flow.

Currently, there is no protection for a case that remove_one
didn't make the cleanup it runs to its end, the underlying
ib_device was freed then uverbs_close will call
ib_uverbs_cleanup_ucontext and OOPs.

Above might happen if uverbs_close deleted the file from the list
then remove_one didn't find it and runs to its end.

Fixes to protect against that case by a new cleanup lock so that
ib_uverbs_cleanup_ucontext will be called always before that
remove_one is ended.

Fixes: 35d4a0b63dc0 ("IB/uverbs: Fix race between ib_uverbs_open and remove_one")
Reported-by: Devesh Sharma &lt;devesh.sharma@broadcom.com&gt;
Signed-off-by: Jason Gunthorpe &lt;jgunthorpe@obsidianresearch.com&gt;
Signed-off-by: Yishai Hadas &lt;yishaih@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: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>IB/IWPM: Fix a potential skb leak</title>
<updated>2016-08-20T16:09:25+00:00</updated>
<author>
<name>Mark Bloch</name>
<email>markb@mellanox.com</email>
</author>
<published>2016-05-06T19:45:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=1d13a91a689fc8b7f6bdbc00adc5322dc9e338d0'/>
<id>1d13a91a689fc8b7f6bdbc00adc5322dc9e338d0</id>
<content type='text'>
commit 5ed935e861a4cbf2158ad3386d6d26edd60d2658 upstream.

In case ibnl_put_msg fails in send_nlmsg_done,
the function returns with -ENOMEM without freeing.

This patch fixes this behavior.

Fixes: 30dc5e63d6a5 ("RDMA/core: Add support for iWARP Port Mapper user space service")
Signed-off-by: Mark Bloch &lt;markb@mellanox.com&gt;
Reviewed-by: Leon Romanovsky &lt;leonro@mellanox.com&gt;
Signed-off-by: Leon Romanovsky &lt;leon@kernel.org&gt;
Reviewed-by: Steve Wise &lt;swise@opengridcomputing.com&gt;
Signed-off-by: Doug Ledford &lt;dledford@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 5ed935e861a4cbf2158ad3386d6d26edd60d2658 upstream.

In case ibnl_put_msg fails in send_nlmsg_done,
the function returns with -ENOMEM without freeing.

This patch fixes this behavior.

Fixes: 30dc5e63d6a5 ("RDMA/core: Add support for iWARP Port Mapper user space service")
Signed-off-by: Mark Bloch &lt;markb@mellanox.com&gt;
Reviewed-by: Leon Romanovsky &lt;leonro@mellanox.com&gt;
Signed-off-by: Leon Romanovsky &lt;leon@kernel.org&gt;
Reviewed-by: Steve Wise &lt;swise@opengridcomputing.com&gt;
Signed-off-by: Doug Ledford &lt;dledford@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>IB/SA: Use correct free function</title>
<updated>2016-08-20T16:09:25+00:00</updated>
<author>
<name>Mark Bloch</name>
<email>markb@mellanox.com</email>
</author>
<published>2016-05-06T19:45:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=041a8254284b766ba90425b1576f86f72b7dfbf2'/>
<id>041a8254284b766ba90425b1576f86f72b7dfbf2</id>
<content type='text'>
commit 0f377d86252d11bfea941852785e3094b93601a7 upstream.

Fixes a direct call to kfree_skb when nlmsg_free should be used.

Fixes: 2ca546b92a02 ('IB/sa: Route SA pathrecord query through netlink')
Signed-off-by: Mark Bloch &lt;markb@mellanox.com&gt;
Reviewed-by: Leon Romanovsky &lt;leonro@mellanox.com&gt;
Signed-off-by: Leon Romanovsky &lt;leon@kernel.org&gt;
Reviewed-by: Ira Weiny &lt;ira.weiny@intel.com&gt;
Reviewed-by: Steve Wise &lt;swise@opengridcomputing.com&gt;
Signed-off-by: Doug Ledford &lt;dledford@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 0f377d86252d11bfea941852785e3094b93601a7 upstream.

Fixes a direct call to kfree_skb when nlmsg_free should be used.

Fixes: 2ca546b92a02 ('IB/sa: Route SA pathrecord query through netlink')
Signed-off-by: Mark Bloch &lt;markb@mellanox.com&gt;
Reviewed-by: Leon Romanovsky &lt;leonro@mellanox.com&gt;
Signed-off-by: Leon Romanovsky &lt;leon@kernel.org&gt;
Reviewed-by: Ira Weiny &lt;ira.weiny@intel.com&gt;
Reviewed-by: Steve Wise &lt;swise@opengridcomputing.com&gt;
Signed-off-by: Doug Ledford &lt;dledford@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>IB/cm: Fix a recently introduced locking bug</title>
<updated>2016-07-27T16:47:27+00:00</updated>
<author>
<name>Bart Van Assche</name>
<email>bart.vanassche@sandisk.com</email>
</author>
<published>2016-03-25T15:33:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=abb24accf23b932229c52cb7f91e892190e4df01'/>
<id>abb24accf23b932229c52cb7f91e892190e4df01</id>
<content type='text'>
commit 943f44d94aa26bfdcaafc40d3701e24eeb58edce upstream.

ib_cm_notify() can be called from interrupt context. Hence do not
reenable interrupts unconditionally in cm_establish().

This patch avoids that lockdep reports the following warning:

WARNING: CPU: 0 PID: 23317 at kernel/locking/lockdep.c:2624 trace _hardirqs_on_caller+0x112/0x1b0
DEBUG_LOCKS_WARN_ON(current-&gt;hardirq_context)
Call Trace:
 &lt;IRQ&gt;  [&lt;ffffffff812bd0e5&gt;] dump_stack+0x67/0x92
 [&lt;ffffffff81056f21&gt;] __warn+0xc1/0xe0
 [&lt;ffffffff81056f8a&gt;] warn_slowpath_fmt+0x4a/0x50
 [&lt;ffffffff810a5932&gt;] trace_hardirqs_on_caller+0x112/0x1b0
 [&lt;ffffffff810a59dd&gt;] trace_hardirqs_on+0xd/0x10
 [&lt;ffffffff815992c7&gt;] _raw_spin_unlock_irq+0x27/0x40
 [&lt;ffffffffa0382e9c&gt;] ib_cm_notify+0x25c/0x290 [ib_cm]
 [&lt;ffffffffa068fbc1&gt;] srpt_qp_event+0xa1/0xf0 [ib_srpt]
 [&lt;ffffffffa04efb97&gt;] mlx4_ib_qp_event+0x67/0xd0 [mlx4_ib]
 [&lt;ffffffffa034ec0a&gt;] mlx4_qp_event+0x5a/0xc0 [mlx4_core]
 [&lt;ffffffffa03365f8&gt;] mlx4_eq_int+0x3d8/0xcf0 [mlx4_core]
 [&lt;ffffffffa0336f9c&gt;] mlx4_msi_x_interrupt+0xc/0x20 [mlx4_core]
 [&lt;ffffffff810b0914&gt;] handle_irq_event_percpu+0x64/0x100
 [&lt;ffffffff810b09e4&gt;] handle_irq_event+0x34/0x60
 [&lt;ffffffff810b3a6a&gt;] handle_edge_irq+0x6a/0x150
 [&lt;ffffffff8101ad05&gt;] handle_irq+0x15/0x20
 [&lt;ffffffff8101a66c&gt;] do_IRQ+0x5c/0x110
 [&lt;ffffffff8159a2c9&gt;] common_interrupt+0x89/0x89
 [&lt;ffffffff81297a17&gt;] blk_run_queue_async+0x37/0x40
 [&lt;ffffffffa0163e53&gt;] rq_completed+0x43/0x70 [dm_mod]
 [&lt;ffffffffa0164896&gt;] dm_softirq_done+0x176/0x280 [dm_mod]
 [&lt;ffffffff812a26c2&gt;] blk_done_softirq+0x52/0x90
 [&lt;ffffffff8105bc1f&gt;] __do_softirq+0x10f/0x230
 [&lt;ffffffff8105bec8&gt;] irq_exit+0xa8/0xb0
 [&lt;ffffffff8103653e&gt;] smp_trace_call_function_single_interrupt+0x2e/0x30
 [&lt;ffffffff81036549&gt;] smp_call_function_single_interrupt+0x9/0x10
 [&lt;ffffffff8159a959&gt;] call_function_single_interrupt+0x89/0x90
 &lt;EOI&gt;

Fixes: commit be4b499323bf (IB/cm: Do not queue work to a device that's going away)
Signed-off-by: Bart Van Assche &lt;bart.vanassche@sandisk.com&gt;
Cc: Erez Shitrit &lt;erezsh@mellanox.com&gt;
Cc: Sean Hefty &lt;sean.hefty@intel.com&gt;
Cc: Nikolay Borisov &lt;kernel@kyup.com&gt;
Acked-by: Erez Shitrit &lt;erezsh@mellanox.com&gt;
Signed-off-by: Doug Ledford &lt;dledford@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 943f44d94aa26bfdcaafc40d3701e24eeb58edce upstream.

ib_cm_notify() can be called from interrupt context. Hence do not
reenable interrupts unconditionally in cm_establish().

This patch avoids that lockdep reports the following warning:

WARNING: CPU: 0 PID: 23317 at kernel/locking/lockdep.c:2624 trace _hardirqs_on_caller+0x112/0x1b0
DEBUG_LOCKS_WARN_ON(current-&gt;hardirq_context)
Call Trace:
 &lt;IRQ&gt;  [&lt;ffffffff812bd0e5&gt;] dump_stack+0x67/0x92
 [&lt;ffffffff81056f21&gt;] __warn+0xc1/0xe0
 [&lt;ffffffff81056f8a&gt;] warn_slowpath_fmt+0x4a/0x50
 [&lt;ffffffff810a5932&gt;] trace_hardirqs_on_caller+0x112/0x1b0
 [&lt;ffffffff810a59dd&gt;] trace_hardirqs_on+0xd/0x10
 [&lt;ffffffff815992c7&gt;] _raw_spin_unlock_irq+0x27/0x40
 [&lt;ffffffffa0382e9c&gt;] ib_cm_notify+0x25c/0x290 [ib_cm]
 [&lt;ffffffffa068fbc1&gt;] srpt_qp_event+0xa1/0xf0 [ib_srpt]
 [&lt;ffffffffa04efb97&gt;] mlx4_ib_qp_event+0x67/0xd0 [mlx4_ib]
 [&lt;ffffffffa034ec0a&gt;] mlx4_qp_event+0x5a/0xc0 [mlx4_core]
 [&lt;ffffffffa03365f8&gt;] mlx4_eq_int+0x3d8/0xcf0 [mlx4_core]
 [&lt;ffffffffa0336f9c&gt;] mlx4_msi_x_interrupt+0xc/0x20 [mlx4_core]
 [&lt;ffffffff810b0914&gt;] handle_irq_event_percpu+0x64/0x100
 [&lt;ffffffff810b09e4&gt;] handle_irq_event+0x34/0x60
 [&lt;ffffffff810b3a6a&gt;] handle_edge_irq+0x6a/0x150
 [&lt;ffffffff8101ad05&gt;] handle_irq+0x15/0x20
 [&lt;ffffffff8101a66c&gt;] do_IRQ+0x5c/0x110
 [&lt;ffffffff8159a2c9&gt;] common_interrupt+0x89/0x89
 [&lt;ffffffff81297a17&gt;] blk_run_queue_async+0x37/0x40
 [&lt;ffffffffa0163e53&gt;] rq_completed+0x43/0x70 [dm_mod]
 [&lt;ffffffffa0164896&gt;] dm_softirq_done+0x176/0x280 [dm_mod]
 [&lt;ffffffff812a26c2&gt;] blk_done_softirq+0x52/0x90
 [&lt;ffffffff8105bc1f&gt;] __do_softirq+0x10f/0x230
 [&lt;ffffffff8105bec8&gt;] irq_exit+0xa8/0xb0
 [&lt;ffffffff8103653e&gt;] smp_trace_call_function_single_interrupt+0x2e/0x30
 [&lt;ffffffff81036549&gt;] smp_call_function_single_interrupt+0x9/0x10
 [&lt;ffffffff8159a959&gt;] call_function_single_interrupt+0x89/0x90
 &lt;EOI&gt;

Fixes: commit be4b499323bf (IB/cm: Do not queue work to a device that's going away)
Signed-off-by: Bart Van Assche &lt;bart.vanassche@sandisk.com&gt;
Cc: Erez Shitrit &lt;erezsh@mellanox.com&gt;
Cc: Sean Hefty &lt;sean.hefty@intel.com&gt;
Cc: Nikolay Borisov &lt;kernel@kyup.com&gt;
Acked-by: Erez Shitrit &lt;erezsh@mellanox.com&gt;
Signed-off-by: Doug Ledford &lt;dledford@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>IB/security: Restrict use of the write() interface</title>
<updated>2016-05-04T21:48:48+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.exis.tech/linux.git/commit/?id=c92003c18feb8159cbf64bc0afa7b048869fe3c6'/>
<id>c92003c18feb8159cbf64bc0afa7b048869fe3c6</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;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&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;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>IB/cma: Fix RDMA port validation for iWarp</title>
<updated>2016-03-03T23:07:32+00:00</updated>
<author>
<name>Matan Barak</name>
<email>matanb@mellanox.com</email>
</author>
<published>2016-01-07T09:19:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=9315bf18bec590aa0c4be5b54de55da21d31ac96'/>
<id>9315bf18bec590aa0c4be5b54de55da21d31ac96</id>
<content type='text'>
commit 649367735ee5dedb128d9fac0b86ba7e0fe7ae3b upstream.

cma_validate_port wrongly assumed that Ethernet devices are RoCE
devices and thus their ndev should be matched in the GID table.
This broke the iWarp support. Fixing that matching the ndev only if
we work on a RoCE port.

Cc: &lt;stable@vger.kernel.org&gt; # 4.4.x-
Fixes: abae1b71dd37 ('IB/cma: cma_validate_port should verify the port
		     and netdevice')
Reported-by: Hariprasad Shenai &lt;hariprasad@chelsio.com&gt;
Tested-by: Hariprasad Shenai &lt;hariprasad@chelsio.com&gt;
Signed-off-by: Matan Barak &lt;matanb@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: Steve Wise &lt;swise@opengridcomputing.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;


</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 649367735ee5dedb128d9fac0b86ba7e0fe7ae3b upstream.

cma_validate_port wrongly assumed that Ethernet devices are RoCE
devices and thus their ndev should be matched in the GID table.
This broke the iWarp support. Fixing that matching the ndev only if
we work on a RoCE port.

Cc: &lt;stable@vger.kernel.org&gt; # 4.4.x-
Fixes: abae1b71dd37 ('IB/cma: cma_validate_port should verify the port
		     and netdevice')
Reported-by: Hariprasad Shenai &lt;hariprasad@chelsio.com&gt;
Tested-by: Hariprasad Shenai &lt;hariprasad@chelsio.com&gt;
Signed-off-by: Matan Barak &lt;matanb@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: Steve Wise &lt;swise@opengridcomputing.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;


</pre>
</div>
</content>
</entry>
<entry>
<title>IB/cm: Fix a recently introduced deadlock</title>
<updated>2016-03-03T23:07:25+00:00</updated>
<author>
<name>Bart Van Assche</name>
<email>bart.vanassche@sandisk.com</email>
</author>
<published>2016-01-01T12:17:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=e97bff5116d8ba6a25848691063d3370b939a4af'/>
<id>e97bff5116d8ba6a25848691063d3370b939a4af</id>
<content type='text'>
commit 4bfdf635c668869c69fd18ece37ec66fb6f38fcf upstream.

ib_send_cm_drep() calls cm_enter_timewait() while holding a spinlock
that can be locked from inside an interrupt handler. Hence do not
enable interrupts inside cm_enter_timewait() if called with interrupts
disabled.

This patch fixes e.g. the following deadlock:
Acked-by: Erez Shitrit &lt;erezsh@mellanox.com&gt;

=================================
[ INFO: inconsistent lock state ]
4.4.0-rc7+ #1 Tainted: G            E
---------------------------------
inconsistent {HARDIRQ-ON-W} -&gt; {IN-HARDIRQ-W} usage.
swapper/8/0 [HC1[1]:SC0[0]:HE0:SE1] takes:
(&amp;(&amp;cm_id_priv-&gt;lock)-&gt;rlock){?.+...}, at: [&lt;ffffffffa036eec4&gt;] cm_establish+0x
74/0x1b0 [ib_cm]
{HARDIRQ-ON-W} state was registered at:
  [&lt;ffffffff810a3c11&gt;] mark_held_locks+0x71/0x90
  [&lt;ffffffff810a3e87&gt;] trace_hardirqs_on_caller+0xa7/0x1c0
  [&lt;ffffffff810a3fad&gt;] trace_hardirqs_on+0xd/0x10
  [&lt;ffffffff8151c40b&gt;] _raw_spin_unlock_irq+0x2b/0x40
  [&lt;ffffffffa036ea8e&gt;] cm_enter_timewait+0xae/0x100 [ib_cm]
  [&lt;ffffffffa036ff76&gt;] ib_send_cm_drep+0xb6/0x190 [ib_cm]
  [&lt;ffffffffa052ed08&gt;] srp_cm_handler+0x128/0x1a0 [ib_srp]
  [&lt;ffffffffa0370340&gt;] cm_process_work+0x20/0xf0 [ib_cm]
  [&lt;ffffffffa0371335&gt;] cm_dreq_handler+0x135/0x2c0 [ib_cm]
  [&lt;ffffffffa03733c5&gt;] cm_work_handler+0x75/0xd0 [ib_cm]
  [&lt;ffffffff8107184d&gt;] process_one_work+0x1bd/0x460
  [&lt;ffffffff81073148&gt;] worker_thread+0x118/0x420
  [&lt;ffffffff81078454&gt;] kthread+0xe4/0x100
  [&lt;ffffffff8151cbbf&gt;] ret_from_fork+0x3f/0x70
irq event stamp: 1672286
hardirqs last  enabled at (1672283): [&lt;ffffffff81408ec0&gt;] poll_idle+0x10/0x80
hardirqs last disabled at (1672284): [&lt;ffffffff8151d304&gt;] common_interrupt+0x84/0x89
softirqs last  enabled at (1672286): [&lt;ffffffff8105b4dc&gt;] _local_bh_enable+0x1c/0x50
softirqs last disabled at (1672285): [&lt;ffffffff8105b697&gt;] irq_enter+0x47/0x70

other info that might help us debug this:
 Possible unsafe locking scenario:

       CPU0
       ----
  lock(&amp;(&amp;cm_id_priv-&gt;lock)-&gt;rlock);
  &lt;Interrupt&gt;
    lock(&amp;(&amp;cm_id_priv-&gt;lock)-&gt;rlock);

 *** DEADLOCK ***

no locks held by swapper/8/0.

stack backtrace:
CPU: 8 PID: 0 Comm: swapper/8 Tainted: G            E   4.4.0-rc7+ #1
Hardware name: Dell Inc. PowerEdge R430/03XKDV, BIOS 1.0.2 11/17/2014
 ffff88045af5e950 ffff88046e503a88 ffffffff81251c1b 0000000000000007
 0000000000000006 0000000000000003 ffff88045af5ddc0 ffff88046e503ad8
 ffffffff810a32f4 0000000000000000 0000000000000000 0000000000000001
Call Trace:
 &lt;IRQ&gt;  [&lt;ffffffff81251c1b&gt;] dump_stack+0x4f/0x74
 [&lt;ffffffff810a32f4&gt;] print_usage_bug+0x184/0x190
 [&lt;ffffffff810a36e2&gt;] mark_lock_irq+0xf2/0x290
 [&lt;ffffffff810a3995&gt;] mark_lock+0x115/0x1b0
 [&lt;ffffffff810a3b8c&gt;] mark_irqflags+0x15c/0x170
 [&lt;ffffffff810a4fef&gt;] __lock_acquire+0x1ef/0x560
 [&lt;ffffffff810a53c2&gt;] lock_acquire+0x62/0x80
 [&lt;ffffffff8151bd33&gt;] _raw_spin_lock_irqsave+0x43/0x60
 [&lt;ffffffffa036eec4&gt;] cm_establish+0x74/0x1b0 [ib_cm]
 [&lt;ffffffffa036f031&gt;] ib_cm_notify+0x31/0x100 [ib_cm]
 [&lt;ffffffffa0637f24&gt;] srpt_qp_event+0x54/0xd0 [ib_srpt]
 [&lt;ffffffffa0196052&gt;] mlx4_ib_qp_event+0x72/0xc0 [mlx4_ib]
 [&lt;ffffffffa00775b9&gt;] mlx4_qp_event+0x69/0xd0 [mlx4_core]
 [&lt;ffffffffa006000e&gt;] mlx4_eq_int+0x51e/0xd50 [mlx4_core]
 [&lt;ffffffffa006084f&gt;] mlx4_msi_x_interrupt+0xf/0x20 [mlx4_core]
 [&lt;ffffffff810b67b0&gt;] handle_irq_event_percpu+0x40/0x110
 [&lt;ffffffff810b68bf&gt;] handle_irq_event+0x3f/0x70
 [&lt;ffffffff810ba7f9&gt;] handle_edge_irq+0x79/0x120
 [&lt;ffffffff81007f3d&gt;] handle_irq+0x5d/0x130
 [&lt;ffffffff810071fd&gt;] do_IRQ+0x6d/0x130
 [&lt;ffffffff8151d309&gt;] common_interrupt+0x89/0x89
 &lt;EOI&gt;  [&lt;ffffffff8140895f&gt;] cpuidle_enter_state+0xcf/0x200
 [&lt;ffffffff81408aa2&gt;] cpuidle_enter+0x12/0x20
 [&lt;ffffffff810990d6&gt;] call_cpuidle+0x36/0x60
 [&lt;ffffffff81099163&gt;] cpuidle_idle_call+0x63/0x110
 [&lt;ffffffff8109930a&gt;] cpu_idle_loop+0xfa/0x130
 [&lt;ffffffff8109934e&gt;] cpu_startup_entry+0xe/0x10
 [&lt;ffffffff8103c443&gt;] start_secondary+0x83/0x90

Fixes: commit be4b499323bf ("IB/cm: Do not queue work to a device that's going away")
Signed-off-by: Bart Van Assche &lt;bart.vanassche@sandisk.com&gt;
Cc: Erez Shitrit &lt;erezsh@mellanox.com&gt;
Signed-off-by: Doug Ledford &lt;dledford@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 4bfdf635c668869c69fd18ece37ec66fb6f38fcf upstream.

ib_send_cm_drep() calls cm_enter_timewait() while holding a spinlock
that can be locked from inside an interrupt handler. Hence do not
enable interrupts inside cm_enter_timewait() if called with interrupts
disabled.

This patch fixes e.g. the following deadlock:
Acked-by: Erez Shitrit &lt;erezsh@mellanox.com&gt;

=================================
[ INFO: inconsistent lock state ]
4.4.0-rc7+ #1 Tainted: G            E
---------------------------------
inconsistent {HARDIRQ-ON-W} -&gt; {IN-HARDIRQ-W} usage.
swapper/8/0 [HC1[1]:SC0[0]:HE0:SE1] takes:
(&amp;(&amp;cm_id_priv-&gt;lock)-&gt;rlock){?.+...}, at: [&lt;ffffffffa036eec4&gt;] cm_establish+0x
74/0x1b0 [ib_cm]
{HARDIRQ-ON-W} state was registered at:
  [&lt;ffffffff810a3c11&gt;] mark_held_locks+0x71/0x90
  [&lt;ffffffff810a3e87&gt;] trace_hardirqs_on_caller+0xa7/0x1c0
  [&lt;ffffffff810a3fad&gt;] trace_hardirqs_on+0xd/0x10
  [&lt;ffffffff8151c40b&gt;] _raw_spin_unlock_irq+0x2b/0x40
  [&lt;ffffffffa036ea8e&gt;] cm_enter_timewait+0xae/0x100 [ib_cm]
  [&lt;ffffffffa036ff76&gt;] ib_send_cm_drep+0xb6/0x190 [ib_cm]
  [&lt;ffffffffa052ed08&gt;] srp_cm_handler+0x128/0x1a0 [ib_srp]
  [&lt;ffffffffa0370340&gt;] cm_process_work+0x20/0xf0 [ib_cm]
  [&lt;ffffffffa0371335&gt;] cm_dreq_handler+0x135/0x2c0 [ib_cm]
  [&lt;ffffffffa03733c5&gt;] cm_work_handler+0x75/0xd0 [ib_cm]
  [&lt;ffffffff8107184d&gt;] process_one_work+0x1bd/0x460
  [&lt;ffffffff81073148&gt;] worker_thread+0x118/0x420
  [&lt;ffffffff81078454&gt;] kthread+0xe4/0x100
  [&lt;ffffffff8151cbbf&gt;] ret_from_fork+0x3f/0x70
irq event stamp: 1672286
hardirqs last  enabled at (1672283): [&lt;ffffffff81408ec0&gt;] poll_idle+0x10/0x80
hardirqs last disabled at (1672284): [&lt;ffffffff8151d304&gt;] common_interrupt+0x84/0x89
softirqs last  enabled at (1672286): [&lt;ffffffff8105b4dc&gt;] _local_bh_enable+0x1c/0x50
softirqs last disabled at (1672285): [&lt;ffffffff8105b697&gt;] irq_enter+0x47/0x70

other info that might help us debug this:
 Possible unsafe locking scenario:

       CPU0
       ----
  lock(&amp;(&amp;cm_id_priv-&gt;lock)-&gt;rlock);
  &lt;Interrupt&gt;
    lock(&amp;(&amp;cm_id_priv-&gt;lock)-&gt;rlock);

 *** DEADLOCK ***

no locks held by swapper/8/0.

stack backtrace:
CPU: 8 PID: 0 Comm: swapper/8 Tainted: G            E   4.4.0-rc7+ #1
Hardware name: Dell Inc. PowerEdge R430/03XKDV, BIOS 1.0.2 11/17/2014
 ffff88045af5e950 ffff88046e503a88 ffffffff81251c1b 0000000000000007
 0000000000000006 0000000000000003 ffff88045af5ddc0 ffff88046e503ad8
 ffffffff810a32f4 0000000000000000 0000000000000000 0000000000000001
Call Trace:
 &lt;IRQ&gt;  [&lt;ffffffff81251c1b&gt;] dump_stack+0x4f/0x74
 [&lt;ffffffff810a32f4&gt;] print_usage_bug+0x184/0x190
 [&lt;ffffffff810a36e2&gt;] mark_lock_irq+0xf2/0x290
 [&lt;ffffffff810a3995&gt;] mark_lock+0x115/0x1b0
 [&lt;ffffffff810a3b8c&gt;] mark_irqflags+0x15c/0x170
 [&lt;ffffffff810a4fef&gt;] __lock_acquire+0x1ef/0x560
 [&lt;ffffffff810a53c2&gt;] lock_acquire+0x62/0x80
 [&lt;ffffffff8151bd33&gt;] _raw_spin_lock_irqsave+0x43/0x60
 [&lt;ffffffffa036eec4&gt;] cm_establish+0x74/0x1b0 [ib_cm]
 [&lt;ffffffffa036f031&gt;] ib_cm_notify+0x31/0x100 [ib_cm]
 [&lt;ffffffffa0637f24&gt;] srpt_qp_event+0x54/0xd0 [ib_srpt]
 [&lt;ffffffffa0196052&gt;] mlx4_ib_qp_event+0x72/0xc0 [mlx4_ib]
 [&lt;ffffffffa00775b9&gt;] mlx4_qp_event+0x69/0xd0 [mlx4_core]
 [&lt;ffffffffa006000e&gt;] mlx4_eq_int+0x51e/0xd50 [mlx4_core]
 [&lt;ffffffffa006084f&gt;] mlx4_msi_x_interrupt+0xf/0x20 [mlx4_core]
 [&lt;ffffffff810b67b0&gt;] handle_irq_event_percpu+0x40/0x110
 [&lt;ffffffff810b68bf&gt;] handle_irq_event+0x3f/0x70
 [&lt;ffffffff810ba7f9&gt;] handle_edge_irq+0x79/0x120
 [&lt;ffffffff81007f3d&gt;] handle_irq+0x5d/0x130
 [&lt;ffffffff810071fd&gt;] do_IRQ+0x6d/0x130
 [&lt;ffffffff8151d309&gt;] common_interrupt+0x89/0x89
 &lt;EOI&gt;  [&lt;ffffffff8140895f&gt;] cpuidle_enter_state+0xcf/0x200
 [&lt;ffffffff81408aa2&gt;] cpuidle_enter+0x12/0x20
 [&lt;ffffffff810990d6&gt;] call_cpuidle+0x36/0x60
 [&lt;ffffffff81099163&gt;] cpuidle_idle_call+0x63/0x110
 [&lt;ffffffff8109930a&gt;] cpu_idle_loop+0xfa/0x130
 [&lt;ffffffff8109934e&gt;] cpu_startup_entry+0xe/0x10
 [&lt;ffffffff8103c443&gt;] start_secondary+0x83/0x90

Fixes: commit be4b499323bf ("IB/cm: Do not queue work to a device that's going away")
Signed-off-by: Bart Van Assche &lt;bart.vanassche@sandisk.com&gt;
Cc: Erez Shitrit &lt;erezsh@mellanox.com&gt;
Signed-off-by: Doug Ledford &lt;dledford@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>IB/cma: cma_match_net_dev needs to take into account port_num</title>
<updated>2015-12-23T04:22:50+00:00</updated>
<author>
<name>Matan Barak</name>
<email>matanb@mellanox.com</email>
</author>
<published>2015-12-21T15:01:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=fac51590c1a077809984139e9bb9e06ed366f219'/>
<id>fac51590c1a077809984139e9bb9e06ed366f219</id>
<content type='text'>
Previously, cma_match_net_dev called cma_protocol_roce which
tried to verify that the IB device uses RoCE protocol. However,
if rdma_id wasn't bound to a port, then the check would occur
against the first port of the device without regard to whether
that port was even of the same type as the type of port the
incoming packet was received on.

Fix this by passing the port of the request and only checking
against the same port of the device.

Reported-by: Or Gerlitz &lt;gerlitz.or@gmail.com&gt;
Fixes: b8cab5dab15f ('IB/cma: Accept connection without a valid netdev on RoCE')
Signed-off-by: Matan Barak &lt;matanb@mellanox.com&gt;
Signed-off-by: Doug Ledford &lt;dledford@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previously, cma_match_net_dev called cma_protocol_roce which
tried to verify that the IB device uses RoCE protocol. However,
if rdma_id wasn't bound to a port, then the check would occur
against the first port of the device without regard to whether
that port was even of the same type as the type of port the
incoming packet was received on.

Fix this by passing the port of the request and only checking
against the same port of the device.

Reported-by: Or Gerlitz &lt;gerlitz.or@gmail.com&gt;
Fixes: b8cab5dab15f ('IB/cma: Accept connection without a valid netdev on RoCE')
Signed-off-by: Matan Barak &lt;matanb@mellanox.com&gt;
Signed-off-by: Doug Ledford &lt;dledford@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>IB/mad: Require CM send method for everything except ClassPortInfo</title>
<updated>2015-12-08T17:19:11+00:00</updated>
<author>
<name>Hal Rosenstock</name>
<email>hal@dev.mellanox.co.il</email>
</author>
<published>2015-11-13T20:22:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=533708867dd6388f643f12c87465b59e732d729d'/>
<id>533708867dd6388f643f12c87465b59e732d729d</id>
<content type='text'>
Receipt of CM MAD with other than the Send method for an attribute
other than the ClassPortInfo attribute is invalid.

CM attributes other than ClassPortInfo only use the send method.

The SRP initiator does not maintain a timeout policy for CM connect
requests relies on the CM layer to do that. The result was that
the SRP initiator hung as the connect request never completed.

A new SRP target has been observed to respond to Send CM REQ
with GetResp of CM REQ with bad status. This is non conformant
with IBA spec but exposes a vulnerability in the current MAD/CM
code which will respond to the incoming GetResp of CM REQ as if
it was a valid incoming Send of CM REQ rather than tossing
this on the floor. It also causes the MAD layer not to
retransmit the original REQ even though it has not received a REP.

Reviewed-by: Sagi Grimberg &lt;sagig@mellanox.com&gt;
Signed-off-by: Hal Rosenstock &lt;hal@mellanox.com&gt;
Reviewed-by: Ira Weiny &lt;ira.weiny@intel.com&gt;
Signed-off-by: Doug Ledford &lt;dledford@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Receipt of CM MAD with other than the Send method for an attribute
other than the ClassPortInfo attribute is invalid.

CM attributes other than ClassPortInfo only use the send method.

The SRP initiator does not maintain a timeout policy for CM connect
requests relies on the CM layer to do that. The result was that
the SRP initiator hung as the connect request never completed.

A new SRP target has been observed to respond to Send CM REQ
with GetResp of CM REQ with bad status. This is non conformant
with IBA spec but exposes a vulnerability in the current MAD/CM
code which will respond to the incoming GetResp of CM REQ as if
it was a valid incoming Send of CM REQ rather than tossing
this on the floor. It also causes the MAD layer not to
retransmit the original REQ even though it has not received a REP.

Reviewed-by: Sagi Grimberg &lt;sagig@mellanox.com&gt;
Signed-off-by: Hal Rosenstock &lt;hal@mellanox.com&gt;
Reviewed-by: Ira Weiny &lt;ira.weiny@intel.com&gt;
Signed-off-by: Doug Ledford &lt;dledford@redhat.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
