Patch "i40iw: Add missing NULL check for MPA private data" has been added to the 4.7-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    i40iw: Add missing NULL check for MPA private data

to the 4.7-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     i40iw-add-missing-null-check-for-mpa-private-data.patch
and it can be found in the queue-4.7 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.


>From 5dfd5e5e3bc68ab3912acc712c8180942094fc69 Mon Sep 17 00:00:00 2001
From: Shiraz Saleem <shiraz.saleem@xxxxxxxxx>
Date: Mon, 22 Aug 2016 18:16:37 -0500
Subject: i40iw: Add missing NULL check for MPA private data

From: Shiraz Saleem <shiraz.saleem@xxxxxxxxx>

commit 5dfd5e5e3bc68ab3912acc712c8180942094fc69 upstream.

Add NULL check for pdata and pdata->addr before the memcpy in
i40iw_form_cm_frame(). This fixes a NULL pointer de-reference
which occurs when the MPA private data pointer is NULL. Also
only copy pdata->size bytes in the memcpy to prevent reading
past the length of the private data buffer provided by upper layer.

Fixes: f27b4746f378 ("i40iw: add connection management code")

Reported-by: Stefan Assmann <sassmann@xxxxxxxxxx>
Signed-off-by: Mustafa Ismail <mustafa.ismail@xxxxxxxxx>
Signed-off-by: Shiraz Saleem <shiraz.saleem@xxxxxxxxx>
Signed-off-by: Doug Ledford <dledford@xxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>

---
 drivers/infiniband/hw/i40iw/i40iw_cm.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/drivers/infiniband/hw/i40iw/i40iw_cm.c
+++ b/drivers/infiniband/hw/i40iw/i40iw_cm.c
@@ -535,8 +535,8 @@ static struct i40iw_puda_buf *i40iw_form
 		buf += hdr_len;
 	}
 
-	if (pd_len)
-		memcpy(buf, pdata->addr, pd_len);
+	if (pdata && pdata->addr)
+		memcpy(buf, pdata->addr, pdata->size);
 
 	atomic_set(&sqbuf->refcount, 1);
 


Patches currently in stable-queue which might be from shiraz.saleem@xxxxxxxxx are

queue-4.7/i40iw-update-hw_iwarp_state.patch
queue-4.7/i40iw-add-missing-check-for-interface-already-open.patch
queue-4.7/i40iw-fix-double-free-of-allocated_buffer.patch
queue-4.7/i40iw-send-last-streaming-mode-message-for-loopback-connections.patch
queue-4.7/i40iw-receive-notification-events-correctly.patch
queue-4.7/i40iw-change-mem_resources-pointer-to-a-u8.patch
queue-4.7/i40iw-protect-req_resource_num-update.patch
queue-4.7/i40iw-add-missing-null-check-for-mpa-private-data.patch
queue-4.7/i40iw-avoid-writing-to-freed-memory.patch
queue-4.7/i40iw-do-not-set-self-referencing-pointer-to-null-after-kfree.patch
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]