summaryrefslogtreecommitdiffstats
path: root/kernel/events
diff options
context:
space:
mode:
authorOleg Nesterov <oleg@redhat.com>2012-07-29 20:22:33 +0200
committerIngo Molnar <mingo@kernel.org>2012-07-30 11:27:21 +0200
commitaefd8933d445abf7ff0d4027c624737898827bcd (patch)
treef32864bfa64158141326ac35bc57204e49b2774f /kernel/events
parent2fd611a991391a6050cbd139201a2e12fc306540 (diff)
downloadop-kernel-dev-aefd8933d445abf7ff0d4027c624737898827bcd.zip
op-kernel-dev-aefd8933d445abf7ff0d4027c624737898827bcd.tar.gz
uprobes: Fix overflow in vma_address()/find_active_uprobe()
vma->vm_pgoff is "unsigned long", it should be promoted to loff_t before the multiplication to avoid the overflow. Signed-off-by: Oleg Nesterov <oleg@redhat.com> Acked-by: Srikar Dronamraju <srikar.vnet.ibm.com> Cc: Anton Arapov <anton@redhat.com> Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com> Link: http://lkml.kernel.org/r/20120729182233.GA20339@redhat.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel/events')
-rw-r--r--kernel/events/uprobes.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c
index 9db9cdf..fb961d5 100644
--- a/kernel/events/uprobes.c
+++ b/kernel/events/uprobes.c
@@ -117,7 +117,7 @@ static loff_t vma_address(struct vm_area_struct *vma, loff_t offset)
loff_t vaddr;
vaddr = vma->vm_start + offset;
- vaddr -= vma->vm_pgoff << PAGE_SHIFT;
+ vaddr -= (loff_t)vma->vm_pgoff << PAGE_SHIFT;
return vaddr;
}
@@ -1450,7 +1450,7 @@ static struct uprobe *find_active_uprobe(unsigned long bp_vaddr, int *is_swbp)
inode = vma->vm_file->f_mapping->host;
offset = bp_vaddr - vma->vm_start;
- offset += (vma->vm_pgoff << PAGE_SHIFT);
+ offset += (loff_t)vma->vm_pgoff << PAGE_SHIFT;
uprobe = find_uprobe(inode, offset);
}
OpenPOWER on IntegriCloud