Skip to content

Commit

Permalink
module: Don't report discarded init pages as kernel text.
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
rustyrussell committed Jan 29, 2008
1 parent 8561b08 commit a2da405
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion kernel/extable.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ int core_kernel_text(unsigned long addr)
addr <= (unsigned long)_etext)
return 1;

if (addr >= (unsigned long)_sinittext &&
if (system_state == SYSTEM_BOOTING &&
addr >= (unsigned long)_sinittext &&
addr <= (unsigned long)_einittext)
return 1;
return 0;
Expand Down

0 comments on commit a2da405

Please sign in to comment.