lkml.org 
[lkml]   [2005]   [Jan]   [27]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateThu, 27 Jan 2005 15:40:48 -0500 (EST)
FromRik van Riel <>
SubjectRe: Patch 4/6 randomize the stack pointer
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 ...

-- 
"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it." - Brian W. Kernighan
-
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    [from the cache]
©2003-2008