<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/net/rds/send.c, branch v4.4.101</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>RDS: RDMA: Fix the composite message user notification</title>
<updated>2017-10-08T08:14:16+00:00</updated>
<author>
<name>Santosh Shilimkar</name>
<email>santosh.shilimkar@oracle.com</email>
</author>
<published>2016-02-19T04:06:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=6a501bddeba3406517e0ba3529d9a665709df4a1'/>
<id>6a501bddeba3406517e0ba3529d9a665709df4a1</id>
<content type='text'>
[ Upstream commit 941f8d55f6d613a460a5e080d25a38509f45eb75 ]

When application sends an RDS RDMA composite message consist of
RDMA transfer to be followed up by non RDMA payload, it expect to
be notified *only* when the full message gets delivered. RDS RDMA
notification doesn't behave this way though.

Thanks to Venkat for debug and root casuing the issue
where only first part of the message(RDMA) was
successfully delivered but remainder payload delivery failed.
In that case, application should not be notified with
a false positive of message delivery success.

Fix this case by making sure the user gets notified only after
the full message delivery.

Reviewed-by: Venkat Venkatsubra &lt;venkat.x.venkatsubra@oracle.com&gt;
Signed-off-by: Santosh Shilimkar &lt;santosh.shilimkar@oracle.com&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@verizon.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>
[ Upstream commit 941f8d55f6d613a460a5e080d25a38509f45eb75 ]

When application sends an RDS RDMA composite message consist of
RDMA transfer to be followed up by non RDMA payload, it expect to
be notified *only* when the full message gets delivered. RDS RDMA
notification doesn't behave this way though.

Thanks to Venkat for debug and root casuing the issue
where only first part of the message(RDMA) was
successfully delivered but remainder payload delivery failed.
In that case, application should not be notified with
a false positive of message delivery success.

Fix this case by making sure the user gets notified only after
the full message delivery.

Reviewed-by: Venkat Venkatsubra &lt;venkat.x.venkatsubra@oracle.com&gt;
Signed-off-by: Santosh Shilimkar &lt;santosh.shilimkar@oracle.com&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@verizon.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>RDS: fix race condition when sending a message on unbound socket</title>
<updated>2015-11-24T22:20:09+00:00</updated>
<author>
<name>Quentin Casasnovas</name>
<email>quentin.casasnovas@oracle.com</email>
</author>
<published>2015-11-24T22:13:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=8c7188b23474cca017b3ef354c4a58456f68303a'/>
<id>8c7188b23474cca017b3ef354c4a58456f68303a</id>
<content type='text'>
Sasha's found a NULL pointer dereference in the RDS connection code when
sending a message to an apparently unbound socket.  The problem is caused
by the code checking if the socket is bound in rds_sendmsg(), which checks
the rs_bound_addr field without taking a lock on the socket.  This opens a
race where rs_bound_addr is temporarily set but where the transport is not
in rds_bind(), leading to a NULL pointer dereference when trying to
dereference 'trans' in __rds_conn_create().

Vegard wrote a reproducer for this issue, so kindly ask him to share if
you're interested.

I cannot reproduce the NULL pointer dereference using Vegard's reproducer
with this patch, whereas I could without.

Complete earlier incomplete fix to CVE-2015-6937:

  74e98eb08588 ("RDS: verify the underlying transport exists before creating a connection")

Cc: David S. Miller &lt;davem@davemloft.net&gt;
Cc: stable@vger.kernel.org

Reviewed-by: Vegard Nossum &lt;vegard.nossum@oracle.com&gt;
Reviewed-by: Sasha Levin &lt;sasha.levin@oracle.com&gt;
Acked-by: Santosh Shilimkar &lt;santosh.shilimkar@oracle.com&gt;
Signed-off-by: Quentin Casasnovas &lt;quentin.casasnovas@oracle.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Sasha's found a NULL pointer dereference in the RDS connection code when
sending a message to an apparently unbound socket.  The problem is caused
by the code checking if the socket is bound in rds_sendmsg(), which checks
the rs_bound_addr field without taking a lock on the socket.  This opens a
race where rs_bound_addr is temporarily set but where the transport is not
in rds_bind(), leading to a NULL pointer dereference when trying to
dereference 'trans' in __rds_conn_create().

Vegard wrote a reproducer for this issue, so kindly ask him to share if
you're interested.

