Commit 3e27249c authored by Rusty Russell's avatar Rusty Russell Committed by Linus Torvalds

lguest: fix bug in setting guest GDT entry

We kill the guest, but then we blatt random stuff.
Reported-by: default avatarDan Carpenter <error27@gmail.com>
Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
Cc: stable@kernel.org
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 741f21e8
...@@ -179,8 +179,10 @@ void load_guest_gdt_entry(struct lg_cpu *cpu, u32 num, u32 lo, u32 hi) ...@@ -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 * We assume the Guest has the same number of GDT entries as the
* Host, otherwise we'd have to dynamically allocate the Guest GDT. * 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); kill_guest(cpu, "too many gdt entries %i", num);
return;
}
/* Set it up, then fix it. */ /* Set it up, then fix it. */
cpu->arch.gdt[num].a = lo; cpu->arch.gdt[num].a = lo;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment