From: Shiraz Saleem Date: Mon, 22 Aug 2016 23:09:14 +0000 (-0500) Subject: i40iw: Change mem_resources pointer to a u8 X-Git-Tag: v4.8-rc4~9^2~11 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6c7d46fdb8165ece4b0a17fb8f0b9320dbfeffc2;p=profile%2Fwearable%2Fplatform%2Fkernel%2Flinux-4.9-exynos9110.git i40iw: Change mem_resources pointer to a u8 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 Signed-off-by: Mustafa Ismail Signed-off-by: Shiraz Saleem Signed-off-by: Doug Ledford --- 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;