]> git.baikalelectronics.ru Git - kernel.git/commit
i40iw: Add missing NULL check for MPA private data
authorShiraz Saleem <shiraz.saleem@intel.com>
Mon, 22 Aug 2016 23:16:37 +0000 (18:16 -0500)
committerDoug Ledford <dledford@redhat.com>
Wed, 24 Aug 2016 15:21:51 +0000 (11:21 -0400)
commit9aed7c5bf6d552b94d7aecc2c514aa3675fe7e3d
tree259952755056eeba2376710d697a848a387e8dcb
parent275a83504a3e2ad82bd15340af331ae12c71be32
i40iw: Add missing NULL check for MPA private data

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: 11419b4d0754 ("i40iw: add connection management code")
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>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/hw/i40iw/i40iw_cm.c