]> git.baikalelectronics.ru Git - kernel.git/commit
IB/hfi1, qib: Ensure RCU is locked when accessing list
authorDennis Dalessandro <dennis.dalessandro@intel.com>
Tue, 25 Feb 2020 19:54:45 +0000 (14:54 -0500)
committerJason Gunthorpe <jgg@mellanox.com>
Mon, 2 Mar 2020 15:10:21 +0000 (11:10 -0400)
commitd6dc4b397306d6ec6fd6a86ec322cbfddf9b7bdb
tree643c30c1add80c466d1033ed155fcdbb04f8e2d9
parent2c319bc6478593e34e0d9c6893df53c3ea6c34b7
IB/hfi1, qib: Ensure RCU is locked when accessing list

The packet handling function, specifically the iteration of the qp list
for mad packet processing misses locking RCU before running through the
list. Not only is this incorrect, but the list_for_each_entry_rcu() call
can not be called with a conditional check for lock dependency. Remedy
this by invoking the rcu lock and unlock around the critical section.

This brings MAD packet processing in line with what is done for non-MAD
packets.

Fixes: 458784dfebc5 ("IB/hfi1: add driver files")
Link: https://lore.kernel.org/r/20200225195445.140896.41873.stgit@awfm-01.aw.intel.com
Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/hw/hfi1/verbs.c
drivers/infiniband/hw/qib/qib_verbs.c