Commit f2a0e45f authored by Leon Romanovsky's avatar Leon Romanovsky Committed by Jason Gunthorpe

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: default avatarLeon Romanovsky <leonro@mellanox.com>
Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
parent 1b8b7788
...@@ -1123,13 +1123,10 @@ static int res_get_common_dumpit(struct sk_buff *skb, ...@@ -1123,13 +1123,10 @@ static int res_get_common_dumpit(struct sk_buff *skb,
* objects. * objects.
*/ */
xa_for_each(&rt->xa, id, res) { xa_for_each(&rt->xa, id, res) {
if (idx < start)
goto next;
if (!is_visible_in_pid_ns(res)) if (!is_visible_in_pid_ns(res))
goto next; continue;
if (!rdma_restrack_get(res)) if (idx < start || !rdma_restrack_get(res))
goto next; goto next;
xa_unlock(&rt->xa); xa_unlock(&rt->xa);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment