From: Mike Marciniszyn Date: Tue, 9 Aug 2016 15:19:56 +0000 (-0400) Subject: IB/hfi1: Validate header in set_armed_active X-Git-Tag: MMI-PSA29.97-13-9~7008^2~100 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=69b9f4a4233b6f9ea168c25123b9eb629739d8e5;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git IB/hfi1: Validate header in set_armed_active Validate the etype to insure that the header is correct. Reviewed-by: Don Hiatt Signed-off-by: Mike Marciniszyn Signed-off-by: Doug Ledford --- diff --git a/drivers/infiniband/hw/hfi1/driver.c b/drivers/infiniband/hw/hfi1/driver.c index c4156870a8bb..303f10555729 100644 --- a/drivers/infiniband/hw/hfi1/driver.c +++ b/drivers/infiniband/hw/hfi1/driver.c @@ -894,8 +894,9 @@ static inline int set_armed_to_active(struct hfi1_ctxtdata *rcd, struct work_struct *lsaw = &rcd->ppd->linkstate_active_work; struct hfi1_message_header *hdr = hfi1_get_msgheader(packet->rcd->dd, packet->rhf_addr); + u8 etype = rhf_rcv_type(packet->rhf); - if (hdr2sc(hdr, packet->rhf) != 0xf) { + if (etype == RHF_RCV_TYPE_IB && hdr2sc(hdr, packet->rhf) != 0xf) { int hwstate = read_logical_state(dd); if (hwstate != LSTATE_ACTIVE) {