lkml.org 
[lkml]   [2005]   [Jan]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: Patch 4/6 randomize the stack pointer
    On Thu, Jan 27, 2005 at 03:40:48PM -0500, Rik van Riel wrote:
    > On Thu, 27 Jan 2005, Christoph Hellwig wrote:
    >
    > >>+unsigned long arch_align_stack(unsigned long sp)
    > >>+{
    > >>+ if (randomize_va_space)
    > >>+ sp -= ((get_random_int() % 4096) << 4);
    > >>+ return sp & ~0xf;
    > >>+}
    > >
    > >this looks like it'd work nicely on all architectures.
    >
    > I guess it should work for all architectures using ELF,
    > not sure if it might break some of the more obscure
    > architectures ...

    So it works for all CONFIG_MMU architectures. Arjan mentioned that
    the minimum stack alignment might be different, so the 4 should
    become a per-arch constant and we can make the code unconditional
    for CONFIG_MMU?
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2005-03-22 14:09    [W:3.458 / U:0.060 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site