Re: [PATCH v2 iproute2-next 2/3] rdma: Add an option to set privileged QKEY parameter

From: Petr Machata
Date: Tue Oct 24 2023 - 12:08:37 EST



Patrisious Haddad <phaddad@xxxxxxxxxx> writes:

> Enrich rdmatool with an option to enable or disable privileged QKEY.
> When enabled, non-privileged users will be allowed to specify a
> controlled QKEY.
>
> By default this parameter is disabled in order to comply with IB spec.
> According to the IB specification rel-1.6, section 3.5.3:
> "QKEYs with the most significant bit set are considered controlled
> QKEYs, and a HCA does not allow a consumer to arbitrarily specify a
> controlled QKEY."
>
> This allows old applications which existed before the kernel commit:
> 0cadb4db79e1 ("RDMA/uverbs: Restrict usage of privileged QKEYs")
> they can use privileged QKEYs without being a privileged user to now
> be able to work again without being privileged granted they turn on this
> parameter.
>
> rdma tool command examples and output.
>
> $ rdma system show
> netns shared privileged-qkey off copy-on-fork on
>
> $ rdma system set privileged-qkey on
>
> $ rdma system show
> netns shared privileged-qkey on copy-on-fork on
>
> Signed-off-by: Patrisious Haddad <phaddad@xxxxxxxxxx>
> Reviewed-by: Michael Guralnik <michaelgur@xxxxxxxxxx>

Again, I'm not familiar with the subject matter, but mechanically this
looks OK to me.

Reviewed-by: Petr Machata <petrm@xxxxxxxxxx>