<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/include/rdma, branch linux-4.1.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.</subtitle>
<id>https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-4.1.y</id>
<link rel='self' href='https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-4.1.y'/>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/'/>
<updated>2018-05-23T01:33:56Z</updated>
<entry>
<title>RDMA/ucma: Introduce safer rdma_addr_size() variants</title>
<updated>2018-05-23T01:33:56Z</updated>
<author>
<name>Roland Dreier</name>
<email>roland@purestorage.com</email>
</author>
<published>2018-03-28T18:27:22Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=6dd7151f6115b36ce880d2ab1bd6d7017bd5217b'/>
<id>urn:sha1:6dd7151f6115b36ce880d2ab1bd6d7017bd5217b</id>
<content type='text'>
[ Upstream commit 84652aefb347297aa08e91e283adf7b18f77c2d5 ]

There are several places in the ucma ABI where userspace can pass in a
sockaddr but set the address family to AF_IB.  When that happens,
rdma_addr_size() will return a size bigger than sizeof struct sockaddr_in6,
and the ucma kernel code might end up copying past the end of a buffer
not sized for a struct sockaddr_ib.

Fix this by introducing new variants

    int rdma_addr_size_in6(struct sockaddr_in6 *addr);
    int rdma_addr_size_kss(struct __kernel_sockaddr_storage *addr);

that are type-safe for the types used in the ucma ABI and return 0 if the
size computed is bigger than the size of the type passed in.  We can use
these new variants to check what size userspace has passed in before
copying any addresses.

Reported-by: &lt;syzbot+6800425d54ed3ed8135d@syzkaller.appspotmail.com&gt;
Signed-off-by: Roland Dreier &lt;roland@purestorage.com&gt;
Signed-off-by: Jason Gunthorpe &lt;jgg@mellanox.com&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@microsoft.com&gt;
</content>
</entry>
<entry>
<title>RDMA/core: Fix incorrect structure packing for booleans</title>
<updated>2017-05-16T03:18:51Z</updated>
<author>
<name>Jason Gunthorpe</name>
<email>jgunthorpe@obsidianresearch.com</email>
</author>
<published>2016-12-23T01:07:52Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=24104f6ae3b472f712c8a3c9f6c83d3bffc0c230'/>
<id>urn:sha1:24104f6ae3b472f712c8a3c9f6c83d3bffc0c230</id>
<content type='text'>
[ Upstream commit 55efcfcd7776165b294f8b5cd6e05ca00ec89b7c ]

The RDMA core uses ib_pack() to convert from unpacked CPU structs
to on-the-wire bitpacked structs.

This process requires that 1 bit fields are declared as u8 in the
unpacked struct, otherwise the packing process does not read the
value properly and the packed result is wired to 0. Several
places wrongly used int.

Crucially this means the kernel has never, set reversible
correctly in the path record request. It has always asked for
irreversible paths even if the ULP requests otherwise.

When the kernel is used with a SM that supports this feature, it
completely breaks communication management if reversible paths are
not properly requested.

The only reason this ever worked is because opensm ignores the
reversible bit.

Cc: stable@vger.kernel.org
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Jason Gunthorpe &lt;jgunthorpe@obsidianresearch.com&gt;
Signed-off-by: Doug Ledford &lt;dledford@redhat.com&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@verizon.com&gt;
</content>
</entry>
<entry>
<title>IB/cma: Fix a race condition in iboe_addr_get_sgid()</title>
<updated>2017-01-13T01:56:58Z</updated>
<author>
<name>Bart Van Assche</name>
<email>bart.vanassche@sandisk.com</email>
</author>
<published>2016-12-19T17:00:05Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=c63e64ae7665e503efe720a97037d844db3a3038'/>
<id>urn:sha1:c63e64ae7665e503efe720a97037d844db3a3038</id>
<content type='text'>
[ Upstream commit fba332b079029c2f4f7e84c1c1cd8e3867310c90 ]

Code that dereferences the struct net_device ip_ptr member must be
protected with an in_dev_get() / in_dev_put() pair. Hence insert
calls to these functions.

Fixes: commit 7b85627b9f02 ("IB/cma: IBoE (RoCE) IP-based GID addressing")
Signed-off-by: Bart Van Assche &lt;bart.vanassche@sandisk.com&gt;
Reviewed-by: Moni Shoua &lt;monis@mellanox.com&gt;
Cc: Or Gerlitz &lt;ogerlitz@mellanox.com&gt;
Cc: Roland Dreier &lt;roland@purestorage.com&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Doug Ledford &lt;dledford@redhat.com&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@verizon.com&gt;
</content>
</entry>
<entry>
<title>IB/security: Restrict use of the write() interface</title>
<updated>2016-05-17T17:42:48Z</updated>
<author>
<name>Jason Gunthorpe</name>
<email>jgunthorpe@obsidianresearch.com</email>
</author>
<published>2016-04-11T01:13:13Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=5d43a619be6f1960702daafafe87ceab415be6bc'/>
<id>urn:sha1:5d43a619be6f1960702daafafe87ceab415be6bc</id>
<content type='text'>
[ Upstream commit e6bd18f57aad1a2d1ef40e646d03ed0f2515c9e3 ]

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 ]
Cc: stable@vger.kernel.org
Signed-off-by: Doug Ledford &lt;dledford@redhat.com&gt;

