🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #3848

[PATCH net-next v1 0/4] net/mlx5: Don't free CQs whose destroy failed

#3848
From: Yuho Choi
Date: Fri, 16 Oct 2026 04:57
39 lines
9829 bytes
mlx5_core_destroy_cq() can fail, and when it does the CQ may still
exist in firmware with access to its buffer and doorbell record. It
also returns early in that case, without waiting for EQ handlers that
may already hold a reference to the CQ. The four helpers in this series
ignore that error and free the CQ buffer anyway, while their teardown
paths also free the object that embeds the struct mlx5_core_cq.

Keep the buffer and the object that embeds the CQ when DESTROY_CQ
fails, as the regular mlx5_ib CQ destroy path does. The HWS send ring
CQs are polled and never armed, so the HWS patch keeps only their
buffer rather than passing the error up through the queue open and
close paths.

The issues were found with a static analysis tool from ongoing, not yet
published research, and confirmed by code inspection. None of them was
reproduced, so this targets net-next; I can resend for net if you
prefer.

Compile-tested only (x86_64 defconfig with MLX5_CORE_EN, MLX5_ESWITCH,
MLX5_SW_STEERING and MLX5_HW_STEERING, W=1).

Yuho Choi (4):
  net/mlx5: Don't free the ASO CQ if destroying it fails
  net/mlx5: Don't free the WC test CQ if destroying it fails
  net/mlx5: DR, Don't free the send ring CQ if destroying it fails
  net/mlx5: HWS, Don't free the send ring CQ buffer if destroying the CQ
    fails

 .../net/ethernet/mellanox/mlx5/core/lib/aso.c  | 18 +++++++++++++-----
 .../mellanox/mlx5/core/steering/hws/send.c     |  4 +++-
 .../mellanox/mlx5/core/steering/sws/dr_send.c  |  4 +++-
 drivers/net/ethernet/mellanox/mlx5/core/wc.c   | 17 ++++++++++++-----
 4 files changed, 31 insertions(+), 12 deletions(-)


base-commit: 2f2f7eeef8b0a1a9b9ca998231419873ccae8d4e
-- 
2.43.0
Technical Details
Message-ID: <20261016045849.813696-6-oss.patchbox@gmail.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-347114-linux-kernel-netdev=dewy.ru

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-347114-linux-kernel-netdev=dewy.ru
From: oss.patchbox@gmail.com (Yuho Choi)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net-next v1 0/4] net/mlx5: Don't free CQs whose destroy failed
Date: Fri, 16 Oct 2026 00:57:45 -0400
Organization: Usenet Network
Message-ID: <20261016045849.813696-6-oss.patchbox@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="2688824"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:loklaCLqV8kN4Ds0EEaPwt/Nh1k= sha256:xf9TDRHigxwDTZgiW60j9Mb79b/NTYpUrrzvgx1tBBc=
	sha1:atKftJ9QCf4S8kMVw3l4mZTB0gU= sha256:e8tUbAdceQQJIJwod+Ipz01XtmRsb0aqAyAu0ZD1LPw=
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 7FDED110466; Fri, 16 Oct 2026 07:59:14 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -0.748
X-Spam-Status: No, score=-0.748 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	DKIM_VALID_AU=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001,
	FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25,
	MAILING_LIST_MULTI=-1, 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=gmail.com
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 sI_S5Qr2q73h;
	Fri, 16 Oct 2026 07:59:12 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-347114-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=gmail.com
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id BE5D2110464; Fri, 16 Oct 2026 07:59:03 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1])
	by sea.lore.kernel.org (Postfix) with ESMTP id D1DC6350D8; Fri, 16 Oct 2026 04:59:00 +0000 (UTC)
X-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 01AD23587A2;
	Fri, 16 Oct 2026 04:59:00 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="JnxlVo9G"
X-Received: from mail-qk1-f181.google.com (mail-qk1-f181.google.com [209.85.222.181])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id A598C28B4FD
	for <netdev@vger.kernel.org>; Fri, 16 Oct 2026 04:58:58 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.181
