be2iscsi: check ip buffer before copying
authorMike Christie <michaelc@cs.wisc.edu>
Mon, 29 Sep 2014 18:55:41 +0000 (13:55 -0500)
committerChristoph Hellwig <hch@lst.de>
Tue, 30 Sep 2014 07:29:55 +0000 (09:29 +0200)
commita41a9ad3bbf61fae0b6bfb232153da60d14fdbd9
tree177e4cce56a06f0e4892dc1b702a3d2f630d6a6e
parent4bfb8ebf4c21f372a8677f9aa99963985e9e6539
be2iscsi: check ip buffer before copying

Dan Carpenter found a issue where be2iscsi would copy the ip
from userspace to the driver buffer before checking the len
of the data being copied:
http://marc.info/?l=linux-scsi&m=140982651504251&w=2

This patch just has us only copy what we the driver buffer
can support.

Cc: <stable@vger.kernel.org>
Tested-by: John Soni Jose <sony.john-n@emulex.com>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/scsi/be2iscsi/be_mgmt.c