IB/hfi1: Unsafe PSN checking for TID RDMA READ Resp packet
authorKaike Wan <kaike.wan@intel.com>
Thu, 15 Aug 2019 19:20:39 +0000 (15:20 -0400)
committerDoug Ledford <dledford@redhat.com>
Tue, 20 Aug 2019 17:44:44 +0000 (13:44 -0400)
commit35d5c8b82e2c32e8e29ca195bb4dac60ba7d97fc
tree356e53f60ec949c0c2982af66742a60a6c6074b3
parentd58c1834bf0d218a0bc00f8fb44874551b21da84
IB/hfi1: Unsafe PSN checking for TID RDMA READ Resp packet

When processing a TID RDMA READ RESP packet that causes KDETH EFLAGS
errors, the packet's IB PSN is checked against qp->s_last_psn and
qp->s_psn without the protection of qp->s_lock, which is not safe.

This patch fixes the issue by acquiring qp->s_lock first.

Fixes: 9905bf06e890 ("IB/hfi1: Add functions to receive TID RDMA READ response")
Cc: <stable@vger.kernel.org>
Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Kaike Wan <kaike.wan@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Link: https://lore.kernel.org/r/20190815192039.105923.7852.stgit@awfm-01.aw.intel.com
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/hw/hfi1/tid_rdma.c