Signed-off-by: Sasha Levin &lt;sasha.levin@oracle.com&gt;
</content>
</entry>
<entry>
<title>IB/core: Fix unaligned accesses</title>
<updated>2015-05-05T17:21:27Z</updated>
<author>
<name>David Ahern</name>
<email>david.ahern@oracle.com</email>
</author>
<published>2015-05-03T13:48:26Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=0d0f738f6a11856a704dcd8fd3a008b200f17625'/>
<id>urn:sha1:0d0f738f6a11856a704dcd8fd3a008b200f17625</id>
<content type='text'>
Addresses the following kernel logs seen during boot of sparc systems:

Kernel unaligned access at TPC[103bce50] cm_find_listen+0x34/0xf8 [ib_cm]
Kernel unaligned access at TPC[103bce50] cm_find_listen+0x34/0xf8 [ib_cm]
Kernel unaligned access at TPC[103bce50] cm_find_listen+0x34/0xf8 [ib_cm]
Kernel unaligned access at TPC[103bce50] cm_find_listen+0x34/0xf8 [ib_cm]
Kernel unaligned access at TPC[103bce50] cm_find_listen+0x34/0xf8 [ib_cm]

Signed-off-by: David Ahern &lt;david.ahern@oracle.com&gt;
Signed-off-by: Doug Ledford &lt;dledford@redhat.com&gt;
</content>
</entry>
<entry>
<title>IB/core: change rdma_gid2ip into void function as it always return zero</title>
<updated>2015-05-05T17:21:27Z</updated>
<author>
<name>Honggang LI</name>
<email>honli@redhat.com</email>
</author>
<published>2015-04-29T09:40:44Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=471e70583217728955436a3fa6e5201e5c8c296a'/>
<id>urn:sha1:471e70583217728955436a3fa6e5201e5c8c296a</id>
<content type='text'>
Signed-off-by: Honggang Li &lt;honli@redhat.com&gt;
Acked-by: Sean Hefty &lt;sean.hefty@intel.com&gt;
Signed-off-by: Doug Ledford &lt;dledford@redhat.com&gt;
</content>
</entry>
<entry>
<title>RDMA/core: Enable the iWarp Port Mapper to provide the actual address of the connecting peer to its clients</title>
<updated>2015-05-05T13:18:01Z</updated>
<author>
<name>Tatyana Nikolova</name>
<email>Tatyana.E.Nikolova@intel.com</email>
</author>
<published>2015-04-21T20:28:10Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=6eec177461751f0fe191cf9977cde692b9481d0a'/>
<id>urn:sha1:6eec177461751f0fe191cf9977cde692b9481d0a</id>
<content type='text'>
Add functionality to enable the port mapper on the passive side to provide to its
clients the actual (non-mapped) ip/tcp address information of the connecting peer

1) Adding remote_info_cb() to process the address info of the connecting peer
   The address info is provided by the user space port mapper service when
   the connection is initiated by the peer
2) Adding a hash list to store the remote address info
3) Adding functionality to add/remove the remote address info
   After the info has been provided to the port mapper client,
   it is removed from the hash list

