#include "afsincludes.h"
#endif
#include <linux/version.h>
+#ifdef CONFIG_H_EXISTS
#include <linux/config.h>
+#endif
#include <linux/linkage.h>
#include <linux/init.h>
#include <linux/unistd.h>
(unsigned long)&sys_close,
#elif defined(AFS_AMD64_LINUX20_ENV)
/* On this platform, it's in a different section! */
- (unsigned long)&tasklist_lock,
+ (unsigned long)&generic_ro_fops,
#else
(unsigned long)&init_mm,
#endif
0x1fffff,
0x30000,
#elif defined(AFS_AMD64_LINUX20_ENV)
- (unsigned long)(&tasklist_lock) - 0x30000,
+ (unsigned long)(&generic_ro_fops) - 0x30000,
0,
0x6000,
#elif defined(AFS_PPC64_LINUX26_ENV)
#ifdef AFS_LINUX26_ENV
(unsigned long)scsi_command_size,
- (unsigned long)scsi_command_size,
+ (unsigned long)scsi_command_size - 0x10000,
0x3ffff,
- 0x30000,
+ 0x40000,
#else
0, 0, 0, 0,
#endif
#ifdef AFS_LINUX26_ENV
(unsigned long)scsi_command_size,
- (unsigned long)scsi_command_size,
+ (unsigned long)scsi_command_size - 0x10000,
0x3ffff,
- 0x30000,
+ 0x40000,
#else
0, 0, 0, 0,
#endif
#ifdef AFS_LINUX26_ENV
(unsigned long)scsi_command_size,
- (unsigned long)scsi_command_size,
+ (unsigned long)scsi_command_size - 0x10000,
0x3ffff,
- 0x30000,
+ 0x40000,
#else
0, 0, 0, 0,
#endif
#ifdef AFS_LINUX26_ENV
(unsigned long)scsi_command_size,
- (unsigned long)scsi_command_size,
+ (unsigned long)scsi_command_size - 0x10000,
0x3ffff,
- 0x30000,
+ 0x40000,
#else
0, 0, 0, 0,
#endif
#else
ptr = aptr;
#endif
+ if ((unsigned long)ptr < init_mm.start_code ||
+#if defined(AFS_AMD64_LINUX20_ENV)
+ (unsigned long)ptr > init_mm.brk)
+#else
+ (unsigned long)ptr > init_mm.end_data)
+#endif
+ {
+/* 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 */
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 ||
+#if defined(AFS_AMD64_LINUX20_ENV)
+ (unsigned long)ptr > init_mm.brk)
+#else
+ (unsigned long)ptr > init_mm.end_data)
+#endif
+ {
+/* 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 */