From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796214624; b=JzJcCEqketrziQm6TuxVICfqg9Z0ZNv7NRIbTcXie6LK9Kku6jbPE5sT2ERl4vyG9ejo Nayihp7zjW2tcjAUCZctuf9BoWzkX5hZ7WLPsRjuzSng1esK+m4a9FiPk48gRRfh/wGIU MSmTOgGWHsR+4K74Zkife+Ii9U+iBe5fv0F1T5O+rpxSLfq5Fn7abU9bGZMPXulE5taV/ mnsYKDbPeB4ImSfTwGdUKA233OcJ1oMfOG0upimYDVhNHonK7omL0XdmLv3F3Jtd1I6Mf Cf/oJLABYUmaF42r6MdhpEK40PNOQ4h/LK9TdBqFWry+0ziUx8wW8kmqjDo7gJyy58Q== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796214624; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=ziZ0LFt+mvNZ6e/mgelVI3G7ZnR2OZ9lEZ29LePanSY=; b=Ll39DrJlcnurak/gYC5LjLRQ/hCBbHaw1rBKxQX+EOTvPVggvQoCPH1PKXqWXQiQYQDI QXKbzzEPXhUkW0Z0TKstGmJVErfengyBf85dXTHx6i6cQ2gt2mehfowrDmEt+udQdeD+s l8it9GOKMo2lLcQJ6cPzo373KCr5ActFwgdj1MxZFC8Th+KAIzNrUs9gfMUpafsJFeSzo qrnlGPzJQUVDfHO0KPvPvwZ1caxhPYl3hL+LsIb1A5YAm3EKOVmhWUHIQnCYJxPOBn8sW 1cH9cPfyV13OIEeMGun04e+2V7poMrGf6Kj2hPxGsM62ICAXQgctlPIbfsIRidEvpIg== 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=NzLNMKXL; arc=none smtp.remote-ip=100.103.45.18 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 642D7606A33F for ; Wed, 2 Dec 2026 12:30:24 +0000 (UTC) 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=NzLNMKXL Received: by smtp.kernel.org (Postfix) with ESMTPSA id A82A31F0089C; Wed, 2 Dec 2026 12:30:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796214623; bh=ziZ0LFt+mvNZ6e/mgelVI3G7ZnR2OZ9lEZ29LePanSY=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=NzLNMKXLtM9ChMMLph6pvYiSdMaBKdG4XvcCq+u7PoF0egxNimoZAGooJtNuboa+1 +9QZJcVqNXe8ZnXdYDtJAcqoPpzUK8HipGuaW9YdvOAGIXdqfWWpFOnb6u6wjZ6MQw fYeFBi8s8WxEsXWUasWT7sfIVdL0gqHySkQEQzOhuX40ZcQDNc9qFy/QHlPByHAhCm dU6vi7vNb4t1u4APvnTEHdP9DJgB9kBwf3b+X8Dli7rAfSlP1lbvG3M9/xelwRlpH8 4IaXZyJIt1Ia0xjiO2kbl1zkfCmhdgftud/1nu2QSAaHCTDb/lqONyxSibQTMfW6AZ LQWNbPSjD3tyQ== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH net] net/mlx5: Fix RoCE steering use-after-free on eswitch mode change Reply-To: sashiko-reviews@lists.linux.dev To: "Tariq Toukan" Cc: linux-rdma@vger.kernel.org In-Reply-To: <20261202122656.3434304-1-tariqt@nvidia.com> References: <20261202122656.3434304-1-tariqt@nvidia.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Wed, 02 Dec 2026 12:30:23 +0000 X-Mailing-List: linux-rdma@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list > From: Dragos Tatulea >=20 > mlx5_rdma_disable_roce() uses roce->ft to tell whether RoCE steering was > set up, but mlx5_rdma_disable_roce_steering() frees the table, group and > rule without clearing the pointers. The pointers in dev->priv.roce > survive a devlink reload. >=20 > If the next mlx5_rdma_enable_roce() returns early because the roce cap > is now off, the next mlx5_rdma_disable_roce() passes the !roce->ft check > and frees the stale objects a second time. >=20 > Caught on a CX-7 with KASAN when running the following sequence: >=20 > devlink dev eswitch set pci/$PF mode switchdev > devlink dev eswitch set pci/$PF mode legacy > [ ... ] >=20 > Fixes: 80f09dfc237f ("net/mlx5: Eswitch, enable RoCE loopback traffic") > Signed-off-by: Dragos Tatulea > Reviewed-by: Mark Bloch > Signed-off-by: Tariq Toukan Sashiko has reviewed this patch and found no issues. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261202122656.3434= 304-1-tariqt@nvidia.com?part=3D1