[PATCH rdma-next v6 10/10] RDMA/nldev: Don't expose number of not-visible entries

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Leon Romanovsky <leonro@xxxxxxxxxxxx>

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 <leonro@xxxxxxxxxxxx>
---
 drivers/infiniband/core/nldev.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/infiniband/core/nldev.c b/drivers/infiniband/core/nldev.c
index 18e0e4b8d9e7..f7d5047f2d8d 100644
--- a/drivers/infiniband/core/nldev.c
+++ b/drivers/infiniband/core/nldev.c
@@ -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);
-- 
2.19.1




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux