Skip to content

Commit

Permalink
RDMA/nldev: Don't expose number of not-visible entries
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Leon Romanovsky authored and jgunthorpe committed Feb 19, 2019
1 parent 1b8b778 commit f2a0e45
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions drivers/infiniband/core/nldev.c
Original file line number Diff line number Diff line change
Expand Up @@ -1123,13 +1123,10 @@ static int res_get_common_dumpit(struct sk_buff *skb,
* objects.
*/
xa_for_each(&rt->xa, id, res) {
if (idx < start)
goto next;

if (!is_visible_in_pid_ns(res))
goto next;
continue;

if (!rdma_restrack_get(res))
if (idx < start || !rdma_restrack_get(res))
goto next;

xa_unlock(&rt->xa);
Expand Down

0 comments on commit f2a0e45

Please sign in to comment.