]> git.itanic.dy.fi Git - linux-stable/commit
IB/ipath: Fix potential buffer overrun in sending diag packet routine
authorDennis Dalessandro <dennis.dalessandro@intel.com>
Thu, 20 Feb 2014 16:02:53 +0000 (11:02 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 6 May 2014 14:51:43 +0000 (07:51 -0700)
commit066c269f39f667f486d3cb709429dc73ff2f172d
tree056b30092367c8618500d3ca9d980defd5920f1e
parentd8992efff2b60c8b360ebef7daa03db6496cc131
IB/ipath: Fix potential buffer overrun in sending diag packet routine

commit a2cb0eb8a64adb29a99fd864013de957028f36ae upstream.

Guard against a potential buffer overrun.  The size to read from the
user is passed in, and due to the padding that needs to be taken into
account, as well as the place holder for the ICRC it is possible to
overflow the 32bit value which would cause more data to be copied from
user space than is allocated in the buffer.

Reported-by: Nico Golde <nico@ngolde.de>
Reported-by: Fabian Yamaguchi <fabs@goesec.de>
Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/infiniband/hw/ipath/ipath_diag.c