<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/infiniband/core/cache.c, branch v4.14.263</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v4.14.263</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v4.14.263'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2018-06-05T09:41:59+00:00</updated>
<entry>
<title>IB/core: Fix error code for invalid GID entry</title>
<updated>2018-06-05T09:41:59+00:00</updated>
<author>
<name>Parav Pandit</name>
<email>parav@mellanox.com</email>
</author>
<published>2018-05-27T11:49:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=4a1b66bcec03fe411be108bc18cfc9bc1b392e38'/>
<id>urn:sha1:4a1b66bcec03fe411be108bc18cfc9bc1b392e38</id>
<content type='text'>
commit a840c93ca7582bb6c88df2345a33f979b7a67874 upstream.

When a GID entry is invalid EAGAIN is returned. This is an incorrect error
code, there is nothing that will make this GID entry valid again in
bounded time.

Some user space tools fail incorrectly if EAGAIN is returned here, and
this represents a small ABI change from earlier kernels.

The first patch in the Fixes list makes entries that were valid before
to become invalid, allowing this code to trigger, while the second patch
in the Fixes list introduced the wrong EAGAIN.

Therefore revert the return result to EINVAL which matches the historical
expectations of the ibv_query_gid_type() API of the libibverbs user space
library.

Cc: &lt;stable@vger.kernel.org&gt;
Fixes: 598ff6bae689 ("IB/core: Refactor GID modify code for RoCE")
Fixes: 03db3a2d81e6 ("IB/core: Add RoCE GID table management")
Reviewed-by: Daniel Jurgens &lt;danielj@mellanox.com&gt;
Signed-off-by: Parav Pandit &lt;parav@mellanox.com&gt;
Signed-off-by: Leon Romanovsky &lt;leonro@mellanox.com&gt;
Signed-off-by: Jason Gunthorpe &lt;jgg@mellanox.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>RDMA/(core, ulp): Convert register/unregister event handler to be void</title>
<updated>2017-08-24T20:27:10+00:00</updated>
<author>
<name>Leon Romanovsky</name>
<email>leonro@mellanox.com</email>
</author>
<published>2017-08-17T12:50:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=dcc9881e6767559c04faf15804ac145a2ea026cb'/>
<id>urn:sha1:dcc9881e6767559c04faf15804ac145a2ea026cb</id>
<content type='text'>
The functions ib_register_event_handler() and
ib_unregister_event_handler() always returned success and they can't fail.

Let's convert those functions to be void, remove redundant checks and
cleanup tons of goto statements.

Signed-off-by: Leon Romanovsky &lt;leonro@mellanox.com&gt;
Reviewed-by: Dennis Dalessandro &lt;dennis.dalessandro@intel.com&gt;
Signed-off-by: Doug Ledford &lt;dledford@redhat.com&gt;
</content>
</entry>
<entry>
<title>IB/core: Enforce PKey security on QPs</title>
<updated>2017-05-23T16:26:59+00:00</updated>
<author>
<name>Daniel Jurgens</name>
<email>danielj@mellanox.com</email>
</author>
<published>2017-05-19T12:48:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=d291f1a6523292d916fe1659c67f6db061fbd1b5'/>
<id>urn:sha1:d291f1a6523292d916fe1659c67f6db061fbd1b5</id>
<content type='text'>
Add new LSM hooks to allocate and free security contexts and check for
permission to access a PKey.

Allocate and free a security context when creating and destroying a QP.
This context is used for controlling access to PKeys.

When a request is made to modify a QP that changes the port, PKey index,
or alternate path, check that the QP has permission for the PKey in the
PKey table index on the subnet prefix of the port. If the QP is shared
make sure all handles to the QP also have access.

Store which port and PKey index a QP is using. After the reset to init
transition the user can modify the port, PKey index and alternate path
independently. So port and PKey settings changes can be a merge of the
previous settings and the new ones.

In order to maintain access control if there are PKey table or subnet
prefix change keep a list of all QPs are using each PKey index on
each port. If a change occurs all QPs using that device and port must
have access enforced for the new cache settings.

