diff mbox series

[v1,2/2] net/mlx5: Enable unprivileged read of PCI VPD file

Message ID f551f20b0649b4be3f4c9536e756986665366e46.1731005223.git.leonro@nvidia.com (mailing list archive)
State New
Delegated to: Netdev Maintainers
Headers show
Series Fix read permissions for VPD attributes | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
netdev/tree_selection success Guessed tree name to be net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 3 this patch: 3
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers warning 7 maintainers not CCed: tariqt@nvidia.com andrew+netdev@lunn.ch linux-rdma@vger.kernel.org edumazet@google.com pabeni@redhat.com saeedm@nvidia.com kuba@kernel.org
netdev/build_clang success Errors and warnings before: 3 this patch: 3
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 4 this patch: 4
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 7 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-11-08--06-00 (tests: 783)

Commit Message

Leon Romanovsky Nov. 7, 2024, 6:56 p.m. UTC
From: Leon Romanovsky <leonro@nvidia.com>

mlx5 devices are PCIe spec compliant, doesn't expose any sensitive
information Vital Product Data (VPD) section. In addition, these devices
are capable to provide an unprivileged read access file exposed by PCI core.

The parsed VPD section looks like this:
08:00.0 Ethernet controller: Mellanox Technologies MT2910 Family
[ConnectX-7]
...
  Capabilities: [48] Vital Product Data
    Product Name: NVIDIA ConnectX-7 HHHL adapter Card, 200GbE / NDR200 IB, Dual-port QSFP112, PCIe 5.0 x16 with x16 PCIe
extension option, Crypto, Secure Boot Capable
    Read-only fields:
        [PN] Part number: MCX713106AEHEA_QP1
        [EC] Engineering changes: A5
        [V2] Vendor specific: MCX713106AEHEA_QP1
        [SN] Serial number: MT2314XZ0JUZ
        [V3] Vendor specific: 0a5efb8958deed118000946dae7db798
        [VA] Vendor specific: MLX:MN=MLNX:CSKU=V2:UUID=V3:PCI=V0:MODL=CX713106A
        [V0] Vendor specific: PCIeGen5 x16
        [VU] Vendor specific: MT2314XZ0JUZMLNXS0D0F0
        [RV] Reserved: checksum good, 1 byte(s) reserved
    End

Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/main.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Jakub Kicinski Nov. 7, 2024, 7:09 p.m. UTC | #1
On Thu,  7 Nov 2024 20:56:57 +0200 Leon Romanovsky wrote:
> From: Leon Romanovsky <leonro@nvidia.com>
> 
> mlx5 devices are PCIe spec compliant, doesn't expose any sensitive
> information Vital Product Data (VPD) section. In addition, these devices
> are capable to provide an unprivileged read access file exposed by PCI core.

Acked-by: Jakub Kicinski <kuba@kernel.org>
diff mbox series

Patch

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/main.c b/drivers/net/ethernet/mellanox/mlx5/core/main.c
index 220a9ac75c8b..7e34badd174b 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/main.c
@@ -2280,6 +2280,7 @@  static struct pci_driver mlx5_core_driver = {
 	.sriov_configure   = mlx5_core_sriov_configure,
 	.sriov_get_vf_total_msix = mlx5_sriov_get_vf_total_msix,
 	.sriov_set_msix_vec_count = mlx5_core_sriov_set_msix_vec_count,
+	.downgrade_vpd_read = true,
 };
 
 /**