I cannot reproduce the NULL pointer dereference using Vegard's reproducer
with this patch, whereas I could without.

Complete earlier incomplete fix to CVE-2015-6937:

  74e98eb08588 ("RDS: verify the underlying transport exists before creating a connection")

Cc: David S. Miller &lt;davem@davemloft.net&gt;
Cc: stable@vger.kernel.org

Reviewed-by: Vegard Nossum &lt;vegard.nossum@oracle.com&gt;
Reviewed-by: Sasha Levin &lt;sasha.levin@oracle.com&gt;
Acked-by: Santosh Shilimkar &lt;santosh.shilimkar@oracle.com&gt;
Signed-off-by: Quentin Casasnovas &lt;quentin.casasnovas@oracle.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>RDS: fix rds-ping deadlock over TCP transport</title>
<updated>2015-10-19T05:45:55+00:00</updated>
<author>
<name>santosh.shilimkar@oracle.com</name>
<email>santosh.shilimkar@oracle.com</email>
</author>
<published>2015-10-17T02:13:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=7b4b000951f09cfe3604a6fdf5469894b4e75adb'/>
<id>7b4b000951f09cfe3604a6fdf5469894b4e75adb</id>
<content type='text'>
Sowmini found hang with rds-ping while testing RDS over TCP. Its
a corner case and doesn't happen always. The issue is not reproducible
with IB transport. Its clear from below dump why we see it with RDS TCP.

 [&lt;ffffffff8153b7e5&gt;] do_tcp_setsockopt+0xb5/0x740
 [&lt;ffffffff8153bec4&gt;] tcp_setsockopt+0x24/0x30
 [&lt;ffffffff814d57d4&gt;] sock_common_setsockopt+0x14/0x20
 [&lt;ffffffffa096071d&gt;] rds_tcp_xmit_prepare+0x5d/0x70 [rds_tcp]
 [&lt;ffffffffa093b5f7&gt;] rds_send_xmit+0xd7/0x740 [rds]
 [&lt;ffffffffa093bda2&gt;] rds_send_pong+0x142/0x180 [rds]
 [&lt;ffffffffa0939d34&gt;] rds_recv_incoming+0x274/0x330 [rds]
 [&lt;ffffffff810815ae&gt;] ? ttwu_queue+0x11e/0x130
 [&lt;ffffffff814dcacd&gt;] ? skb_copy_bits+0x6d/0x2c0
 [&lt;ffffffffa0960350&gt;] rds_tcp_data_recv+0x2f0/0x3d0 [rds_tcp]
 [&lt;ffffffff8153d836&gt;] tcp_read_sock+0x96/0x1c0
 [&lt;ffffffffa0960060&gt;] ? rds_tcp_recv_init+0x40/0x40 [rds_tcp]
 [&lt;ffffffff814d6a90&gt;] ? sock_def_write_space+0xa0/0xa0
 [&lt;ffffffffa09604d1&gt;] rds_tcp_data_ready+0xa1/0xf0 [rds_tcp]
 [&lt;ffffffff81545249&gt;] tcp_data_queue+0x379/0x5b0
 [&lt;ffffffffa0960cdb&gt;] ? rds_tcp_write_space+0xbb/0x110 [rds_tcp]
 [&lt;ffffffff81547fd2&gt;] tcp_rcv_established+0x2e2/0x6e0
 [&lt;ffffffff81552602&gt;] tcp_v4_do_rcv+0x122/0x220
 [&lt;ffffffff81553627&gt;] tcp_v4_rcv+0x867/0x880
 [&lt;ffffffff8152e0b3&gt;] ip_local_deliver_finish+0xa3/0x220

