Skip to content

Commit

Permalink
lguest: fix bug in setting guest GDT entry
Browse files Browse the repository at this point in the history
commit 3e27249 upstream.

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>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Rusty Russell authored and Greg Kroah-Hartman committed Jan 6, 2010
1 parent 743c078 commit 370b758
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/lguest/segments.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,10 @@ void load_guest_gdt_entry(struct lg_cpu *cpu, u32 num, u32 lo, u32 hi)
* 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;
Expand Down

0 comments on commit 370b758

Please sign in to comment.