From: Dmitry Kalinkin Date: Thu, 28 May 2015 12:07:03 +0000 (+0300) Subject: vme: check for A64 overflow in vme_check_window() X-Git-Tag: v4.2-rc1~88^2~159 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e7fd80cbb4a788b2f8b081ab8564752073c30505;p=platform%2Fkernel%2Flinux-exynos.git vme: check for A64 overflow in vme_check_window() Signed-off-by: Dmitry Kalinkin Cc: Igor Alekseev Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/vme/vme.c b/drivers/vme/vme.c index 6bab2c4ed..1b78d27 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) ||