Thread View: linux.kernel.netdev
1 messages
1 total messages
Started by Leon Romanovsky
Mon, 16 Nov 2026 08:58
Re: [PATCH V1 rdma-next 09/24] RDMA/core: Suppress kverbs_provider for adversarial_mode devices
Author: Leon Romanovsky
Date: Mon, 16 Nov 2026 08:58
Date: Mon, 16 Nov 2026 08:58
63 lines
10037 bytes
10037 bytes
On Tue, Nov 10, 2026 at 03:43:05PM +0200, Yishai Hadas wrote:
> In adversarial mode the NIC is not trusted. Kernel ULPs such as MAD,
> IB CM, rdma_cm, IPoIB, SRP, iSER and NVMe-oF trust what the device
> reports, its completions and the data it writes, so they must not use
> such a device.
>
> Add an adversarial_mode field to struct ib_device and clear
> kverbs_provider when it is set. add_client_context() then skips every
> client but uverbs, the only one that sets no_kverbs_req, so the kernel
> ULPs never bind to the device.
>
> The driver still implements the kverbs ops, as the uverbs path shares
> them, so kverbs_provider can't be cleared by the existing check of the
> mandatory ops.
>
> Signed-off-by: Yishai Hadas <yishaih@nvidia.com>
> ---
> drivers/infiniband/core/device.c | 8 ++++++++
> include/rdma/ib_verbs.h | 2 ++
> 2 files changed, 10 insertions(+)
>
> diff --git a/drivers/infiniband/core/device.c b/drivers/infiniband/core/device.c
> index 29af9fe860e2..eb6aa567d365 100644
> --- a/drivers/infiniband/core/device.c
> +++ b/drivers/infiniband/core/device.c
> @@ -312,6 +312,14 @@ static void ib_device_check_mandatory(struct ib_device *device)
> break;
> }
> }
> +
> + /*
> + * Kernel ULPs must not bind to an adversarial_mode device. Its kverbs
> + * ops are still present, as uverbs uses them, so clear kverbs_provider
> + * explicitly. uverbs sets no_kverbs_req, so it still binds.
> + */
> + if (device->adversarial_mode)
In previous patch, you talked that adversarial is global for all
devices, but here you add per-device flag.
Thanks
> + device->kverbs_provider = false;
> }
>
> /*
> diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
> index d6eaa3fee66e..6209a5166f0d 100644
> --- a/include/rdma/ib_verbs.h
> +++ b/include/rdma/ib_verbs.h
> @@ -3008,6 +3008,8 @@ struct ib_device {
> u16 use_cq_dim:1;
> /* CoCo guest with DMA bounce buffering required */
> u16 cc_dma_bounce:1;
> + /* Untrusted-NIC, adversarial mode is required */
> + u8 adversarial_mode;
> u8 node_type;
> u32 phys_port_cnt;
> struct ib_device_attr attrs;
> --
> 2.18.1
>
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads