<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/net/rds/send.c, branch linux-3.18.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.18.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.18.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2017-11-30T08:35:54Z</updated>
<entry>
<title>RDS: RDMA: return appropriate error on rdma map failures</title>
<updated>2017-11-30T08:35:54Z</updated>
<author>
<name>Santosh Shilimkar</name>
</author>
<published>2016-07-05T00:04:37Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=952835ccd917682ebb705f89ff1e56fbf068a1d8'/>
<id>urn:sha1:952835ccd917682ebb705f89ff1e56fbf068a1d8</id>
<content type='text'>
[ Upstream commit 584a8279a44a800dea5a5c1e9d53a002e03016b4 ]

The first message to a remote node should prompt a new
connection even if it is RDMA operation. For RDMA operation
the MR mapping can fail because connections is not yet up.

Since the connection establishment is asynchronous,
we make sure the map failure because of unavailable
connection reach to the user by appropriate error code.
Before returning to the user, lets trigger the connection
so that its ready for the next retry.

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>
</entry>
<entry>
<title>RDS: RDMA: Fix the composite message user notification</title>
<updated>2017-10-08T08:11:18Z</updated>
<author>
<name>Santosh Shilimkar</name>
</author>
<published>2016-02-19T04:06:47Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=23e5fd9c55ca77c5d5557b565b43506ddb1fba74'/>
<id>urn:sha1:23e5fd9c55ca77c5d5557b565b43506ddb1fba74</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>
</entry>
<entry>
<title>RDS: fix race condition when sending a message on unbound socket</title>
<updated>2016-01-21T16:23:27Z</updated>
<author>
<name>Quentin Casasnovas</name>
</author>
<published>2015-11-24T22:13:21Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=96c7b10cd8000973035b667adf62ea1164f4b9b4'/>
<id>urn:sha1:96c7b10cd8000973035b667adf62ea1164f4b9b4</id>
<content type='text'>
[ Upstream commit 8c7188b23474cca017b3ef354c4a58456f68303a ]

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;
Signed-off-by: Sasha Levin &lt;sasha.levin@oracle.com&gt;
</content>
</entry>
<entry>
<title>net/rds: fix possible double free on sock tear down</title>
<updated>2014-10-03T19:52:00Z</updated>
<author>
<name>Herton R. Krzesinski</name>
</author>
<published>2014-10-01T21:49:54Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=593cbb3ec6a3f2424966832727f394b1696d0d72'/>
<id>urn:sha1:593cbb3ec6a3f2424966832727f394b1696d0d72</id>
<content type='text'>
I got a report of a double free happening at RDS slab cache. One
suspicion was that may be somewhere we were doing a sock_hold/sock_put
on an already freed sock. Thus after providing a kernel with the
following change:

 static inline void sock_hold(struct sock *sk)
 {
-       atomic_inc(&amp;sk-&gt;sk_refcnt);
+       if (!atomic_inc_not_zero(&amp;sk-&gt;sk_refcnt))
+               WARN(1, "Trying to hold sock already gone: %p (family: %hd)\n",
+                       sk, sk-&gt;sk_family);
 }

The warning successfuly triggered:

Trying to hold sock already gone: ffff81f6dda61280 (family: 21)
WARNING: at include/net/sock.h:350 sock_hold()
Call Trace:
&lt;IRQ&gt;  [&lt;ffffffff8adac135&gt;] :rds:rds_send_remove_from_sock+0xf0/0x21b
[&lt;ffffffff8adad35c&gt;] :rds:rds_send_drop_acked+0xbf/0xcf
[&lt;ffffffff8addf546&gt;] :rds_rdma:rds_ib_recv_tasklet_fn+0x256/0x2dc
[&lt;ffffffff8009899a&gt;] tasklet_action+0x8f/0x12b
[&lt;ffffffff800125a2&gt;] __do_softirq+0x89/0x133
[&lt;ffffffff8005f30c&gt;] call_softirq+0x1c/0x28
[&lt;ffffffff8006e644&gt;] do_softirq+0x2c/0x7d
[&lt;ffffffff8006e4d4&gt;] do_IRQ+0xee/0xf7
[&lt;ffffffff8005e625&gt;] ret_from_intr+0x0/0xa
&lt;EOI&gt;

Looking at the call chain above, the only way I think this would be
possible is if somewhere we already released the same socket-&gt;sock which
is assigned to the rds_message at rds_send_remove_from_sock. Which seems
only possible to happen after the tear down done on rds_release.

rds_release properly calls rds_send_drop_to to drop the socket from any
rds_message, and some proper synchronization is in place to avoid race
with rds_send_drop_acked/rds_send_remove_from_sock. However, I still see
a very narrow window where it may be possible we touch a sock already
released: when rds_release races with rds_send_drop_acked, we check
RDS_MSG_ON_CONN to avoid cleanup on the same rds_message, but in this
specific case we don't clear rm-&gt;m_rs. In this case, it seems we could
then go on at rds_send_drop_to and after it returns, the sock is freed
by last sock_put on rds_release, with concurrently we being at
rds_send_remove_from_sock; then at some point in the loop at
rds_send_remove_from_sock we process an rds_message which didn't have
rm-&gt;m_rs unset for a freed sock, and a possible sock_hold on an sock
already gone at rds_release happens.

This hopefully address the described condition above and avoids a double
free on "second last" sock_put. In addition, I removed the comment about
socket destruction on top of rds_send_drop_acked: we call rds_send_drop_to
in rds_release and we should have things properly serialized there, thus
I can't see the comment being accurate there.

