summaryrefslogtreecommitdiffstats
path: root/drivers/vme/vme.c
diff options
context:
space:
mode:
authorDmitry Kalinkin <dmitry.kalinkin@gmail.com>2015-05-28 15:07:03 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-06-12 17:26:57 -0700
commite7fd80cbb4a788b2f8b081ab8564752073c30505 (patch)
tree7fab41f759c64315ae96a26d341ca07073b09c09 /drivers/vme/vme.c
parent615c40dd9f884add78cc3048167b59856d241fa3 (diff)
downloadlinux-e7fd80cbb4a788b2f8b081ab8564752073c30505.tar.bz2
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>
Diffstat (limited to 'drivers/vme/vme.c')
-rw-r--r--drivers/vme/vme.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/vme/vme.c b/drivers/vme/vme.c
index 6bab2c4ed77c..1b78d27aa728 100644
--- a/drivers/vme/vme.c
+++ b/drivers/vme/vme.c
@@ -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) ||