These changes add a transaction to the QP modify process. Association
with the old port and PKey index must be maintained if the modify fails,
and must be removed if it succeeds. Association with the new port and
PKey index must be established prior to the modify and removed if the
modify fails.

1. When a QP is modified to a particular Port, PKey index or alternate
   path insert that QP into the appropriate lists.

2. Check permission to access the new settings.

3. If step 2 grants access attempt to modify the QP.

4a. If steps 2 and 3 succeed remove any prior associations.

4b. If ether fails remove the new setting associations.

If a PKey table or subnet prefix changes walk the list of QPs and
check that they have permission. If not send the QP to the error state
and raise a fatal error event. If it's a shared QP make sure all the
QPs that share the real_qp have permission as well. If the QP that
owns a security structure is denied access the security structure is
marked as such and the QP is added to an error_list. Once the moving
the QP to error is complete the security structure mark is cleared.

Maintaining the lists correctly turns QP destroy into a transaction.
The hardware driver for the device frees the ib_qp structure, so while
the destroy is in progress the ib_qp pointer in the ib_qp_security
struct is undefined. When the destroy process begins the ib_qp_security
structure is marked as destroying. This prevents any action from being
taken on the QP pointer. After the QP is destroyed successfully it
could still listed on an error_list wait for it to be processed by that
flow before cleaning up the structure.

If the destroy fails the QPs port and PKey settings are reinserted into
the appropriate lists, the destroying flag is cleared, and access control
is enforced, in case there were any cache changes during the destroy
flow.

To keep the security changes isolated a new file is used to hold security
related functionality.

Signed-off-by: Daniel Jurgens &lt;danielj@mellanox.com&gt;
Acked-by: Doug Ledford &lt;dledford@redhat.com&gt;
[PM: merge fixup in ib_verbs.h and uverbs_cmd.c]
Signed-off-by: Paul Moore &lt;paul@paul-moore.com&gt;
</content>
</entry>
<entry>
<title>IB/core: IB cache enhancements to support Infiniband security</title>
<updated>2017-05-23T14:24:17+00:00</updated>
<author>
<name>Daniel Jurgens</name>
<email>danielj@mellanox.com</email>
</author>
<published>2017-05-19T12:48:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=883c71feaf2e810e0331cf780c738cbb09e93b58'/>
<id>urn:sha1:883c71feaf2e810e0331cf780c738cbb09e93b58</id>
<content type='text'>
Cache the subnet prefix and add a function to access it. Enforcing
security requires frequent queries of the subnet prefix and the pkeys in
the pkey table.

Signed-off-by: Daniel Jurgens &lt;danielj@mellanox.com&gt;
Reviewed-by: Eli Cohen &lt;eli@mellanox.com&gt;
Reviewed-by: Leon Romanovsky &lt;leonro@mellanox.com&gt;
Reviewed-by: James Morris &lt;james.l.morris@oracle.com&gt;
Acked-by: Doug Ledford &lt;dledford@redhat.com&gt;
Signed-off-by: Paul Moore &lt;paul@paul-moore.com&gt;
</content>
</entry>
<entry>
<title>IB/core: Add inline function to validate port</title>
<updated>2017-01-27T19:33:59+00:00</updated>
<author>
<name>Yuval Shaia</name>
<email>yuval.shaia@oracle.com</email>
</author>
<published>2017-01-25T16:41:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=24dc831b77eca9361cf835be59fa69ea0e471afc'/>
<id>urn:sha1:24dc831b77eca9361cf835be59fa69ea0e471afc</id>
<content type='text'>
Signed-off-by: Yuval Shaia &lt;yuval.shaia@oracle.com&gt;
Reviewed-by: Leon Romanovsky &lt;leonro@mellanox.com&gt;
Signed-off-by: Doug Ledford &lt;dledford@redhat.com&gt;
</content>
</entry>
<entry>
<title>RDMA/core: create struct ib_port_cache</title>
<updated>2017-01-24T21:20:37+00:00</updated>
<author>
<name>Jack Wang</name>
<email>jinpu.wang@profitbricks.com</email>
</author>
<published>2017-01-17T09:11:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=21d6454a392d552c7e845f39884f7cf86f9426b9'/>
<id>urn:sha1:21d6454a392d552c7e845f39884f7cf86f9426b9</id>
<content type='text'>
As Jason suggested, we have 4 elements for per port arrays,
it's better to have a separate structure to represent them.

