[<prev] [next>] [day] [month] [year] [list]
Message-Id: <201001041926.15086.rusty@rustcorp.com.au>
Date: Mon, 4 Jan 2010 19:26:14 +1030
From: Rusty Russell <rusty@...tcorp.com.au>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: linux-kernel@...r.kernel.org, lguest <lguest@...abs.org>,
Dan Carpenter <error27@...il.com>
Subject: [PATCH] lguest: fix bug in setting guest GDT entry
We kill the guest, but then we blatt random stuff.
Reported-by: Dan Carpenter <error27@...il.com>
Signed-off-by: Rusty Russell <rusty@...tcorp.com.au>
Cc: stable@...nel.org
---
drivers/lguest/segments.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/lguest/segments.c b/drivers/lguest/segments.c
--- a/drivers/lguest/segments.c
+++ b/drivers/lguest/segments.c
@@ -179,8 +179,10 @@ void load_guest_gdt_entry(struct lg_cpu
* We assume the Guest has the same number of GDT entries as the
* Host, otherwise we'd have to dynamically allocate the Guest GDT.
*/
- if (num >= ARRAY_SIZE(cpu->arch.gdt))
+ if (num >= ARRAY_SIZE(cpu->arch.gdt)) {
kill_guest(cpu, "too many gdt entries %i", num);
+ return;
+ }
/* Set it up, then fix it. */
cpu->arch.gdt[num].a = lo;
--
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