Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

lguest: fix out-by-one error in address checking.

This bug has been there since day 1; addresses in the top guest physical
page weren't considered valid. You could map that page (the check in
check_gpte() is correct), but if a guest tried to put a pagetable there
we'd check that address manually when walking it, and kill the guest.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Cc: stable@kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Rusty Russell and committed by
Linus Torvalds
83a35114 3cfd4ba7

+1 -1
+1 -1
drivers/lguest/core.c
··· 173 173 bool lguest_address_ok(const struct lguest *lg, 174 174 unsigned long addr, unsigned long len) 175 175 { 176 - return (addr+len) / PAGE_SIZE < lg->pfn_limit && (addr+len >= addr); 176 + return addr+len <= lg->pfn_limit * PAGE_SIZE && (addr+len >= addr); 177 177 } 178 178 179 179 /*