Commit 670a7f72 authored by Tony Luck's avatar Tony Luck Committed by David Mosberger

[PATCH] ia64: allow module core code calls to module init code again

Drop the prohibition for module core code calls to module init code
(this breaks netfilter).

Signed-off-by: <tony.luck@intel.com>
Signed-off-by: default avatarDavid Mosberger <davidm@hpl.hp.com>
parent f1f351e0
...@@ -656,26 +656,18 @@ do_reloc (struct module *mod, uint8_t r_type, Elf64_Sym *sym, uint64_t addend, ...@@ -656,26 +656,18 @@ do_reloc (struct module *mod, uint8_t r_type, Elf64_Sym *sym, uint64_t addend,
case RV_PCREL: case RV_PCREL:
switch (r_type) { switch (r_type) {
case R_IA64_PCREL21B: case R_IA64_PCREL21B:
if (in_init(mod, val)) { if ((in_init(mod, val) && in_core(mod, (uint64_t)location)) ||
/* Calls to init code from core are bad news */ (in_core(mod, val) && in_init(mod, (uint64_t)location))) {
if (in_core(mod, (uint64_t)location)) {
printk(KERN_ERR "%s: init symbol 0x%lx used in module code at %p\n",
mod->name, val, location);
return -ENOEXEC;
}
} else if (in_core(mod, val)) {
/* /*
* Init section may have been allocated far away from core, * Init section may have been allocated far away from core,
* if the branch won't reach, then allocate a plt for it. * if the branch won't reach, then allocate a plt for it.
*/ */
if (in_init(mod, (uint64_t)location)) { uint64_t delta = ((int64_t)val - (int64_t)location) / 16;
uint64_t delta = ((int64_t)val - (int64_t)location) / 16; if (delta + (1 << 20) >= (1 << 21)) {
if (delta + (1 << 20) >= (1 << 21)) { val = get_fdesc(mod, val, &ok);
val = get_fdesc(mod, val, &ok); val = get_plt(mod, location, val, &ok);
val = get_plt(mod, location, val, &ok);
}
} }
} else } else if (!is_internal(mod, val))
val = get_plt(mod, location, val, &ok); val = get_plt(mod, location, val, &ok);
/* FALL THROUGH */ /* FALL THROUGH */
default: default:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment