vme: check for A64 overflow in vme_check_window()

Signed-off-by: Dmitry Kalinkin <dmitry.kalinkin@gmail.com>
Cc: Igor Alekseev <igor.alekseev@itep.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Dmitry Kalinkin 2015-05-28 15:07:03 +03:00 committed by Greg Kroah-Hartman
parent 615c40dd9f
commit e7fd80cbb4
1 changed files with 2 additions and 4 deletions

View File

@ -199,10 +199,8 @@ static int vme_check_window(u32 aspace, unsigned long long vme_base,
retval = -EFAULT;
break;
case VME_A64:
/*
* Any value held in an unsigned long long can be used as the
* base
*/
if ((size != 0) && (vme_base > U64_MAX + 1 - size))
retval = -EFAULT;
break;
case VME_CRCSR:
if (((vme_base + size) > VME_CRCSR_MAX) ||