<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/net/rds/rdma.c, branch linux-4.13.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.13.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.13.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2017-07-04T21:35:17Z</updated>
<entry>
<title>net, rds: convert rds_mr.r_refcount from atomic_t to refcount_t</title>
<updated>2017-07-04T21:35:17Z</updated>
<author>
<name>Reshetova, Elena</name>
</author>
<published>2017-07-04T12:53:17Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=803ea85053b75d35f9ebb3aa7a28db35d82c6d82'/>
<id>urn:sha1:803ea85053b75d35f9ebb3aa7a28db35d82c6d82</id>
<content type='text'>
refcount_t type and corresponding API should be
used instead of atomic_t when the variable is used as
a reference counter. This allows to avoid accidental
refcounter overflows that might lead to use-after-free
situations.

Signed-off-by: Elena Reshetova &lt;elena.reshetova@intel.com&gt;
Signed-off-by: Hans Liljestrand &lt;ishkamiel@gmail.com&gt;
Signed-off-by: Kees Cook &lt;keescook@chromium.org&gt;
Signed-off-by: David Windsor &lt;dwindsor@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>RDS: make message size limit compliant with spec</title>
<updated>2017-01-02T22:02:57Z</updated>
<author>
<name>Avinash Repaka</name>
</author>
<published>2016-02-29T23:30:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f9fb69adb6c7acca60977a4db5a5f95b8e66c041'/>
<id>urn:sha1:f9fb69adb6c7acca60977a4db5a5f95b8e66c041</id>
<content type='text'>
RDS support max message size as 1M but the code doesn't check this
in all cases. Patch fixes it for RDMA &amp; non-RDMA and RDS MR size
and its enforced irrespective of underlying transport.

Signed-off-by: Avinash Repaka &lt;avinash.repaka@oracle.com&gt;
Signed-off-by: Santosh Shilimkar &lt;santosh.shilimkar@oracle.com&gt;
</content>
</entry>
<entry>
<title>RDS: RDMA: Fix the composite message user notification</title>
<updated>2017-01-02T22:02:54Z</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=941f8d55f6d613a460a5e080d25a38509f45eb75'/>
<id>urn:sha1:941f8d55f6d613a460a5e080d25a38509f45eb75</id>
<content type='text'>
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;
</content>
</entry>
<entry>
<title>RDS: RDMA: silence the use_once mr log flood</title>
<updated>2017-01-02T22:02:49Z</updated>
<author>
<name>Santosh Shilimkar</name>
</author>
<published>2016-07-04T02:14:10Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c536a068870a08fb7b35482e701a6b72e294b493'/>
<id>urn:sha1:c536a068870a08fb7b35482e701a6b72e294b493</id>
<content type='text'>
In absence of extension headers, message log will keep
flooding the console. As such even without use_once we can
clean up the MRs so its not really an error case message
so make it debug message

Signed-off-by: Santosh Shilimkar &lt;santosh.shilimkar@oracle.com&gt;
</content>
</entry>
<entry>
<title>RDS: use rb_entry()</title>
<updated>2016-12-20T19:22:49Z</updated>
<author>
<name>Geliang Tang</name>
</author>
<published>2016-12-20T14:02:18Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a763f78cea845c91b8d91f93dabf70c407635dc5'/>
<id>urn:sha1:a763f78cea845c91b8d91f93dabf70c407635dc5</id>
<content type='text'>
To make the code clearer, use rb_entry() instead of container_of() to
deal with rbtree.

Signed-off-by: Geliang Tang &lt;geliangtang@gmail.com&gt;
Reviewed-by: Leon Romanovsky &lt;leonro@mellanox.com&gt;
Acked-by: Santosh Shilimkar &lt;santosh.shilimkar@oracle.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>RDS: Fix rds MR reference count in rds_rdma_unuse()</title>
<updated>2015-08-25T23:28:10Z</updated>
<author>
<name>santosh.shilimkar@oracle.com</name>
</author>
<published>2015-08-25T19:01:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3f6b3143031b678a8577df1f24ca977510aefcf5'/>
<id>urn:sha1:3f6b3143031b678a8577df1f24ca977510aefcf5</id>
<content type='text'>
rds_rdma_unuse() drops the mr reference count which it hasn't
taken. Correct way of removing mr is to remove mr from the tree
and then rdma_destroy_mr() it first, then rds_mr_put() to decrement
its reference count. Whichever thread holds last reference will free
the mr via rds_mr_put()

This bug was triggering weird null pointer crashes. One if the trace
for it is captured below.

