mirror of
https://github.com/torvalds/linux.git
synced 2024-11-11 06:31:49 +00:00
[PARISC] Use DEBUG_KERNEL to catch used-after-free __init data
Use CONFIG_DEBUG_KERNEL to catch kernel code which tries to access __init data after it is freed. When CONFIG_DEBUG_KERNEL is not set this also cleans up a WARN_ON at boot time. Also remove some dead code from mm/init.c Signed-off-by: Helge Deller <deller@parisc-linux.org> Signed-off-by: Kyle McMartin <kyle@parisc-linux.org>
This commit is contained in:
parent
1bcdd85482
commit
81a3de3efd
@ -371,17 +371,11 @@ static void __init setup_bootmem(void)
|
|||||||
|
|
||||||
void free_initmem(void)
|
void free_initmem(void)
|
||||||
{
|
{
|
||||||
/* FIXME: */
|
|
||||||
#if 0
|
|
||||||
printk(KERN_INFO "NOT FREEING INITMEM (%dk)\n",
|
|
||||||
(&__init_end - &__init_begin) >> 10);
|
|
||||||
return;
|
|
||||||
#else
|
|
||||||
unsigned long addr;
|
unsigned long addr;
|
||||||
|
|
||||||
printk(KERN_INFO "Freeing unused kernel memory: ");
|
printk(KERN_INFO "Freeing unused kernel memory: ");
|
||||||
|
|
||||||
#if 1
|
#ifdef CONFIG_DEBUG_KERNEL
|
||||||
/* Attempt to catch anyone trying to execute code here
|
/* Attempt to catch anyone trying to execute code here
|
||||||
* by filling the page with BRK insns.
|
* by filling the page with BRK insns.
|
||||||
*
|
*
|
||||||
@ -414,7 +408,6 @@ void free_initmem(void)
|
|||||||
pdc_chassis_send_status(PDC_CHASSIS_DIRECT_BCOMPLETE);
|
pdc_chassis_send_status(PDC_CHASSIS_DIRECT_BCOMPLETE);
|
||||||
|
|
||||||
printk("%luk freed\n", (unsigned long)(&__init_end - &__init_begin) >> 10);
|
printk("%luk freed\n", (unsigned long)(&__init_end - &__init_begin) >> 10);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user