]> git.ipfire.org Git - people/arne_f/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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 11 Mar 2020 13:15:11 +0000 (14:15 +0100)
commit514ac47a7405bacd10cce931f21c36fb8c666080
tree0c9f8ff9fc9b534dd418513f769f68ee3f5baaf9
parent8f394a3c0967955348d3856e3e50e11e50f2a65f
IB/hfi1, qib: Ensure RCU is locked when accessing list

commit 817a68a6584aa08e323c64283fec5ded7be84759 upstream.

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: 7724105686e7 ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/infiniband/hw/hfi1/verbs.c
drivers/infiniband/hw/qib/qib_verbs.c