From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E3B252EF294 for ; Thu, 26 Jun 2025 18:58:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750964318; cv=none; b=AVvAB2rMkeRzx77fe9N4EwULfCKm8fNRZapf0569/gXggImuau6AjyNIfG66kT56bO1wqlffB7ADqgtAfjfS9QdgNc2bB6w/LttRS06Yf0f5OjmRA1NPwBZp/+t8rOkRrnalEGFMsfnhyDhyQa9OX6BlUoEQsBmNRGnQI5XYU48= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750964318; c=relaxed/simple; bh=+Xt8VwJNv9KEzr6/Px4GaRSE4iXhJlhtk3zxb/nS9rA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Ejr5ofcXx0nqyi8MIfZSR1ZjatMnALn55G0WNGTUAI8vWS0d5yHMCYBImTT+JnV6WixwxF/Bfs1cImaISmN9iLucz6CjIymrQrBM5yUdhuaMXP1B+NPQPpTG8hQ/HjnvHYJxnKqvHTYk/+Rj1WBSrMUikkMAfXxqnshDw8xQ9iI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=of4PFmXH; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="of4PFmXH" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D1958C4CEEB; Thu, 26 Jun 2025 18:58:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1750964316; bh=+Xt8VwJNv9KEzr6/Px4GaRSE4iXhJlhtk3zxb/nS9rA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=of4PFmXHvdEu+jDeU3FdeoYGQH7k7eN38Rk/omCGds1sbs4D5la2pQB5YYqhSA0XG 89VPIe9J26l3lEoclEYTqTAtlWegQtIporuemyMrpOcu3Z3wf/JUzlKEp+71veqaSV XeEPZ9O+qDMt79BXWFbE81qluDbmqt2ZM4QpPkYOOJh2gVGkpMl8CWUvYRQiHu7Do/ S3ZdwK7eF1KezxOgEncPaJx1AzD8VFPSW2S1FCQI5zW3J2QArEa4C7PvCZ2hZ51724 sDTRWLvKXO2JJaHnD0Zsu6nMCfTPi0JEh0mDFIQQwETOhvkwH8kXFS8Mg/HUV7gKiQ rXGmOl0b8Ft5A== From: Leon Romanovsky To: Jason Gunthorpe Cc: Parav Pandit , "Eric W . Biederman" , linux-rdma@vger.kernel.org, Mark Bloch Subject: [PATCH rdma-next v2 2/9] RDMA/mlx5: Check CAP_NET_RAW in user namespace for flow create Date: Thu, 26 Jun 2025 21:58:05 +0300 Message-ID: X-Mailer: git-send-email 2.49.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-rdma@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Parav Pandit Currently, the capability check is done in the default init_user_ns user namespace. When a process runs in a non default user namespace, such check fails. Due to this when a process is running using Podman, it fails to create the flow. Since the RDMA device is a resource within a network namespace, use the network namespace associated with the RDMA device to determine its owning user namespace. Fixes: 322694412400 ("IB/mlx5: Introduce driver create and destroy flow methods") Signed-off-by: Parav Pandit Signed-off-by: Leon Romanovsky --- drivers/infiniband/hw/mlx5/fs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/infiniband/hw/mlx5/fs.c b/drivers/infiniband/hw/mlx5/fs.c index ebcc05f766e1..58e058c067d3 100644 --- a/drivers/infiniband/hw/mlx5/fs.c +++ b/drivers/infiniband/hw/mlx5/fs.c @@ -2459,7 +2459,7 @@ static int UVERBS_HANDLER(MLX5_IB_METHOD_CREATE_FLOW)( struct mlx5_ib_dev *dev; u32 flags; - if (!capable(CAP_NET_RAW)) + if (!rdma_uattrs_has_raw_cap(attrs)) return -EPERM; fs_matcher = uverbs_attr_get_obj(attrs, -- 2.49.0