aacraid: Check size values after double-fetch from user
authorDave Carroll <david.carroll@microsemi.com>
Fri, 5 Aug 2016 19:44:10 +0000 (13:44 -0600)
committerBen Hutchings <ben@decadent.org.uk>
Sun, 20 Nov 2016 01:01:31 +0000 (01:01 +0000)
commit8c7c27347bf94d568353a539dfff6578b6181b82
tree09093e76380f375f29cd8321e8b350088adf0d3b
parentb17226ca4e6cb50d3bbb0215fd8208ffdf44bf63
aacraid: Check size values after double-fetch from user

commit fa00c437eef8dc2e7b25f8cd868cfa405fcc2bb3 upstream.

In aacraid's ioctl_send_fib() we do two fetches from userspace, one the
get the fib header's size and one for the fib itself. Later we use the
size field from the second fetch to further process the fib. If for some
reason the size from the second fetch is different than from the first
fix, we may encounter an out-of- bounds access in aac_fib_send(). We
also check the sender size to insure it is not out of bounds. This was
reported in https://bugzilla.kernel.org/show_bug.cgi?id=116751 and was
assigned CVE-2016-6480.

Reported-by: Pengfei Wang <wpengfeinudt@gmail.com>
Fixes: 7c00ffa31 '[SCSI] 2.6 aacraid: Variable FIB size (updated patch)'
Signed-off-by: Dave Carroll <david.carroll@microsemi.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/scsi/aacraid/commctrl.c