All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86: simplefb: avoid overflow
@ 2013-09-06  9:32 Tom Gundersen
  2013-09-06  9:55 ` David Herrmann
  0 siblings, 1 reply; 7+ messages in thread
From: Tom Gundersen @ 2013-09-06  9:32 UTC (permalink / raw)
  To: x86
  Cc: linux-kernel, mingo, tglx, Tom Gundersen, David Herrmann,
	H. Peter Anvin

lfb_size can easily be say 4M, which would make the bitshit overflow and
the test fail.

Signed-off-by: Tom Gundersen <teg@jklm.no>
Cc: David Herrmann <dh.herrmann@gmail.com>
Cc: H. Peter Anvin <hpa@zytor.com>
---
 arch/x86/kernel/sysfb_simplefb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/sysfb_simplefb.c b/arch/x86/kernel/sysfb_simplefb.c
index 22513e9..fff44a5 100644
--- a/arch/x86/kernel/sysfb_simplefb.c
+++ b/arch/x86/kernel/sysfb_simplefb.c
@@ -72,7 +72,7 @@ __init int create_simplefb(const struct screen_info *si,
 	 * the part that is occupied by the framebuffer */
 	len = mode->height * mode->stride;
 	len = PAGE_ALIGN(len);
-	if (len > si->lfb_size << 16) {
+	if (len > ((unsigned long) si->lfb_size) << 16) {
 		printk(KERN_WARNING "sysfb: VRAM smaller than advertised\n");
 		return -EINVAL;
 	}
-- 
1.8.4


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-09-06 11:57 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-06  9:32 [PATCH] x86: simplefb: avoid overflow Tom Gundersen
2013-09-06  9:55 ` David Herrmann
2013-09-06 10:59   ` Geert Uytterhoeven
2013-09-06 11:08     ` H. Peter Anvin
2013-09-06 11:15       ` Geert Uytterhoeven
2013-09-06 11:24     ` David Herrmann
2013-09-06 11:57       ` Tom Gundersen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.