IB/qib: Fix potential buffer overrun in sending diag packet routine
authorDennis Dalessandro <dennis.dalessandro@intel.com>
Thu, 20 Feb 2014 16:02:48 +0000 (11:02 -0500)
committerRoland Dreier <roland@purestorage.com>
Mon, 17 Mar 2014 23:16:51 +0000 (16:16 -0700)
commit1c20c81909455f64f2df6107cb099ee5569d9f62
tree87a26985e77081c38cea01b810d73a5893578ecb
parentcfbf8d4857c26a8a307fb7cd258074c9dcd8c691
IB/qib: Fix potential buffer overrun in sending diag packet routine

Guard against a potential buffer overrun.  Right now the qib driver is
protected by the fact that the data structure in question is only 16
bits.  Should that ever change the problem will be exposed. There is a
similar defect in the ipath driver and this brings the two code paths
into sync.

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>
drivers/infiniband/hw/qib/qib_diag.c