diff mbox series

[rdma-rc] RDMA/core: Require admin capabilities to set system parameters

Message ID 75d329fdd7381b52cbdf87910bef16c9965abb1f.1696443438.git.leon@kernel.org (mailing list archive)
State Accepted
Headers show
Series [rdma-rc] RDMA/core: Require admin capabilities to set system parameters | expand

Commit Message

Leon Romanovsky Oct. 4, 2023, 6:17 p.m. UTC
From: Leon Romanovsky <leonro@nvidia.com>

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

Cc: stable@vger.kernel.org
Fixes: 2b34c5580226 ("RDMA/core: Add command to set ib_core device net namspace sharing mode")
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
---
 drivers/infiniband/core/nldev.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Parav Pandit Oct. 5, 2023, 4:44 a.m. UTC | #1
> From: Leon Romanovsky <leon@kernel.org>
> Sent: Wednesday, October 4, 2023 11:48 PM
> 
> From: Leon Romanovsky <leonro@nvidia.com>
> 
> Like any other set command, require admin permissions to do it.
> 
> Cc: stable@vger.kernel.org
> Fixes: 2b34c5580226 ("RDMA/core: Add command to set ib_core device net
> namspace sharing mode")
> Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
> ---
>  drivers/infiniband/core/nldev.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/infiniband/core/nldev.c b/drivers/infiniband/core/nldev.c
> index 5c805fa6187f..87b8cd657fb3 100644
> --- a/drivers/infiniband/core/nldev.c
> +++ b/drivers/infiniband/core/nldev.c
> @@ -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,
> --
> 2.41.0

Reviewed-by: Parav Pandit <parav@nvidia.com>
Leon Romanovsky Oct. 5, 2023, 5:02 p.m. UTC | #2
On Wed, 04 Oct 2023 21:17:49 +0300, Leon Romanovsky wrote:
> Like any other set command, require admin permissions to do it.
> 
> 

Applied, thanks!

[1/1] RDMA/core: Require admin capabilities to set system parameters
      https://git.kernel.org/rdma/rdma/c/c38d23a54445f9

Best regards,
diff mbox series

Patch

diff --git a/drivers/infiniband/core/nldev.c b/drivers/infiniband/core/nldev.c
index 5c805fa6187f..87b8cd657fb3 100644
--- a/drivers/infiniband/core/nldev.c
+++ b/drivers/infiniband/core/nldev.c
@@ -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,