Skip to content

Commit f2a0e45

Browse files
Leon Romanovskyjgunthorpe
authored andcommitted
RDMA/nldev: Don't expose number of not-visible entries
Netlink dumpit handshake exchanges the index from which kernel should start to return its value, in current code, this index included not-visible in this PID items too and indirectly revealed the number of entries. Signed-off-by: Leon Romanovsky <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent 1b8b778 commit f2a0e45

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

drivers/infiniband/core/nldev.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1123,13 +1123,10 @@ static int res_get_common_dumpit(struct sk_buff *skb,
11231123
* objects.
11241124
*/
11251125
xa_for_each(&rt->xa, id, res) {
1126-
if (idx < start)
1127-
goto next;
1128-
11291126
if (!is_visible_in_pid_ns(res))
1130-
goto next;
1127+
continue;
11311128

1132-
if (!rdma_restrack_get(res))
1129+
if (idx < start || !rdma_restrack_get(res))
11331130
goto next;
11341131

11351132
xa_unlock(&rt->xa);

0 commit comments

Comments
 (0)