This happens because rds_send_xmit() chain wants to take
sock_lock which is already taken by tcp_v4_rcv() on its
way to rds_tcp_data_ready(). Commit db6526dcb51b ("RDS: use
rds_send_xmit() state instead of RDS_LL_SEND_FULL") which
was trying to opportunistically finish the send request
in same thread context.

But because of above recursive lock hang with RDS TCP,
the send work from rds_send_pong() needs to deferred to
worker to avoid lock up. Given RDS ping is more of connectivity
test than performance critical path, its should be ok even
for transport like IB.

Reported-by: Sowmini Varadhan &lt;sowmini.varadhan@oracle.com&gt;
Acked-by:  Sowmini Varadhan &lt;sowmini.varadhan@oracle.com&gt;
Signed-off-by: Santosh Shilimkar &lt;ssantosh@kernel.org&gt;
Signed-off-by: Santosh Shilimkar &lt;santosh.shilimkar@oracle.com&gt;
Acked-by: Sowmini Varadhan &lt;sowmini.varadhan@oracle.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Sowmini found hang with rds-ping while testing RDS over TCP. Its
a corner case and doesn't happen always. The issue is not reproducible
with IB transport. Its clear from below dump why we see it with RDS TCP.

 [&lt;ffffffff8153b7e5&gt;] do_tcp_setsockopt+0xb5/0x740
 [&lt;ffffffff8153bec4&gt;] tcp_setsockopt+0x24/0x30
 [&lt;ffffffff814d57d4&gt;] sock_common_setsockopt+0x14/0x20
 [&lt;ffffffffa096071d&gt;] rds_tcp_xmit_prepare+0x5d/0x70 [rds_tcp]
 [&lt;ffffffffa093b5f7&gt;] rds_send_xmit+0xd7/0x740 [rds]
 [&lt;ffffffffa093bda2&gt;] rds_send_pong+0x142/0x180 [rds]
 [&lt;ffffffffa0939d34&gt;] rds_recv_incoming+0x274/0x330 [rds]
 [&lt;ffffffff810815ae&gt;] ? ttwu_queue+0x11e/0x130
 [&lt;ffffffff814dcacd&gt;] ? skb_copy_bits+0x6d/0x2c0
 [&lt;ffffffffa0960350&gt;] rds_tcp_data_recv+0x2f0/0x3d0 [rds_tcp]
 [&lt;ffffffff8153d836&gt;] tcp_read_sock+0x96/0x1c0
 [&lt;ffffffffa0960060&gt;] ? rds_tcp_recv_init+0x40/0x40 [rds_tcp]
 [&lt;ffffffff814d6a90&gt;] ? sock_def_write_space+0xa0/0xa0
 [&lt;ffffffffa09604d1&gt;] rds_tcp_data_ready+0xa1/0xf0 [rds_tcp]
 [&lt;ffffffff81545249&gt;] tcp_data_queue+0x379/0x5b0
 [&lt;ffffffffa0960cdb&gt;] ? rds_tcp_write_space+0xbb/0x110 [rds_tcp]
 [&lt;ffffffff81547fd2&gt;] tcp_rcv_established+0x2e2/0x6e0
 [&lt;ffffffff81552602&gt;] tcp_v4_do_rcv+0x122/0x220
 [&lt;ffffffff81553627&gt;] tcp_v4_rcv+0x867/0x880
 [&lt;ffffffff8152e0b3&gt;] ip_local_deliver_finish+0xa3/0x220

This happens because rds_send_xmit() chain wants to take
sock_lock which is already taken by tcp_v4_rcv() on its
way to rds_tcp_data_ready(). Commit db6526dcb51b ("RDS: use
rds_send_xmit() state instead of RDS_LL_SEND_FULL") which
was trying to opportunistically finish the send request
in same thread context.

But because of above recursive lock hang with RDS TCP,
the send work from rds_send_pong() needs to deferred to
worker to avoid lock up. Given RDS ping is more of connectivity
test than performance critical path, its should be ok even
for transport like IB.

Reported-by: Sowmini Varadhan &lt;sowmini.varadhan@oracle.com&gt;
Acked-by:  Sowmini Varadhan &lt;sowmini.varadhan@oracle.com&gt;
Signed-off-by: Santosh Shilimkar &lt;ssantosh@kernel.org&gt;
Signed-off-by: Santosh Shilimkar &lt;santosh.shilimkar@oracle.com&gt;
Acked-by: Sowmini Varadhan &lt;sowmini.varadhan@oracle.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>RDS: IB: split send completion handling and do batch ack</title>
<updated>2015-10-05T18:19:01+00:00</updated>
<author>
<name>Santosh Shilimkar</name>
<email>santosh.shilimkar@oracle.com</email>
</author>
<published>2015-09-06T06:18:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=0c28c04500cf956c82d542c199f5bddabd590af3'/>
<id>0c28c04500cf956c82d542c199f5bddabd590af3</id>
<content type='text'>
Similar to what we did with receive CQ completion handling, we split
the transmit completion handler so that it lets us implement batched
work completion handling.

We re-use the cq_poll routine and makes use of RDS_IB_SEND_OP to
identify the send vs receive completion event handler invocation.

Signed-off-by: Santosh Shilimkar &lt;ssantosh@kernel.org&gt;
Signed-off-by: Santosh Shilimkar &lt;santosh.shilimkar@oracle.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Similar to what we did with receive CQ completion handling, we split
the transmit completion handler so that it lets us implement batched
work completion handling.

We re-use the cq_poll routine and makes use of RDS_IB_SEND_OP to
identify the send vs receive completion event handler invocation.

Signed-off-by: Santosh Shilimkar &lt;ssantosh@kernel.org&gt;
Signed-off-by: Santosh Shilimkar &lt;santosh.shilimkar@oracle.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>RDS: use rds_send_xmit() state instead of RDS_LL_SEND_FULL</title>
<updated>2015-10-05T18:19:01+00:00</updated>
<author>
<name>Santosh Shilimkar</name>
<email>santosh.shilimkar@oracle.com</email>
</author>
<published>2015-09-11T22:44:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=db6526dcb51b054961a2d96ba43dec23e38818b3'/>
<id>db6526dcb51b054961a2d96ba43dec23e38818b3</id>
<content type='text'>
In Transport indepedent rds_sendmsg(), we shouldn't make decisions based
on RDS_LL_SEND_FULL which is used to manage the ring for RDMA based
transports. We can safely issue rds_send_xmit() and the using its
return value take decision on deferred work. This will also fix
the scenario where at times we are seeing connections stuck with
the LL_SEND_FULL bit getting set and never cleared.

We kick krdsd after any time we see -ENOMEM or -EAGAIN from the
ring allocation code.

Signed-off-by: Santosh Shilimkar &lt;ssantosh@kernel.org&gt;
Signed-off-by: Santosh Shilimkar &lt;santosh.shilimkar@oracle.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In Transport indepedent rds_sendmsg(), we shouldn't make decisions based
on RDS_LL_SEND_FULL which is used to manage the ring for RDMA based
transports. We can safely issue rds_send_xmit() and the using its
return value take decision on deferred work. This will also fix
the scenario where at times we are seeing connections stuck with
the LL_SEND_FULL bit getting set and never cleared.

We kick krdsd after any time we see -ENOMEM or -EAGAIN from the
ring allocation code.

Signed-off-by: Santosh Shilimkar &lt;ssantosh@kernel.org&gt;
Signed-off-by: Santosh Shilimkar &lt;santosh.shilimkar@oracle.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>RDS: defer the over_batch work to send worker</title>
<updated>2015-10-05T18:18:45+00:00</updated>
<author>
<name>Santosh Shilimkar</name>
<email>santosh.shilimkar@oracle.com</email>
</author>
<published>2015-09-10T18:57:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=4bebdd7a4d2960b2ff6c40b27156d041ea270765'/>
<id>4bebdd7a4d2960b2ff6c40b27156d041ea270765</id>
<content type='text'>
Current process gives up if its send work over the batch limit.
The work queue will get  kicked to finish off any other requests.
This fixes remainder condition from commit 443be0e5affe ("RDS: make
sure not to loop forever inside rds_send_xmit").

The restart condition is only for the case where we reached to
over_batch code for some other reason so just retrying again
before giving up.

While at it, make sure we use already available 'send_batch_count'
parameter instead of magic value. The batch count threshold value
of 1024 came via commit 443be0e5affe ("RDS: make sure not to loop
forever inside rds_send_xmit"). The idea is to process as big a
batch as we can but at the same time we don't hold other waiting
processes for send. Hence back-off after the send_batch_count
limit (1024) to avoid soft-lock ups.

Signed-off-by: Santosh Shilimkar &lt;ssantosh@kernel.org&gt;
Signed-off-by: Santosh Shilimkar &lt;santosh.shilimkar@oracle.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Current process gives up if its send work over the batch limit.
The work queue will get  kicked to finish off any other requests.
This fixes remainder condition from commit 443be0e5affe ("RDS: make
sure not to loop forever inside rds_send_xmit").

The restart condition is only for the case where we reached to
over_batch code for some other reason so just retrying again
before giving up.

While at it, make sure we use already available 'send_batch_count'
parameter instead of magic value. The batch count threshold value
of 1024 came via commit 443be0e5affe ("RDS: make sure not to loop
forever inside rds_send_xmit"). The idea is to process as big a
batch as we can but at the same time we don't hold other waiting
processes for send. Hence back-off after the send_batch_count
limit (1024) to avoid soft-lock ups.

Signed-off-by: Santosh Shilimkar &lt;ssantosh@kernel.org&gt;
Signed-off-by: Santosh Shilimkar &lt;santosh.shilimkar@oracle.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>RDS: return EMSGSIZE for oversize requests before processing/queueing</title>
<updated>2015-08-25T20:35:31+00:00</updated>
<author>
<name>Mukesh Kacker</name>
<email>mukesh.kacker@oracle.com</email>
</author>
<published>2015-08-22T22:45:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=06e8941e22f5cbaa4051f06d7ac99e3f302f6d48'/>
<id>06e8941e22f5cbaa4051f06d7ac99e3f302f6d48</id>
<content type='text'>
rds_send_queue_rm() allows for the "current datagram" being queued
to exceed SO_SNDBUF thresholds by checking bytes queued without
counting in length of current datagram. (Since sk_sndbuf is set
to twice requested SO_SNDBUF value as a kernel heuristic this
is usually fine!)

If this "current datagram" squeezing past the threshold is itself
many times the size of the sk_sndbuf threshold itself then even
twice the SO_SNDBUF does not save us and it gets queued but
cannot be transmitted. Threads block and deadlock and device
becomes unusable. The check for this datagram not exceeding
SNDBUF thresholds (EMSGSIZE) is not done on this datagram as
that check is only done if queueing attempt fails.
(Datagrams that follow this datagram fail queueing attempts, go
through the check and eventually trip EMSGSIZE error but zero
length datagrams silently fail!)

This fix moves the check for datagrams exceeding SNDBUF limits
before any processing or queueing is attempted and returns EMSGSIZE
early in the rds_sndmsg() code. This change also ensures that all
datagrams get checked for exceeding SNDBUF/sk_sndbuf size limits
and the large datagrams that exceed those limits do not get to
rds_send_queue_rm() code for processing.

Signed-off-by: Mukesh Kacker &lt;mukesh.kacker@oracle.com&gt;
Signed-off-by: Santosh Shilimkar &lt;ssantosh@kernel.org&gt;
Signed-off-by: Santosh Shilimkar &lt;santosh.shilimkar@oracle.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
rds_send_queue_rm() allows for the "current datagram" being queued
to exceed SO_SNDBUF thresholds by checking bytes queued without
counting in length of current datagram. (Since sk_sndbuf is set
to twice requested SO_SNDBUF value as a kernel heuristic this
is usually fine!)

If this "current datagram" squeezing past the threshold is itself
many times the size of the sk_sndbuf threshold itself then even
twice the SO_SNDBUF does not save us and it gets queued but
cannot be transmitted. Threads block and deadlock and device
becomes unusable. The check for this datagram not exceeding
SNDBUF thresholds (EMSGSIZE) is not done on this datagram as
that check is only done if queueing attempt fails.
(Datagrams that follow this datagram fail queueing attempts, go
through the check and eventually trip EMSGSIZE error but zero
length datagrams silently fail!)

This fix moves the check for datagrams exceeding SNDBUF limits
before any processing or queueing is attempted and returns EMSGSIZE
early in the rds_sndmsg() code. This change also ensures that all
datagrams get checked for exceeding SNDBUF/sk_sndbuf size limits
and the large datagrams that exceed those limits do not get to
rds_send_queue_rm() code for processing.

Signed-off-by: Mukesh Kacker &lt;mukesh.kacker@oracle.com&gt;
Signed-off-by: Santosh Shilimkar &lt;ssantosh@kernel.org&gt;
Signed-off-by: Santosh Shilimkar &lt;santosh.shilimkar@oracle.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>RDS: make sure rds_send_drop_to properly takes the m_rs_lock</title>
<updated>2015-08-25T20:35:31+00:00</updated>
<author>
<name>santosh.shilimkar@oracle.com</name>
<email>santosh.shilimkar@oracle.com</email>
</author>
<published>2015-08-22T22:45:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=dfcec251d22bab947d10cf37e9ad67085cf7f097'/>
<id>dfcec251d22bab947d10cf37e9ad67085cf7f097</id>
<content type='text'>
rds_send_drop_to() is used during socket tear down to find all the
messages on the socket and flush them .  It can race with the
acking code unless it takes the m_rs_lock on each and every message.

This plugs a hole where we didn't take m_rs_lock on any message that
didn't have the RDS_MSG_ON_CONN set.  Taking m_rs_lock avoids
double frees and other memory corruptions as the ack code trusts
the message m_rs pointer on a socket that had actually been freed.

We must take m_rs_lock to access m_rs.  Because of lock nesting and
rs access, we also need to acquire rs_lock.

Reviewed-by: Ajaykumar Hotchandani &lt;ajaykumar.hotchandani@oracle.com&gt;
Signed-off-by: Santosh Shilimkar &lt;ssantosh@kernel.org&gt;
Signed-off-by: Santosh Shilimkar &lt;santosh.shilimkar@oracle.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
rds_send_drop_to() is used during socket tear down to find all the
messages on the socket and flush them .  It can race with the
acking code unless it takes the m_rs_lock on each and every message.

This plugs a hole where we didn't take m_rs_lock on any message that
didn't have the RDS_MSG_ON_CONN set.  Taking m_rs_lock avoids
double frees and other memory corruptions as the ack code trusts
the message m_rs pointer on a socket that had actually been freed.

We must take m_rs_lock to access m_rs.  Because of lock nesting and
rs access, we also need to acquire rs_lock.

Reviewed-by: Ajaykumar Hotchandani &lt;ajaykumar.hotchandani@oracle.com&gt;
Signed-off-by: Santosh Shilimkar &lt;ssantosh@kernel.org&gt;
Signed-off-by: Santosh Shilimkar &lt;santosh.shilimkar@oracle.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>RDS: Mark message mapped before transmit</title>
<updated>2015-08-25T20:35:30+00:00</updated>
<author>
<name>santosh.shilimkar@oracle.com</name>
<email>santosh.shilimkar@oracle.com</email>
</author>
<published>2015-08-22T22:45:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=4f73113c63bae5cd092c93c2a9835b9d3c7f0b54'/>
<id>4f73113c63bae5cd092c93c2a9835b9d3c7f0b54</id>
<content type='text'>
rds_send_xmit() marks the rds message map flag after
xmit_[rdma/atomic]() which is clearly wrong.  We need
to maintain the ownership between transport and rds.

Also take care of error path.

Reviewed-by: Ajaykumar Hotchandani &lt;ajaykumar.hotchandani@oracle.com&gt;
Signed-off-by: Santosh Shilimkar &lt;ssantosh@kernel.org&gt;
Signed-off-by: Santosh Shilimkar &lt;santosh.shilimkar@oracle.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
rds_send_xmit() marks the rds message map flag after
xmit_[rdma/atomic]() which is clearly wrong.  We need
to maintain the ownership between transport and rds.

Also take care of error path.

Reviewed-by: Ajaykumar Hotchandani &lt;ajaykumar.hotchandani@oracle.com&gt;
Signed-off-by: Santosh Shilimkar &lt;ssantosh@kernel.org&gt;
Signed-off-by: Santosh Shilimkar &lt;santosh.shilimkar@oracle.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>RDS: check for congestion updates during rds_send_xmit</title>
<updated>2015-08-25T20:35:30+00:00</updated>
<author>
<name>santosh.shilimkar@oracle.com</name>
<email>santosh.shilimkar@oracle.com</email>
</author>
<published>2015-08-22T22:45:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=0c484240210a8c835a216dbca6f1d690e4094a7c'/>
<id>0c484240210a8c835a216dbca6f1d690e4094a7c</id>
<content type='text'>
Ensure we don't keep sending the data if the link is congested.

Reviewed-by: Ajaykumar Hotchandani &lt;ajaykumar.hotchandani@oracle.com&gt;
Signed-off-by: Santosh Shilimkar &lt;ssantosh@kernel.org&gt;
Signed-off-by: Santosh Shilimkar &lt;santosh.shilimkar@oracle.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Ensure we don't keep sending the data if the link is congested.

Reviewed-by: Ajaykumar Hotchandani &lt;ajaykumar.hotchandani@oracle.com&gt;
Signed-off-by: Santosh Shilimkar &lt;ssantosh@kernel.org&gt;
Signed-off-by: Santosh Shilimkar &lt;santosh.shilimkar@oracle.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
</feed>
