aboutsummaryrefslogtreecommitdiffstats
path: root/fs/binfmt_elf.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/binfmt_elf.c')
-rw-r--r--fs/binfmt_elf.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c
index 672a3b90bc55..dfd8cfb7fb5d 100644
--- a/fs/binfmt_elf.c
+++ b/fs/binfmt_elf.c
@@ -515,7 +515,8 @@ static unsigned long randomize_stack_top(unsigned long stack_top)
515{ 515{
516 unsigned int random_variable = 0; 516 unsigned int random_variable = 0;
517 517
518 if (current->flags & PF_RANDOMIZE) { 518 if ((current->flags & PF_RANDOMIZE) &&
519 !(current->personality & ADDR_NO_RANDOMIZE)) {
519 random_variable = get_random_int() & STACK_RND_MASK; 520 random_variable = get_random_int() & STACK_RND_MASK;
520 random_variable <<= PAGE_SHIFT; 521 random_variable <<= PAGE_SHIFT;
521 } 522 }
@@ -1262,7 +1263,7 @@ static void fill_elf_header(struct elfhdr *elf, int segs)
1262 return; 1263 return;
1263} 1264}
1264 1265
1265static void fill_elf_note_phdr(struct elf_phdr *phdr, int sz, off_t offset) 1266static void fill_elf_note_phdr(struct elf_phdr *phdr, int sz, loff_t offset)
1266{ 1267{
1267 phdr->p_type = PT_NOTE; 1268 phdr->p_type = PT_NOTE;
1268 phdr->p_offset = offset; 1269 phdr->p_offset = offset;
@@ -1428,7 +1429,7 @@ static int elf_core_dump(long signr, struct pt_regs *regs, struct file *file)
1428 int i; 1429 int i;
1429 struct vm_area_struct *vma; 1430 struct vm_area_struct *vma;
1430 struct elfhdr *elf = NULL; 1431 struct elfhdr *elf = NULL;
1431 off_t offset = 0, dataoff; 1432 loff_t offset = 0, dataoff;
1432 unsigned long limit = current->signal->rlim[RLIMIT_CORE].rlim_cur; 1433 unsigned long limit = current->signal->rlim[RLIMIT_CORE].rlim_cur;
1433 int numnote; 1434 int numnote;
1434 struct memelfnote *notes = NULL; 1435 struct memelfnote *notes = NULL;
@@ -1661,11 +1662,11 @@ static int elf_core_dump(long signr, struct pt_regs *regs, struct file *file)
1661 ELF_CORE_WRITE_EXTRA_DATA; 1662 ELF_CORE_WRITE_EXTRA_DATA;
1662#endif 1663#endif
1663 1664
1664 if ((off_t)file->f_pos != offset) { 1665 if (file->f_pos != offset) {
1665 /* Sanity check */ 1666 /* Sanity check */
1666 printk(KERN_WARNING 1667 printk(KERN_WARNING
1667 "elf_core_dump: file->f_pos (%ld) != offset (%ld)\n", 1668 "elf_core_dump: file->f_pos (%Ld) != offset (%Ld)\n",
1668 (off_t)file->f_pos, offset); 1669 file->f_pos, offset);
1669 } 1670 }
1670 1671
1671end_coredump: 1672end_coredump: