🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #12575

Re: [PATCH rdma-next 06/23] RDMA/mlx5: Require IB_QPT_DRIVER for the DC vendor QP types

#12575
From: netdev-bot+sashiko
Date: Sat, 07 Nov 2026 20:24
75 lines
10587 bytes
Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.

Critical: 0 · High: 0 · Medium: 1 · Low: 0

If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).

- [Medium] The commit "RDMA/mlx5: Require IB_QPT_DRIVER for the DC vendor
  QP types" fixes a regression that userspace can trigger, but its…

--

RDMA/mlx5: Require IB_QPT_DRIVER for the DC vendor QP types

This patch changes process_vendor_flags() in drivers/infiniband/hw/mlx5/qp.c
so that it rejects MLX5_QP_FLAG_TYPE_DCI and MLX5_QP_FLAG_TYPE_DCT unless
the QP was requested as IB_QPT_DRIVER. Without this check, an RC/UC/UD QP
that carries a DC flag becomes a DC QP and skips the dct capability check
in check_qp_type().

> Accept the DC type flags only on IB_QPT_DRIVER, the type userspace
> uses to create DC QPs.
>
> Signed-off-by: Yishai Hadas <yishaih@nvidia.com>

[Severity: Medium]
Should this patch carry a Fixes: tag and Cc: stable? Userspace can reach
the behavior it fixes, and nothing in the message tells stable maintainers
to pick it up.

