[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1417010419-3827-2-git-send-email-sasha.levin@oracle.com>
Date: Wed, 26 Nov 2014 09:00:19 -0500
From: Sasha Levin <sasha.levin@...cle.com>
To: mingo@...nel.org, akpm@...ux-foundation.org,
torvalds@...ux-foundation.org
Cc: linux-kernel@...r.kernel.org, Sasha Levin <sasha.levin@...cle.com>
Subject: [RFC 2/2] kvm: eventfd: detect integer overflow using check_*_overflow
Detect integer overflows using safe operations rather than relying on
undefined behaviour.
Signed-off-by: Sasha Levin <sasha.levin@...cle.com>
---
virt/kvm/eventfd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/virt/kvm/eventfd.c b/virt/kvm/eventfd.c
index 148b239..2eb044f 100644
--- a/virt/kvm/eventfd.c
+++ b/virt/kvm/eventfd.c
@@ -790,7 +790,7 @@ kvm_assign_ioeventfd(struct kvm *kvm, struct kvm_ioeventfd *args)
}
/* check for range overflow */
- if (args->addr + args->len < args->addr)
+ if (check_add_overflow(args->len, args->addr))
return -EINVAL;
/* check for extra flags that we don't understand */
--
1.7.10.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists