]> git.baikalelectronics.ru Git - kernel.git/commit
RDMA/restrack: Rewrite PID namespace check to be reliable
authorLeon Romanovsky <leonro@mellanox.com>
Thu, 15 Aug 2019 08:38:29 +0000 (11:38 +0300)
committerDoug Ledford <dledford@redhat.com>
Tue, 20 Aug 2019 17:44:44 +0000 (13:44 -0400)
commitbc6bb8c5a35aa54c241f5d8b57864468126232d0
tree654c4222c4f37b1e17beb4d1249bb5bf36358112
parentcbe0f5a82cc6dbb3440f80c7124edefdc78cd93c
RDMA/restrack: Rewrite PID namespace check to be reliable

task_active_pid_ns() is wrong API to check PID namespace because it
posses some restrictions and return PID namespace where the process
was allocated. It created mismatches with current namespace, which
can be different.

Rewrite whole rdma_is_visible_in_pid_ns() logic to provide reliable
results without any relation to allocated PID namespace.

Fixes: 62424a9874c3 ("RDMA/nldev: Factor out the PID namespace check")
Fixes: 2b939a57c1d4 ("RDMA/restrack: Make is_visible_in_pid_ns() as an API")
Reviewed-by: Mark Zhang <markz@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Link: https://lore.kernel.org/r/20190815083834.9245-4-leon@kernel.org
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/core/nldev.c
drivers/infiniband/core/restrack.c
include/rdma/restrack.h