Signed-off-by: Herton R. Krzesinski &lt;herton@redhat.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>arch: Mass conversion of smp_mb__*()</title>
<updated>2014-04-18T12:20:48Z</updated>
<author>
<name>Peter Zijlstra</name>
</author>
<published>2014-03-17T17:06:10Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4e857c58efeb99393cba5a5d0d8ec7117183137c'/>
<id>urn:sha1:4e857c58efeb99393cba5a5d0d8ec7117183137c</id>
<content type='text'>
Mostly scripted conversion of the smp_mb__* barriers.

Signed-off-by: Peter Zijlstra &lt;peterz@infradead.org&gt;
Acked-by: Paul E. McKenney &lt;paulmck@linux.vnet.ibm.com&gt;
Link: http://lkml.kernel.org/n/tip-55dhyhocezdw1dg7u19hmh1u@git.kernel.org
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: linux-arch@vger.kernel.org
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</content>
</entry>
<entry>
<title>net: add build-time checks for msg-&gt;msg_name size</title>
<updated>2014-01-19T07:04:16Z</updated>
<author>
<name>Steffen Hurrle</name>
</author>
<published>2014-01-17T21:53:15Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=342dfc306fb32155314dad277f3c3686b83fb9f1'/>
<id>urn:sha1:342dfc306fb32155314dad277f3c3686b83fb9f1</id>
<content type='text'>
This is a follow-up patch to f3d3342602f8bc ("net: rework recvmsg
handler msg_name and msg_namelen logic").

DECLARE_SOCKADDR validates that the structure we use for writing the
name information to is not larger than the buffer which is reserved
for msg-&gt;msg_name (which is 128 bytes). Also use DECLARE_SOCKADDR
consistently in sendmsg code paths.

Signed-off-by: Steffen Hurrle &lt;steffen@hurrle.net&gt;
Suggested-by: Hannes Frederic Sowa &lt;hannes@stressinduktion.org&gt;
Acked-by: Hannes Frederic Sowa &lt;hannes@stressinduktion.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>RDS: fix rds-ping spinlock recursion</title>
<updated>2012-10-09T17:57:23Z</updated>
<author>
<name>jeff.liu</name>
</author>
<published>2012-10-08T18:57:27Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5175a5e76bbdf20a614fb47ce7a38f0f39e70226'/>
<id>urn:sha1:5175a5e76bbdf20a614fb47ce7a38f0f39e70226</id>
<content type='text'>
This is the revised patch for fixing rds-ping spinlock recursion
according to Venkat's suggestions.

RDS ping/pong over TCP feature has been broken for years(2.6.39 to
3.6.0) since we have to set TCP cork and call kernel_sendmsg() between
ping/pong which both need to lock "struct sock *sk". However, this
lock has already been hold before rds_tcp_data_ready() callback is
triggerred. As a result, we always facing spinlock resursion which
would resulting in system panic.

Given that RDS ping is only used to test the connectivity and not for
serious performance measurements, we can queue the pong transmit to
rds_wq as a delayed response.

Reported-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
CC: Venkat Venkatsubra &lt;venkat.x.venkatsubra@oracle.com&gt;
CC: David S. Miller &lt;davem@davemloft.net&gt;
CC: James Morris &lt;james.l.morris@oracle.com&gt;
Signed-off-by: Jie Liu &lt;jeff.liu@oracle.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>Remove printk from rds_sendmsg</title>
<updated>2012-03-20T20:12:11Z</updated>
<author>
<name>Dave Jones</name>
</author>
<published>2012-03-19T13:01:07Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a6506e1486181975d318344143aca722b2b91621'/>
<id>urn:sha1:a6506e1486181975d318344143aca722b2b91621</id>
<content type='text'>
no socket layer outputs a message for this error and neither should rds.

Signed-off-by: Dave Jones &lt;davej@redhat.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: Add export.h for EXPORT_SYMBOL/THIS_MODULE to non-modules</title>
<updated>2011-10-31T23:30:30Z</updated>
<author>
<name>Paul Gortmaker</name>
</author>
<published>2011-07-15T15:47:34Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=bc3b2d7fb9b014d75ebb79ba371a763dbab5e8cf'/>
<id>urn:sha1:bc3b2d7fb9b014d75ebb79ba371a763dbab5e8cf</id>
<content type='text'>
These files are non modular, but need to export symbols using
the macros now living in export.h -- call out the include so
that things won't break when we remove the implicit presence
of module.h from everywhere.

Signed-off-by: Paul Gortmaker &lt;paul.gortmaker@windriver.com&gt;
</content>
</entry>
<entry>
<title>net: add moduleparam.h for users of module_param/MODULE_PARM_DESC</title>
<updated>2011-10-31T23:30:29Z</updated>
<author>
<name>Paul Gortmaker</name>
</author>
<published>2011-09-18T17:21:27Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d9b9384215e17c68d7b6bd05d6fa409e5d4140d7'/>
<id>urn:sha1:d9b9384215e17c68d7b6bd05d6fa409e5d4140d7</id>
<content type='text'>
These files were getting access to these two via the implicit
presence of module.h everywhere.  They aren't modules, so they
don't need the full module.h inclusion though.

Signed-off-by: Paul Gortmaker &lt;paul.gortmaker@windriver.com&gt;
</content>
</entry>
</feed>
