summaryrefslogtreecommitdiff
path: root/sys/dev/ksyms.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1998-11-20 16:43:08 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1998-11-20 16:43:08 +0000
commit325fbd57644bbd42071be327eaf8862f81860107 (patch)
treecbb51496270b8efd42b202d9a827f0838e8609c9 /sys/dev/ksyms.c
parenta16012c7de365cc5a71128458071dc6d8775fa2f (diff)
careful with mmap off
Diffstat (limited to 'sys/dev/ksyms.c')
-rw-r--r--sys/dev/ksyms.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/dev/ksyms.c b/sys/dev/ksyms.c
index 61792499b2a..f9e3fcaf4a5 100644
--- a/sys/dev/ksyms.c
+++ b/sys/dev/ksyms.c
@@ -176,6 +176,8 @@ ksymsmmap(dev, off, prot)
int off, prot;
{
#define ksyms_btop(x) ((vm_offset_t)(x) >> PGSHIFT
+ if (off < 0)
+ return (-1);
if ((unsigned)off >= (unsigned)(esym - symtab) + k1->a_text)
return (-1);