mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-05-07 23:21:11 +00:00
[module] check vmf->pgoff before using it
As reported by @Crispy-fried-chicken in issue #1133 there is a potential XXE vulnerability here. This fixes this problem by verifying the value of `vmf->pgff` does not exceed the bounds of the memory mapping. Fixes: #1133
This commit is contained in:
parent
d060e375ea
commit
3ea37b86e3
@ -1,5 +1,5 @@
|
||||
PACKAGE_NAME="kvmfr"
|
||||
PACKAGE_VERSION="0.0.10"
|
||||
PACKAGE_VERSION="0.0.11"
|
||||
BUILT_MODULE_NAME[0]="${PACKAGE_NAME}"
|
||||
MAKE[0]="make KDIR=${kernel_source_dir}"
|
||||
CLEAN="make KDIR=${kernel_source_dir} clean"
|
||||
|
@ -88,8 +88,12 @@ static vm_fault_t kvmfr_vm_fault(struct vm_fault *vmf)
|
||||
{
|
||||
struct vm_area_struct *vma = vmf->vma;
|
||||
struct kvmfrbuf *kbuf = (struct kvmfrbuf *)vma->vm_private_data;
|
||||
pgoff_t pgoff = vmf->pgoff;
|
||||
|
||||
vmf->page = kbuf->pages[vmf->pgoff];
|
||||
if (pgoff >= kbuf->pagecount)
|
||||
return VM_FAULT_SIGBUS;
|
||||
|
||||
vmf->page = kbuf->pages[pgoff];
|
||||
get_page(vmf->page);
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user