]> sourceware.org Git - systemtap.git/commitdiff
Check for bad address range or size in lookup_bad_addr.
authorDave Brolley <brolley@redhat.com>
Fri, 4 Sep 2009 16:35:26 +0000 (12:35 -0400)
committerDave Brolley <brolley@redhat.com>
Fri, 4 Sep 2009 16:35:26 +0000 (12:35 -0400)
runtime/addr-map.c

index 8c0e84d8c7df448f01d599854b5798fd530606c3..a9aa8d88db9d0d8552988d6a1e1ff76b27e2dbca 100644 (file)
@@ -110,6 +110,10 @@ lookup_bad_addr(unsigned long addr, size_t size)
 {
   struct addr_map_entry* result = 0;
 
+  /* Is this a valid memory access?  */
+  if (size == 0 || ULONG_MAX - addr < size - 1)
+    return 1;
+
 #ifndef STP_PRIVILEGED
   /* Unprivileged users must not access kernel space memory.  */
   if (addr + size > TASK_SIZE)
This page took 0.027769 seconds and 5 git commands to generate.