The problem seems to come from commit 37518fa49f76 ("RDMA/mlx5: Process
all vendor flags in one place"). That commit changed the guard around the
process_vendor_flags() call in the create path from:

    if (init_attr->qp_type == IB_QPT_DRIVER)

to:

    if (udata)

After that, the DCI/DCT type flags were processed for every user QP type.

Commit 7aede1a25f4b ("RDMA/mlx5: Store QP type in the vendor QP
structure") then made the switch in process_vendor_flags() write
qp->type = MLX5_IB_QPT_DCI or MLX5_IB_QPT_DCT directly. It still did not
check which type was requested.

>From then on, an unprivileged verbs user can create an IB_QPT_RC QP with
MLX5_QP_FLAG_TYPE_DCT set in the ucmd flags and get this path:

mlx5_ib_create_qp()
  check_qp_type()          <- dct cap only checked for IB_QPT_DRIVER
  qp->type = IB_QPT_RC;
  process_vendor_flags()
    qp->type = MLX5_IB_QPT_DCT;
  check_qp_attr()
  create_qp()

check_qp_attr(), create_qp() and the modify/query/destroy paths then
dispatch on the mlx5 qp->type. Meanwhile ibqp->qp_type still says
IB_QPT_RC.

Since this goes back to the 2020 refactor (v5.8), would something like
the following be appropriate?

Fixes: 37518fa49f76 ("RDMA/mlx5: Process all vendor flags in one place")
Cc: stable@vger.kernel.org

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261103163949.1554-1-yishaih%40nvidia.com
Technical Details
Message-ID: <179408308744.994134.2975103686531354002@kernel.org>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-358503-linux-kernel-netdev=dewy.ru
References: <20261103163949.1554-7-yishaih@nvidia.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-358503-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH rdma-next 06/23] RDMA/mlx5: Require IB_QPT_DRIVER for the
 DC vendor QP types
Date: Sat, 07 Nov 2026 20:24:47 +0000
Organization: Usenet Network
Message-ID: <179408308744.994134.2975103686531354002@kernel.org>
References: <20261103163949.1554-7-yishaih@nvidia.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="4186741"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:ZjNEM3JR8QlzgeWewi73BDI6fvk= sha256:HcXng0vit9zQ6W6isObYTONu60XDeKAgO1sMZWG1Q9I=
	sha1:iOCKSaKgEQCzfmaRKOKRAyOfYp0= sha256:044GVk6HHR0bwBuMYcGh5b8jtG3m6VJcF5vV9Dv7o0s=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 5BE1D1134A8; Sat,  7 Nov 2026 23:28:24 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.401
X-Spam-Status: No, score=-3.401 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1,
	DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=kernel.org
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id IMbvXlnjkc7u;
	Sat,  7 Nov 2026 23:28:21 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-358503-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id C0DAC11349C; Sat,  7 Nov 2026 23:28:12 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id 9D69263C99; Sat,  7 Nov 2026 20:24:55 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1794083095;
	b=Zd/jFhH22Z9rjWcWpVtTmALQ6QJ9GJaM41Sc4b3/9fFDcnlPnu5wyk9OSNRsmdOVFh/1
	 Uyrrl3fCAd4A9xHkwbgRzgglQZqvNajsrdD7s+x19IY9nIp8eSmNNz2zfHy2IHQBLPRXA
	 aBPob8+DNAt1Gl21ek/FA+PibKtpr+woJXLXiWpIZWAKM8UdFLiO+RwPR5Dq1TpaQd1al
	 /HhHGim62YSEgWFCO6X7EnGR9VvmUb064TfxnrcRA6juIu+SwLqM6G2EAri8Q5m3+T20h
	 r3JXcg/nzAUb16YxD/KXcuTiTlURKVHLpoE+dATONWSxCJvyCy36h/rBA9vWMuhVcxQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794083095;
	h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc:
	 Date:Message-ID:In-Reply-To:References:X-sashiko-severity:
	 Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id:
	 List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner:
	 Precedence:MIME-Version;
	bh=Unnn47eIJH+VWHbuiao6Wl8xY049BGGS8bKARiEkrUk=;
	b=HJujhhnviYMbU2sBXnpjA6gZNgCNHMsl7Fj0WsEs6d89kUsmU3vU2Inike4Qx9pWWIdn
	 YvgZV/NxrGhm9SJ/11sj3NYus3Q/jeKtZYphSWMLuuKDKtlHWoGQ98JDED1vXmWYbOcn7
	 EEh4Zmtvqny1R/jBoyrwYwCOzsPG/svXOJRc/uugcw3mDuK19Wabnb4rjv7IRpUt3EB0J
	 hhgi7+5mNtBNJLX4sJsPL6xkR4wjT9tqr0qbsp98Doj2YCK8Hccok6+1hZPL0riGXdPKD
	 MrHfHVJ2bh40js/wgY1ZF232+qZjeVrJwGYtBwqxD9nUhO9Ioh1grn4F3+TRzvHrecA==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=W0gpbalT;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id DD006606D80D;
	Sat,  7 Nov 2026 20:24:54 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=W0gpbalT
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1794083089;
	b=fHmq8Gt4A68VO6HnzAz5y5Zm6xKGfGOrr3IEVN8cnVtEpT+JOv5CP9WWeZs7S9sxOlEf
	 ezQEvZaZNzc3946WGtxg+yVV5+A8PnDkYb4xT4dgLr1+fVXEWeDMNwTtnzuZRsY5KY8CT
	 42uY4ikzaKZItIXPfv3dFxNSdzkDUjoruDec7QU8z/xofFOIH4IOpNvtdUHDLKsB2qx9A
	 FYXPSBzdXoOnHCetc4KeROGO8mukCw8k1gwbXX6sDhgKXcczdan7xqneseqw0yfpxxHyo
	 A1NRipT6M8N9pF8fxb3ALIdQTKgivWQVTwfpfLz7BHp1VFeBfc/Ktlrz7YLCRkmW+Vg==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794083089;
	h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID:
	 In-Reply-To:References:X-sashiko-severity:Content-Type:
	 Content-Transfer-Encoding:MIME-Version;
	bh=Unnn47eIJH+VWHbuiao6Wl8xY049BGGS8bKARiEkrUk=;
	b=pT+ytLNJtsDqnRAfQSgQRzR/lUMp/lFa/M42hzivUx+H3pZ6KpqZRVtD/7C06M0mF4kK
	 xrQqw7Wh45j9xrgNZWVeKvffOZzJAf6igbF4i5spm4CUaRCAZZ4B1G3eSqP5F/T+yINeg
	 6WpkPok/xWp5E0xp5fmIltGRaXIsL2kR01pYgUZxYes6y/rQYbeOp5Q/UnHLSDpNl2uiC
	 /BBbgAIuNnnab6UFnXneRPE7J6JdudS5GgWN73O2gPzxuf5s+JVxpqrhVBg5RJgJqc1bJ
	 wV9XWeAwmzJ++MTnabDq0Z4UXwxu6nWZd8/0qPh8RBSRP8l6jYrhTo39rxuxZsqmqDg==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=W0gpbalT;
	arc=none smtp.remote-ip=100.103.45.18
X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id BFC10606A326;
	Sat,  7 Nov 2026 20:24:48 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id D24321F0089F;
	Sat,  7 Nov 2026 20:24:47 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1794083088;
	bh=Unnn47eIJH+VWHbuiao6Wl8xY049BGGS8bKARiEkrUk=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=W0gpbalT/l2tMx3qCy1scnm6UeLUU4v24bTnFhvTV/zYbp1lfSj09YOHe61A0jiVp
	 /WV7TMGigrAhkNjCLz+DBbVwMLUaIU5QnG4U1IKBKtYTe5t3lcyfsigCJW/FntZ7JJ
	 MgWkaSLmia5L0dJGAgmf3ZDIgEHtyhNXeP/XiCe7tgCu//g8i2SmgK2kvwz8RAEBCU
	 nqP8rphQG8sjk9bj1+9PtnF2+tJvMZPwrcYTaZ5LDqit6U084DiA7lSJN1KYPKF/jV
	 iDGweRpBWUbLFTReM+lnqJt3B8NWdbTL3UZ1sMP/I2EXPj5PQy6RpjVe1M44DNsYll
	 jBMWi4ZziBoJw==
X-Cc: jgg@ziepe.ca, leon@kernel.org, linux-rdma@vger.kernel.org,
 netdev@vger.kernel.org, saeedm@nvidia.com, tariqt@nvidia.com,
 mbloch@nvidia.com, kuba@kernel.org, pabeni@redhat.com, edumazet@kernel.org,
 davem@davemloft.net, andrew+netdev@lunn.ch, dtatulea@nvidia.com,
 moshe@nvidia.com, maorg@nvidia.com
X-In-Reply-To: <20261103163949.1554-7-yishaih@nvidia.com>
X-sashiko-severity: Medium
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list