Re: [PATCH] i386 and x86_64: randomize brk()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jiri Kosina wrote:
> On Thu, 30 Aug 2007, Mike Frysinger wrote:
> 
>> Blackfin too please :) i think v850 also falls into this category, but 
>> i'm not terribly familiar with it ...
> 
> Andrew, do you still strongly oppose to having ARCH_HAS_RANDOMIZE_BRK 
> macro instead please?
> 

you might want to use a weak function instead ?

void __weak arch_randomize_brk(void)
{
	/* nada by default */
}

and overload it only for x86 architectures by now.

BTW, how about minimize the arch specific code by slighly changing its
prototype  ?

unsigned long arch_randomize_brk(struct mm_struct *mm)
{
	unsigned long range_end = mm->brk + 0x02000000;
	
	return randomize_range(mm->brk, range_end, 0) ? : mm->brk;
}

		Franck
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux