Files
linux/drivers
Dan Carpenter fa83234f6a vhost/scsi: potential memory corruption
commit 59c816c1f2 upstream.

This code in vhost_scsi_make_tpg() is confusing because we limit "tpgt"
to UINT_MAX but the data type of "tpg->tport_tpgt" and that is a u16.

I looked at the context and it turns out that in
vhost_scsi_set_endpoint(), "tpg->tport_tpgt" is used as an offset into
the vs_tpg[] array which has VHOST_SCSI_MAX_TARGET (256) elements so
anything higher than 255 then it is invalid.  I have made that the limit
now.

In vhost_scsi_send_evt() we mask away values higher than 255, but now
that the limit has changed, we don't need the mask.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
[ The affected function was renamed to vhost_scsi_make_tpg before
  the vulnerability was announced, I ported it to 3.10 stable and
  changed the code in function tcm_vhost_make_tpg]
Signed-off-by: Wang Long <long.wanglong@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-01 12:07:34 +02:00
..
2013-12-08 07:29:25 -08:00
2013-05-17 14:31:05 -04:00
2015-08-16 20:51:39 -07:00
2015-09-21 10:00:07 -07:00
2014-04-14 06:42:18 -07:00
2015-10-01 12:07:28 +02:00
2015-09-21 10:00:07 -07:00
2015-09-13 09:07:59 -07:00
2015-05-06 21:56:25 +02:00