Skip to contentSkip to conversation

RDMA/netlink: Remove CAP_NET_RAW check when dump a raw QP

PATCH Applied Leon Romanovsky 2 participants 2 messages Jul 27, 2020 – Jul 29, 2020 InfiniBand

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 RDMA/netlink: Remove CAP_NET_RAW check when dump a raw QP

From: Mark Zhang <[email protected]>

When dump QPs bound to a counter, raw QPs should be allowed to dump without the CAP_NET_RAW privilege, which is consistent with what "rdma res show qp" does.

Fixes c4ffee7c9bdb ("RDMA/netlink: Implement counter dumpit calback")
---
 drivers/infiniband/core/nldev.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/infiniband/core/nldev.c +0 -3
index 76af7ea2875d..12d29d54a081 100644
@@ -759,9 +759,6 @@ static int fill_stat_counter_qps(struct sk_buff *msg,
 	xa_lock(&rt->xa);
 	xa_for_each(&rt->xa, id, res) {
 		qp = container_of(res, struct ib_qp, res);
-		if (qp->qp_type == IB_QPT_RAW_PACKET && !capable(CAP_NET_RAW))
-			continue;
-
 		if (!qp->counter || (qp->counter->id != counter->id))
 			continue;
 
Signature · 1 line
2.26.2
maintainer Applied
#1 lore raw
Quoted 6 lines · Leon Romanovsky

From: Mark Zhang <[email protected]>

When dump QPs bound to a counter, raw QPs should be allowed to dump without the CAP_NET_RAW privilege, which is consistent with what "rdma res show qp" does.

Quoted 6 lines
Fixes c4ffee7c9bdb ("RDMA/netlink: Implement counter dumpit calback")
---
 drivers/infiniband/core/nldev.c | 3 ---
 1 file changed, 3 deletions(-)

Applied to for-next, thanks

Jason