aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/process.c
diff options
context:
space:
mode:
authorAnton Blanchard <anton@samba.org>2009-02-21 20:50:07 -0500
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2009-02-22 23:53:21 -0500
commit501cb16d3cfdcca99ac26fe122079f2a43b046b8 (patch)
tree90feee70ffa3e15857908f842e5764649141270b /arch/powerpc/kernel/process.c
parent002b0ec73dd8b784004e5a013ad9f2fa6274af5a (diff)
powerpc: Randomise PIEs
Randomise ELF_ET_DYN_BASE, which is used when loading position independent executables. Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/kernel/process.c')
-rw-r--r--arch/powerpc/kernel/process.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index 30b149ce7598..eac064948780 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -1170,3 +1170,13 @@ unsigned long arch_randomize_brk(struct mm_struct *mm)
1170 1170
1171 return ret; 1171 return ret;
1172} 1172}
1173
1174unsigned long randomize_et_dyn(unsigned long base)
1175{
1176 unsigned long ret = PAGE_ALIGN(base + brk_rnd());
1177
1178 if (ret < base)
1179 return base;
1180
1181 return ret;
1182}