diff mbox

i40iw: Change mem_resources pointer to a u8

Message ID 1471907354-82408-1-git-send-email-shiraz.saleem@intel.com (mailing list archive)
State Accepted
Headers show

Commit Message

Shiraz Saleem Aug. 22, 2016, 11:09 p.m. UTC
iwdev->mem_resources is incorrectly defined as an unsigned
long instead of u8. As a result, the offset into the dynamic
allocated structures in i40iw_initialize_hw_resources() is
incorrectly calculated and would lead to writing of memory
regions outside of the allocated buffer.

Fixes: 8e06af711bf2 ("i40iw: add main, hdr, status")

Reported-by: Stefan Assmann <sassmann@redhat.com>
Signed-off-by: Mustafa Ismail <mustafa.ismail@intel.com>
Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com>
---
 drivers/infiniband/hw/i40iw/i40iw.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Doug Ledford Aug. 23, 2016, 4:45 p.m. UTC | #1
On 8/22/2016 7:09 PM, Shiraz Saleem wrote:
> iwdev->mem_resources is incorrectly defined as an unsigned
> long instead of u8. As a result, the offset into the dynamic
> allocated structures in i40iw_initialize_hw_resources() is
> incorrectly calculated and would lead to writing of memory
> regions outside of the allocated buffer.
> 
> Fixes: 8e06af711bf2 ("i40iw: add main, hdr, status")
> 
> Reported-by: Stefan Assmann <sassmann@redhat.com>
> Signed-off-by: Mustafa Ismail <mustafa.ismail@intel.com>
> Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com>

Applied, thanks.
diff mbox

Patch

diff --git a/drivers/infiniband/hw/i40iw/i40iw.h b/drivers/infiniband/hw/i40iw/i40iw.h
index b738acd..882f3ef 100644
--- a/drivers/infiniband/hw/i40iw/i40iw.h
+++ b/drivers/infiniband/hw/i40iw/i40iw.h
@@ -232,7 +232,7 @@  struct i40iw_device {
 	struct i40e_client *client;
 	struct i40iw_hw hw;
 	struct i40iw_cm_core cm_core;
-	unsigned long *mem_resources;
+	u8 *mem_resources;
 	unsigned long *allocated_qps;
 	unsigned long *allocated_cqs;
 	unsigned long *allocated_mrs;