[S390] Randomize PIEs
Randomize ELF_ET_DYN_BASE, which is used when loading position independent executables. Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
This commit is contained in:
committed by
Martin Schwidefsky
parent
3351918282
commit
d2c9dfccbc
@@ -359,3 +359,14 @@ unsigned long arch_randomize_brk(struct mm_struct *mm)
|
||||
return mm->brk;
|
||||
return ret;
|
||||
}
|
||||
|
||||
unsigned long randomize_et_dyn(unsigned long base)
|
||||
{
|
||||
unsigned long ret = PAGE_ALIGN(base + brk_rnd());
|
||||
|
||||
if (!(current->flags & PF_RANDOMIZE))
|
||||
return base;
|
||||
if (ret < base)
|
||||
return base;
|
||||
return ret;
|
||||
}
|
||||
|
Reference in New Issue
Block a user