BUG: unable to handle kernel NULL pointer dereference at
0000000000000104
IP: [&lt;ffffffffa0899471&gt;] rds_ib_free_mr+0x31/0x130 [rds_rdma]
PGD 4366fa067 PUD 4366f9067 PMD 0
Oops: 0000 [#1] SMP

[...]

task: ffff88046da6a000 ti: ffff88046da6c000 task.ti: ffff88046da6c000
RIP: 0010:[&lt;ffffffffa0899471&gt;]  [&lt;ffffffffa0899471&gt;]
rds_ib_free_mr+0x31/0x130 [rds_rdma]
RSP: 0018:ffff88046fa43bd8  EFLAGS: 00010286
RAX: 0000000071d38b80 RBX: 0000000000000000 RCX: 0000000000000000
RDX: 0000000000000001 RSI: 0000000000000000 RDI: ffff880079e7ff40
RBP: ffff88046fa43bf8 R08: 0000000000000000 R09: 0000000000000000
R10: ffff88046fa43ca8 R11: ffff88046a802ed8 R12: ffff880079e7fa40
R13: 0000000000000000 R14: ffff880079e7ff40 R15: 0000000000000000
FS:  0000000000000000(0000) GS:ffff88046fa40000(0000)
knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
CR2: 0000000000000104 CR3: 00000004366fb000 CR4: 00000000000006e0
Stack:
 ffff880079e7fa40 ffff880671d38f08 ffff880079e7ff40 0000000000000296
 ffff88046fa43c28 ffffffffa087a38b ffff880079e7fa40 ffff880671d38f10
 0000000000000000 0000000000000292 ffff88046fa43c48 ffffffffa087a3b6
Call Trace:
 &lt;IRQ&gt;
 [&lt;ffffffffa087a38b&gt;] rds_destroy_mr+0x8b/0xa0 [rds]
 [&lt;ffffffffa087a3b6&gt;] __rds_put_mr_final+0x16/0x30 [rds]
 [&lt;ffffffffa087a492&gt;] rds_rdma_unuse+0xc2/0x120 [rds]
 [&lt;ffffffffa08766d3&gt;] rds_recv_incoming_exthdrs+0x83/0xa0 [rds]
 [&lt;ffffffffa0876782&gt;] rds_recv_incoming+0x92/0x200 [rds]
 [&lt;ffffffffa0895269&gt;] rds_ib_process_recv+0x259/0x320 [rds_rdma]
 [&lt;ffffffffa08962a8&gt;] rds_ib_recv_tasklet_fn+0x1a8/0x490 [rds_rdma]
 [&lt;ffffffff810dcd78&gt;] ? __remove_hrtimer+0x58/0x90
 [&lt;ffffffff810799e1&gt;] tasklet_action+0xb1/0xc0
 [&lt;ffffffff81079b52&gt;] __do_softirq+0xe2/0x290
 [&lt;ffffffff81079df6&gt;] irq_exit+0xa6/0xb0
 [&lt;ffffffff81613915&gt;] do_IRQ+0x65/0xf0
 [&lt;ffffffff816118ab&gt;] common_interrupt+0x6b/0x6b

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>
</entry>
<entry>
<title>RDS: Fix assertion level from fatal to warning</title>
<updated>2015-08-25T20:35:31Z</updated>
<author>
<name>santosh.shilimkar@oracle.com</name>
</author>
<published>2015-08-22T22:45:31Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5c240fa2ab394af1dbde280e00cc038cbc7f0409'/>
<id>urn:sha1:5c240fa2ab394af1dbde280e00cc038cbc7f0409</id>
<content type='text'>
Fix the asserion level since its not fatal and can be hit
in normal execution paths. There is no need to take the
system down.

We keep the WARN_ON() to detect the condition if we get
here with bad pages.

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>
</entry>
<entry>
<title>RDS: restore return value in rds_cmsg_rdma_args()</title>
<updated>2015-08-25T20:35:29Z</updated>
<author>
<name>santosh.shilimkar@oracle.com</name>
</author>
<published>2015-08-22T22:45:22Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1d2e3f396c532b95a37bbee92269f37efe908457'/>
<id>urn:sha1:1d2e3f396c532b95a37bbee92269f37efe908457</id>
<content type='text'>
In rds_cmsg_rdma_args() 'ret' is used by rds_pin_pages() which returns
number of pinned pages on success. And the same value is returned to the
caller of rds_cmsg_rdma_args() on success which is not intended.

Commit f4a3fc03c1d7 ("RDS: Clean up error handling in rds_cmsg_rdma_args")
removed the 'ret = 0' line which broke RDS RDMA mode.

Fix it by restoring the return value on rds_pin_pages() success
keeping the clean-up in place.

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>
</entry>
<entry>
<title>rds: avoid calling sock_kfree_s() on allocation failure</title>
<updated>2014-10-14T21:00:19Z</updated>
<author>
<name>Cong Wang</name>
</author>
<published>2014-10-14T19:35:08Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=dee49f203a7feef5d00c416b7dc7e34a7caba8e1'/>
<id>urn:sha1:dee49f203a7feef5d00c416b7dc7e34a7caba8e1</id>
<content type='text'>
It is okay to free a NULL pointer but not okay to mischarge the socket optmem
accounting. Compile test only.

Reported-by: rucsoftsec@gmail.com
Cc: Chien Yen &lt;chien.yen@oracle.com&gt;
Cc: Stephen Hemminger &lt;stephen@networkplumber.org&gt;
Signed-off-by: Cong Wang &lt;cwang@twopensource.com&gt;
Signed-off-by: Cong Wang &lt;xiyou.wangcong@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>rds: Integer overflow in RDS cmsg handling</title>
<updated>2010-11-17T20:20:52Z</updated>
<author>
<name>Dan Rosenberg</name>
</author>
<published>2010-11-17T06:37:16Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=218854af84038d828a32f061858b1902ed2beec6'/>
<id>urn:sha1:218854af84038d828a32f061858b1902ed2beec6</id>
<content type='text'>
In rds_cmsg_rdma_args(), the user-provided args-&gt;nr_local value is
restricted to less than UINT_MAX.  This seems to need a tighter upper
bound, since the calculation of total iov_size can overflow, resulting
in a small sock_kmalloc() allocation.  This would probably just result
in walking off the heap and crashing when calling rds_rdma_pages() with
a high count value.  If it somehow doesn't crash here, then memory
corruption could occur soon after.

Signed-off-by: Dan Rosenberg &lt;drosenberg@vsecurity.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
</feed>
