All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Validate header in set_armed_active
@ 2016-08-09 15:19 ira.weiny-ral2JQCrhuEAvxtiuMwx3w
       [not found] ` <1470755996-14187-1-git-send-email-ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: ira.weiny-ral2JQCrhuEAvxtiuMwx3w @ 2016-08-09 15:19 UTC (permalink / raw)
  To: dledford-H+wXaHxf7aLQT0dZR+AlfA
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Ira Weiny

From: Ira Weiny <ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>

These are 2 simple fixes but there is a dependency here so I'm sending them
together.

Mike Marciniszyn (2):
  IB/hfi1: Pass packet ptr to set_armed_active
  IB/hfi1: Validate header in set_armed_active

 drivers/infiniband/hw/hfi1/driver.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

-- 
1.8.2

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/2] IB/hfi1: Pass packet ptr to set_armed_active
       [not found] ` <1470755996-14187-1-git-send-email-ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
@ 2016-08-09 15:19   ` ira.weiny-ral2JQCrhuEAvxtiuMwx3w
  2016-08-09 15:19   ` [PATCH 2/2] IB/hfi1: Validate header in set_armed_active ira.weiny-ral2JQCrhuEAvxtiuMwx3w
  2016-08-22 18:22   ` [PATCH 0/2] " Doug Ledford
  2 siblings, 0 replies; 4+ messages in thread
From: ira.weiny-ral2JQCrhuEAvxtiuMwx3w @ 2016-08-09 15:19 UTC (permalink / raw)
  To: dledford-H+wXaHxf7aLQT0dZR+AlfA
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Mike Marciniszyn

From: Mike Marciniszyn <mike.marciniszyn-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>

The "packet" parameter was being passed on the stack,
change it to a pointer.


Reviewed-by: Don Hiatt <don.hiatt-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Signed-off-by: Mike Marciniszyn <mike.marciniszyn-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
 drivers/infiniband/hw/hfi1/driver.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/infiniband/hw/hfi1/driver.c b/drivers/infiniband/hw/hfi1/driver.c
index 8246dc7d0573..c4156870a8bb 100644
--- a/drivers/infiniband/hw/hfi1/driver.c
+++ b/drivers/infiniband/hw/hfi1/driver.c
@@ -888,14 +888,14 @@ void set_all_slowpath(struct hfi1_devdata *dd)
 }
 
 static inline int set_armed_to_active(struct hfi1_ctxtdata *rcd,
-				      struct hfi1_packet packet,
+				      struct hfi1_packet *packet,
 				      struct hfi1_devdata *dd)
 {
 	struct work_struct *lsaw = &rcd->ppd->linkstate_active_work;
-	struct hfi1_message_header *hdr = hfi1_get_msgheader(packet.rcd->dd,
-							     packet.rhf_addr);
+	struct hfi1_message_header *hdr = hfi1_get_msgheader(packet->rcd->dd,
+							     packet->rhf_addr);
 
-	if (hdr2sc(hdr, packet.rhf) != 0xf) {
+	if (hdr2sc(hdr, packet->rhf) != 0xf) {
 		int hwstate = read_logical_state(dd);
 
 		if (hwstate != LSTATE_ACTIVE) {
@@ -979,7 +979,7 @@ int handle_receive_interrupt(struct hfi1_ctxtdata *rcd, int thread)
 			/* Auto activate link on non-SC15 packet receive */
 			if (unlikely(rcd->ppd->host_link_state ==
 				     HLS_UP_ARMED) &&
-			    set_armed_to_active(rcd, packet, dd))
+			    set_armed_to_active(rcd, &packet, dd))
 				goto bail;
 			last = process_rcv_packet(&packet, thread);
 		}
-- 
1.8.2

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] IB/hfi1: Validate header in set_armed_active
       [not found] ` <1470755996-14187-1-git-send-email-ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
  2016-08-09 15:19   ` [PATCH 1/2] IB/hfi1: Pass packet ptr to set_armed_active ira.weiny-ral2JQCrhuEAvxtiuMwx3w
@ 2016-08-09 15:19   ` ira.weiny-ral2JQCrhuEAvxtiuMwx3w
  2016-08-22 18:22   ` [PATCH 0/2] " Doug Ledford
  2 siblings, 0 replies; 4+ messages in thread
From: ira.weiny-ral2JQCrhuEAvxtiuMwx3w @ 2016-08-09 15:19 UTC (permalink / raw)
  To: dledford-H+wXaHxf7aLQT0dZR+AlfA
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Mike Marciniszyn

From: Mike Marciniszyn <mike.marciniszyn-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>

Validate the etype to insure that the header is correct.


Reviewed-by: Don Hiatt <don.hiatt-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Signed-off-by: Mike Marciniszyn <mike.marciniszyn-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
 drivers/infiniband/hw/hfi1/driver.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

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) {
-- 
1.8.2

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 0/2] Validate header in set_armed_active
       [not found] ` <1470755996-14187-1-git-send-email-ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
  2016-08-09 15:19   ` [PATCH 1/2] IB/hfi1: Pass packet ptr to set_armed_active ira.weiny-ral2JQCrhuEAvxtiuMwx3w
  2016-08-09 15:19   ` [PATCH 2/2] IB/hfi1: Validate header in set_armed_active ira.weiny-ral2JQCrhuEAvxtiuMwx3w
@ 2016-08-22 18:22   ` Doug Ledford
  2 siblings, 0 replies; 4+ messages in thread
From: Doug Ledford @ 2016-08-22 18:22 UTC (permalink / raw)
  To: ira.weiny-ral2JQCrhuEAvxtiuMwx3w; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA


[-- Attachment #1.1: Type: text/plain, Size: 612 bytes --]

On 8/9/2016 11:19 AM, ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org wrote:
> From: Ira Weiny <ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> 
> These are 2 simple fixes but there is a dependency here so I'm sending them
> together.
> 
> Mike Marciniszyn (2):
>   IB/hfi1: Pass packet ptr to set_armed_active
>   IB/hfi1: Validate header in set_armed_active
> 
>  drivers/infiniband/hw/hfi1/driver.c | 11 ++++++-----
>  1 file changed, 6 insertions(+), 5 deletions(-)
> 

Series applied.

-- 
Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
    GPG Key ID: 0E572FDD


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 884 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-08-22 18:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-09 15:19 [PATCH 0/2] Validate header in set_armed_active ira.weiny-ral2JQCrhuEAvxtiuMwx3w
     [not found] ` <1470755996-14187-1-git-send-email-ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2016-08-09 15:19   ` [PATCH 1/2] IB/hfi1: Pass packet ptr to set_armed_active ira.weiny-ral2JQCrhuEAvxtiuMwx3w
2016-08-09 15:19   ` [PATCH 2/2] IB/hfi1: Validate header in set_armed_active ira.weiny-ral2JQCrhuEAvxtiuMwx3w
2016-08-22 18:22   ` [PATCH 0/2] " Doug Ledford

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.