Commit a2da4052f1df6bc77749f84496fe731ab8b458f7

Authored by Rusty Russell
1 parent 8561b089af

module: Don't report discarded init pages as kernel text.

Current code could cause a bug in symbol_put_addr() if an arch used
kmalloc module text: we might think the symbol belongs to the core
kernel.

The downside is that this might make backtraces through (discarded)
init functions harder to read on some archs, but we already have that
issue for modules and noone has complained.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

Showing 1 changed file with 2 additions and 1 deletions Side-by-side Diff

... ... @@ -46,7 +46,8 @@
46 46 addr <= (unsigned long)_etext)
47 47 return 1;
48 48  
49   - if (addr >= (unsigned long)_sinittext &&
  49 + if (system_state == SYSTEM_BOOTING &&
  50 + addr >= (unsigned long)_sinittext &&
50 51 addr <= (unsigned long)_einittext)
51 52 return 1;
52 53 return 0;