mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] lguest: fix bug in setting guest GDT entry
@ 2010-01-04  8:56 Rusty Russell
  0 siblings, 0 replies; only message in thread
From: Rusty Russell @ 2010-01-04  8:56 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-kernel, lguest, Dan Carpenter


We kill the guest, but then we blatt random stuff.

Reported-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Cc: stable@kernel.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;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-01-04  8:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-01-04  8:56 [PATCH] lguest: fix bug in setting guest GDT entry Rusty Russell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome