linux/drivers/vhost
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
..
Kconfig Lots of virtio work which wasn't quite ready for last merge window. Plus 2013-05-02 14:14:04 -07:00
Makefile Lots of virtio work which wasn't quite ready for last merge window. Plus 2013-05-02 14:14:04 -07:00
net.c vhost: validate vhost_get_vq_desc return value 2014-04-14 06:42:18 -07:00
scsi.c vhost/scsi: potential memory corruption 2015-10-01 12:07:34 +02:00
test.c Lots of virtio work which wasn't quite ready for last merge window. Plus 2013-05-02 14:14:04 -07:00
test.h vhost test module 2010-12-09 16:00:21 +02:00
vhost.c vhost: actually track log eventfd file 2015-08-10 12:20:31 -07:00
vhost.h vhost: check owner before we overwrite ubuf_info 2013-06-11 02:46:21 -07:00
vringh.c Add missing module license tag to vring helpers. 2013-05-08 10:49:03 +09:30