From e39f4d87896c451afb8c38705de4c12fd3940182 Mon Sep 17 00:00:00 2001 From: Chaskiel M Grundman Date: Fri, 6 Oct 2006 14:59:54 +0000 Subject: [PATCH] osi-probe-avoid-out-of-range-memory-reads-20061006 FIXES 41858 avoid oops on opteron due to accessing unmapped memory --- src/afs/LINUX/osi_probe.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/afs/LINUX/osi_probe.c b/src/afs/LINUX/osi_probe.c index 20acb39e10..d70235d768 100644 --- a/src/afs/LINUX/osi_probe.c +++ b/src/afs/LINUX/osi_probe.c @@ -1009,6 +1009,12 @@ static void *try(probectl *P, tryctl *T, PROBETYPE *aptr, #else ptr = aptr; #endif + if ((unsigned long)ptr < init_mm.start_code || + (unsigned long)ptr > init_mm.end_data) { +/* printk("address 0x%lx (from 0x%lx %d) is out of range in check_table. wtf?\n", (unsigned long)x, (unsigned long)ptr, i);*/ + continue; + } + ret = check_table(P, ptr); if (ret >= 0) { /* return value is number of entries to skip */ @@ -1113,6 +1119,11 @@ static void *try_harder(probectl *P, PROBETYPE *ptr, unsigned long datalen) printk("<7>osi_probe: %s try_harder\n", P->symbol); #endif for (offset = 0; offset < datalen; offset++, ptr++) { + if ((unsigned long)ptr < init_mm.start_code || + (unsigned long)ptr > init_mm.end_data) { +/* printk("address 0x%lx (from 0x%lx %d) is out of range in check_table. wtf?\n", (unsigned long)x, (unsigned long)ptr, i);*/ + continue; + } ret = check_table(P, ptr); if (ret >= 0) { /* return value is number of entries to skip */