diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2010-01-04 03:56:14 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-01-04 15:33:33 -0500 |
commit | 3e27249c84beed1c79d767b350e52ad038db9053 (patch) | |
tree | 56fbbd5e952c4b01649c5b4f84dc7ce135cdc6ee /drivers/lguest | |
parent | 741f21e811752b440c505bf0149c4d16e9f3160d (diff) |
lguest: fix bug in setting guest GDT entry
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
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/lguest')
-rw-r--r-- | drivers/lguest/segments.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/lguest/segments.c b/drivers/lguest/segments.c index 951c57b0a7e0..ede46581351a 100644 --- a/drivers/lguest/segments.c +++ b/drivers/lguest/segments.c | |||
@@ -179,8 +179,10 @@ void load_guest_gdt_entry(struct lg_cpu *cpu, u32 num, u32 lo, u32 hi) | |||
179 | * We assume the Guest has the same number of GDT entries as the | 179 | * We assume the Guest has the same number of GDT entries as the |
180 | * Host, otherwise we'd have to dynamically allocate the Guest GDT. | 180 | * Host, otherwise we'd have to dynamically allocate the Guest GDT. |
181 | */ | 181 | */ |
182 | if (num >= ARRAY_SIZE(cpu->arch.gdt)) | 182 | if (num >= ARRAY_SIZE(cpu->arch.gdt)) { |
183 | kill_guest(cpu, "too many gdt entries %i", num); | 183 | kill_guest(cpu, "too many gdt entries %i", num); |
184 | return; | ||
185 | } | ||
184 | 186 | ||
185 | /* Set it up, then fix it. */ | 187 | /* Set it up, then fix it. */ |
186 | cpu->arch.gdt[num].a = lo; | 188 | cpu->arch.gdt[num].a = lo; |