[lkml]   [2006]   [Jan]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    Patch in this message
    Subject[PATCH] i386: instead of poisoning .init zone, change protection bits to force a fault
    Chasing some invalid accesses to .init zone, I found that free_init_pages() 
    was properly freeing the pages but virtual was still usable.

    A poisoning (memset(page, 0xcc, PAGE_SIZE)) was done but this is not reliable.

    Applying this patch at least in mm is a good thing...

    (After that we could map non possible cpu percpu data to the initial
    percpudata that is included in .init and discarded in free_initmem())

    Signed-off-by: Eric Dumazet <>

    --- linux-2.6.16-rc1-mm3/arch/i386/mm/init.c 2006-01-25 10:17:24.000000000 +0100
    +++ linux-2.6.16-rc1-mm3-ed/arch/i386/mm/init.c 2006-01-29 21:46:39.000000000 +0100
    @@ -750,11 +750,12 @@
    for (addr = begin; addr < end; addr += PAGE_SIZE) {
    set_page_count(virt_to_page(addr), 1);
    - memset((void *)addr, 0xcc, PAGE_SIZE);
    + change_page_attr(virt_to_page(addr), 1, __pgprot(0));
    printk(KERN_INFO "Freeing %s: %ldk freed\n", what, (end - begin) >> 10);
    + global_flush_tlb();

    void free_initmem(void)
     \ /
      Last update: 2006-01-29 21:07    [W:0.018 / U:37.832 seconds]
    ©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site