lkml.org 
[lkml]   [2000]   [Aug]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: mod->init out of bounds?
Date
Oh dear.  Guess I'll have to solely respond to my own post.
The module in question for which I'm getting mod->init out of bounds
has only init_module() and module_cleanup() functions.

On intel platforms the out of bounds check in kernel/module.c:
---
#define bound(p, n, m) ((unsigned long)(p) >= (unsigned long)(m+1) && \
(unsigned long)((p)+(n)) <= (unsigned long)(m) + (m)->size)
...
if (mod->init && !bound(mod->init, 0, mod)) {
printk(KERN_ERR "init_module: mod->init out of bounds.\n");
goto err2;
}
---
fails because: (given sizeof(struct module) is 0x54 bytes)
(m) mod == 0xc8828000
(p) mod->init == 0xc8828050
therefore, mod->init >= (mod + 1) is FALSE (0xc8828050 >= 0xc8828054)

As for a proper fix; I'm not sure as I don't exactly understand the
logic behind the "mod->init >= (mod + 1)" check.

BTW: Difference in sizeof(struct module) on sparc64 (plus other factors?)
results in same module loading fine there.

Thanks,
-SteveR


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:57    [W:0.021 / U:0.424 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site