Signed-off-by: Tatyana Nikolova &lt;tatyana.e.nikolova@intel.com&gt;
Reviewed-by: Steve Wise &lt;swise@opengridcomputing.com&gt;
Signed-off-by: Doug Ledford &lt;dledford@redhat.com&gt;
</content>
</entry>
<entry>
<title>Revert "IB/core: Add support for extended query device caps"</title>
<updated>2015-02-06T08:54:33Z</updated>
<author>
<name>Yann Droneaud</name>
<email>ydroneaud@opteya.com</email>
</author>
<published>2015-02-05T21:10:18Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=43c6116573ca0f9fc907e6b46861f2f142acb33b'/>
<id>urn:sha1:43c6116573ca0f9fc907e6b46861f2f142acb33b</id>
<content type='text'>
While commit 7e36ef8205ff ("IB/core: Temporarily disable
ex_query_device uverb") is correct as it makes the extended
QUERY_DEVICE uverb (which came as part of commit 5a77abf9a97a
("IB/core: Add support for extended query device caps") and commit
860f10a799c8 ("IB/core: Add flags for on demand paging support")) not
available to userspace, it doesn't address the initial issue regarding
ib_copy_to_udata() [1][2].

Additionally, further discussions around this new uverb seems to
conclude it would require a different data structure than the one
currently described in &lt;rdma/ib_user_verbs.h&gt; [3].

Both of these issues require a revert of the changes, so this patch
partially reverts commit 8cdd312cfed7 ("IB/mlx5: Implement the ODP
capability query verb") and commit 860f10a799c8 ("IB/core: Add flags
for on demand paging support") and fully reverts commit 5a77abf9a97a
("IB/core: Add support for extended query device caps").

[1] "Re: [PATCH v3 06/17] IB/core: Add support for extended query device caps"
    http://mid.gmane.org/1418733236.2779.26.camel@opteya.com

[2] "Re: [PATCH] IB/core: Temporarily disable ex_query_device uverb"
    http://mid.gmane.org/1423067503.3030.83.camel@opteya.com

[3] "RE: [PATCH v1 1/5] IB/uverbs: ex_query_device: answer must not depend on request's comp_mask"
    http://mid.gmane.org/2807E5FD2F6FDA4886F6618EAC48510E0CC12C30@CRSMSX101.amr.corp.intel.com

Cc: Eli Cohen &lt;eli@mellanox.com&gt;
Cc: Haggai Eran &lt;haggaie@mellanox.com&gt;
Cc: Ira Weiny &lt;ira.weiny@intel.com&gt;
Cc: Jason Gunthorpe &lt;jgunthorpe@obsidianresearch.com&gt;
Cc: Sagi Grimberg &lt;sagig@mellanox.com&gt;
Cc: Shachar Raindel &lt;raindel@mellanox.com&gt;
Signed-off-by: Yann Droneaud &lt;ydroneaud@opteya.com&gt;
Signed-off-by: Roland Dreier &lt;roland@purestorage.com&gt;
</content>
</entry>
<entry>
<title>IB/core: Implement support for MMU notifiers regarding on demand paging regions</title>
<updated>2014-12-16T02:13:36Z</updated>
<author>
<name>Haggai Eran</name>
<email>haggaie@mellanox.com</email>
</author>
<published>2014-12-11T15:04:18Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=882214e2b12860bff1ccff15a3ec2bbb29d58c02'/>
<id>urn:sha1:882214e2b12860bff1ccff15a3ec2bbb29d58c02</id>
<content type='text'>
* Add an interval tree implementation for ODP umems. Create an
  interval tree for each ucontext (including a count of the number of
  ODP MRs in this context, semaphore, etc.), and register ODP umems in
  the interval tree.
* Add MMU notifiers handling functions, using the interval tree to
  notify only the relevant umems and underlying MRs.
* Register to receive MMU notifier events from the MM subsystem upon
  ODP MR registration (and unregister accordingly).
* Add a completion object to synchronize the destruction of ODP umems.
* Add mechanism to abort page faults when there's a concurrent invalidation.

The way we synchronize between concurrent invalidations and page
faults is by keeping a counter of currently running invalidations, and
a sequence number that is incremented whenever an invalidation is
caught. The page fault code checks the counter and also verifies that
the sequence number hasn't progressed before it updates the umem's
page tables. This is similar to what the kvm module does.

In order to prevent the case where we register a umem in the middle of
an ongoing notifier, we also keep a per ucontext counter of the total
number of active mmu notifiers. We only enable new umems when all the
running notifiers complete.

Signed-off-by: Sagi Grimberg &lt;sagig@mellanox.com&gt;
Signed-off-by: Shachar Raindel &lt;raindel@mellanox.com&gt;
Signed-off-by: Haggai Eran &lt;haggaie@mellanox.com&gt;
Signed-off-by: Yuval Dagan &lt;yuvalda@mellanox.com&gt;
Signed-off-by: Roland Dreier &lt;roland@purestorage.com&gt;
</content>
</entry>
<entry>
<title>IB/core: Add support for on demand paging regions</title>
<updated>2014-12-16T02:13:36Z</updated>
<author>
<name>Shachar Raindel</name>
<email>raindel@mellanox.com</email>
</author>
<published>2014-12-11T15:04:17Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=8ada2c1c0c1d75a60723cd2ca7d49c594a146af6'/>
<id>urn:sha1:8ada2c1c0c1d75a60723cd2ca7d49c594a146af6</id>
<content type='text'>
* Extend the umem struct to keep the ODP related data.
* Allocate and initialize the ODP related information in the umem
  (page_list, dma_list) and freeing as needed in the end of the run.
* Store a reference to the process PID struct in the ucontext.  Used to
  safely obtain the task_struct and the mm during fault handling,
  without preventing the task destruction if needed.
* Add 2 helper functions: ib_umem_odp_map_dma_pages and
  ib_umem_odp_unmap_dma_pages. These functions get the DMA addresses
  of specific pages of the umem (and, currently, pin them).
* Support for page faults only - IB core will keep the reference on
  the pages used and call put_page when freeing an ODP umem
  area. Invalidations support will be added in a later patch.

Signed-off-by: Sagi Grimberg &lt;sagig@mellanox.com&gt;
Signed-off-by: Shachar Raindel &lt;raindel@mellanox.com&gt;
Signed-off-by: Haggai Eran &lt;haggaie@mellanox.com&gt;
Signed-off-by: Majd Dibbiny &lt;majd@mellanox.com&gt;
Signed-off-by: Roland Dreier &lt;roland@purestorage.com&gt;
</content>
</entry>
</feed>
