Skip to contentSkip to conversation

RDMA/core: Require admin capabilities to set system parameters

PATCH Applied Leon Romanovsky 2 participants 3 messages Oct 4, 2023 – Oct 5, 2023 InfiniBand

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 RDMA/core: Require admin capabilities to set system parameters

From: Leon Romanovsky <[email protected]>

Like any other set command, require admin permissions to do it.

Fixes 2b34c5580226 ("RDMA/core: Add command to set ib_core device net namspace sharing mode")
---
 drivers/infiniband/core/nldev.c | 1 +
 1 file changed, 1 insertion(+)
drivers/infiniband/core/nldev.c +1 -0
index 5c805fa6187f..87b8cd657fb3 100644
@@ -2595,6 +2595,7 @@ static const struct rdma_nl_cbs nldev_cb_table[RDMA_NLDEV_NUM_OPS] = {
 	},
 	[RDMA_NLDEV_CMD_SYS_SET] = {
 		.doit = nldev_set_sys_set_doit,
+		.flags = RDMA_NL_ADMIN_PERM,
 	},
 	[RDMA_NLDEV_CMD_STAT_SET] = {
 		.doit = nldev_stat_set_doit,
Signature · 1 line
2.41.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 29 lines

From: Leon Romanovsky <[email protected]>
Sent: Wednesday, October 4, 2023 11:48 PM

From: Leon Romanovsky <[email protected]>

Like any other set command, require admin permissions to do it.

Fixes 2b34c5580226 ("RDMA/core: Add command to set ib_core device net

namspace sharing mode")

---
 drivers/infiniband/core/nldev.c | 1 +
 1 file changed, 1 insertion(+)
drivers/infiniband/core/nldev.c +1 -0
index 5c805fa6187f..87b8cd657fb3 100644
@@ -2595,6 +2595,7 @@ static const struct rdma_nl_cbs
 nldev_cb_table[RDMA_NLDEV_NUM_OPS] = {
 	},
 	[RDMA_NLDEV_CMD_SYS_SET] = {
 		.doit = nldev_set_sys_set_doit,
+		.flags = RDMA_NL_ADMIN_PERM,
 	},
 	[RDMA_NLDEV_CMD_STAT_SET] = {
Quoted 3 lines

.doit = nldev_stat_set_doit,
--
2.41.0