X-ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1792126739; cv=none; b=qE/k1RicvyxQMqbpnYoHeoSiEINBDrAKnTK4Ov48/bd9SQwkMdw9QLb7eu80AQNo4HlsNc7M7uk2knTLbf2QCtYvBsii5//pUS5htR/NS9nzyRxdc5vVqVrDCUTM7MXuA3WGlZpQQASA/r06TltTtigdEWJtCxf3I+TB2lfG50E=
X-ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1792126739; c=relaxed/simple;
	bh=a2BsZE6dv+6I+aTRbpX17rDQThX3Q83NqPSPwlUFrFo=;
	h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=nKHHDd+feq6G6m8kjo42SEKO0Z2A2UKrr3wp+nsN/6WL902/ZZj8RKTMrTjFQdJKGOBi2SbC1suAPSOjc50Bav6kgLia6V9ovhSPGneh1Z6OILQd5ww8a61QMdDudVRtktCsRhtnv3brK9RKvmmwKShFyezUsgaZAZSe04V1HxE=
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=JnxlVo9G; arc=none smtp.client-ip=209.85.222.181
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com
X-Received: by mail-qk1-f181.google.com with SMTP id af79cd13be357-93e515769d3so519956385a.3
        for <netdev@vger.kernel.org>; Thu, 15 Oct 2026 21:58:58 -0700 (PDT)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1792126737; x=1792731537; darn=vger.kernel.org;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to:content-type;
        bh=ygeSD0sT4ambcFZx7uodzqrYQ3oDSNoYKD5DO2Bfnek=;
        b=JnxlVo9GK/SxFWH83zIzE7Ln92P7qT8WzoJbKQaU5MxKnuGFIA6cF4tTHTABGoI7dS
         4G956IwfIP0jBP604igZtoy+aD5o9IuIUksGcAfYrYDGR/uY4qb6frDVuPGQMzN9meme
         ooWgXhfCKaPWCazuQVC9PvVbUjfBDzHOW+/vtARIaqZZRwiFfNwulsNqOv9X3JVaCjlL
         /OvuPu4GuGKuoe7SUCgagj5l5/5i1No1/wg8I05bI02/8OUgV8ECZ+vgJoAOgN5ASe6j
         UvF9x2MASDV0K1nGkJf+5+NG2VTxn6I6BjRCZJSPu7j9DLw0YEwbjq5jXWvFhJhEjnpQ
         adnA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20260707; t=1792126737; x=1792731537;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=ygeSD0sT4ambcFZx7uodzqrYQ3oDSNoYKD5DO2Bfnek=;
        b=SFY6EYIuCU11Lhh7I6I12M+XrsYOUOh3LRjgK4brFhnkF4E1FTGJCEe8BZ9g0Nx/jO
         8kJFOsQo5mMyPm0ckff7YTkpwucYVz3d1HyNkOlS49l6h1OFYKMPVYeNXhSTdVJ4+3p4
         kt7m9OlAdzrs6mB9Vn75Goh76KNAvJ+uM8JnwnyvPjXFNOCfOL4hmQKsaZ2f/zAgQCZA
         dQRiAkjPW5gw/HVKC+njmo232YE61ri+ij+HcoYnLxepjy/ZegWb9P4t0wPfomsom3cJ
         wjLr17cqPMc6kg9a6ni4g8uqQhkxZdEwHdbeQq143qsXSIWnO3z2bAg01BEQqb3k+pTv
         SA/Q==
X-Forwarded-Encrypted: i=1; AKwUvBx6l+DR94BOhWONovI77EWDdXL/XPCzRWbYXji7PbQ5U5H2vf50eKiTDfO0cL6WNeF04CBRzd0=@vger.kernel.org
X-Gm-Message-State: AFq9FYK2HCtnsuNqw1W1enFeMlPqLaK8se4LUnWgvCqYFS+DPzr295gz
	5ad/DUaKtGCT6ApNENopUB7EeeyLELxF8o1hE/yj5BV1LndgiL9mteXn
X-Gm-Gg: AYBFou0svuPuWUUMN9cnyBwFvCbNTwH88SJItar3PqKLCYhefIcz0tfDMvOldtxMg3M
	yw1LCep6gN4p8iq9DJ8mFuIGZcjhoTv1Bh0DGBN1UHqJVWG8phSS85ZDz1t4HgpLLSUodE+o6HW
	Z3jg4Ptrsf3XfENys4nrbIGd80SLq7IvV3omfxMEVS2jqammc+89qlm21RvSrZtBVdgNCI8BtuQ
	ytv3/obNPyqWtZTmJ/NELWvRJhoZYmEIVZ/4qspIgEorc/hSyNx5xHYd2vPvJQ3HSEA7xm50C2h
	8BDqvED898f80vWXLfgdo3avZdrkGnTI8lGLAn/BIe+7xaLZMCwiB1vsn7ObstDbnh1ATH3CS9V
	OFLXDZABmMBA8XBy9MXQruiP4qRYI0fD8I85o5dTPXOwjqJDkNY8bN4LBhNzC8ah+GRefN+zAwB
	27R2YWtIsVKrshFV5xoeVCIlFYIz+RNxVPukpmOYYzbdeSLwpV9mU+3DxYf+AuFLmC4fjLBGgcI
	NHtgG0YHJsXz0mBcfTGjQ==
X-Received: by 2002:a05:620a:470b:b0:93c:2c0e:7ac with SMTP id af79cd13be357-93ebd259cafmr2987788785a.53.1792126737441;
        Thu, 15 Oct 2026 21:58:57 -0700 (PDT)
X-Received: from i4-gl-tmk5904.ad.psu.edu ([130.203.156.186])
        by smtp.gmail.com with ESMTPSA id af79cd13be357-93f1a198372sm118038685a.27.2026.10.15.21.58.56
        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
        Thu, 15 Oct 2026 21:58:56 -0700 (PDT)
X-Cc: Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@kernel.org>,
	Jakub Kicinski <kuba@kernel.org>,
	Paolo Abeni <pabeni@redhat.com>,
	Ariel Levkovich <lariel@nvidia.com>,
	Jianbo Liu <jianbol@nvidia.com>,
	Alex Vesker <valex@nvidia.com>,
	Yevgeny Kliteynik <kliteyn@nvidia.com>,
	Itamar Gozlan <igozlan@nvidia.com>,
	netdev@vger.kernel.org,
	linux-rdma@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Yuho Choi <oss.patchbox@gmail.com>
X-Mailer: git-send-email 2.43.0
X-Precedence: bulk
X-Mailing-List: netdev@vger.kernel.org
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>