It simplifies code a bit, ~ 30 lines of code less :)

Signed-off-by: Jack Wang &lt;jinpu.wang@profitbricks.com&gt;
Reviewed-by: Michael Wang &lt;yun.wang@profitbricks.com&gt;
Signed-off-by: Doug Ledford &lt;dledford@redhat.com&gt;
</content>
</entry>
<entry>
<title>RDMA/core: export ib_get_cached_port_state</title>
<updated>2017-01-13T04:00:00+00:00</updated>
<author>
<name>Jack Wang</name>
<email>jinpu.wang@profitbricks.com</email>
</author>
<published>2017-01-02T12:19:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=9e2c3f1c7f3edc6bdd83dab601418ac6c3b6df73'/>
<id>urn:sha1:9e2c3f1c7f3edc6bdd83dab601418ac6c3b6df73</id>
<content type='text'>
Export function for rdma_cm, patch for rdma_cm to follow.

Signed-off-by: Jack Wang &lt;jinpu.wang@profitbricks.com&gt;
Reviewed-by: Michael Wang &lt;yun.wang@profitbricks.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: add port state cache</title>
<updated>2017-01-13T03:59:55+00:00</updated>
<author>
<name>Jack Wang</name>
<email>jinpu.wang@profitbricks.com</email>
</author>
<published>2017-01-02T12:17:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=aaaca121c7cf9217ab81d9db0a04835d52aabebe'/>
<id>urn:sha1:aaaca121c7cf9217ab81d9db0a04835d52aabebe</id>
<content type='text'>
We need a port state cache in ib_core, later we will use in rdma_cm.

Signed-off-by: Jack Wang &lt;jinpu.wang@profitbricks.com&gt;
Reviewed-by: Michael Wang &lt;yun.wang@profitbricks.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>IB/core: Release allocated memory in cache setup failure</title>
<updated>2016-12-03T18:12:52+00:00</updated>
<author>
<name>Leon Romanovsky</name>
<email>leon@kernel.org</email>
</author>
<published>2016-11-03T14:44:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=aa6aae38f7fb2c030f326a6dd10b58fff1851dfa'/>
<id>urn:sha1:aa6aae38f7fb2c030f326a6dd10b58fff1851dfa</id>
<content type='text'>
The failure in ib_cache_setup_one function during
ib_register_device will leave leaked allocated memory.

Fixes: 03db3a2d81e6 ("IB/core: Add RoCE GID table management")
Signed-off-by: Leon Romanovsky &lt;leon@kernel.org&gt;
Signed-off-by: Doug Ledford &lt;dledford@redhat.com&gt;
</content>
</entry>
<entry>
<title>IB/core: Fix no default GIDs when netdevice reregisters</title>
<updated>2016-06-23T14:03:57+00:00</updated>
<author>
<name>Talat Batheesh</name>
<email>talatb@mellanox.com</email>
</author>
<published>2016-06-22T14:27:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f336ae03149725bb5844166c7b04f7f65f17eec9'/>
<id>urn:sha1:f336ae03149725bb5844166c7b04f7f65f17eec9</id>
<content type='text'>
Currently, when the netdevice returned by get_netdev is unregistered,
we delete all GIDs (including the default GIDs) and reset their
attributes. Therefore, when we re-register it, no default GIDs
will be assigned (as their "default GID") attribute will be reset.
Fixing this by keeping "default GID" attribute.

Fixes: 03db3a2d81e6 ('IB/core: Add RoCE GID table management')
Signed-off-by: Talat Batheesh &lt;talatb@mellanox.com&gt;
Signed-off-by: Leon Romanovsky &lt;leon@kernel.org&gt;
Signed-off-by: Doug Ledford &lt;dledford@redhat.com&gt;
</content>
</entry>
</feed>
