View | Details | Raw Unified | Return to bug 66721
Collapse All | Expand All

(-)a/fs/binfmt_elf.c (-2 / +6 lines)
Lines 809-816 static int load_elf_binary(struct linux_binprm *bprm) Link Here
809
			 * If that is the case, retain the original non-zero
809
			 * If that is the case, retain the original non-zero
810
			 * load_bias value in order to establish proper
810
			 * load_bias value in order to establish proper
811
			 * non-randomized mappings.
811
			 * non-randomized mappings.
812
			 * If the first PT_LOAD segment has non-zero p_vaddr,
813
			 * use the zero load_bias so that a PIE binary will be
814
			 * loaded at the specific address even if memory
815
			 * randomization is off.
812
			 */
816
			 */
813
			if (current->flags & PF_RANDOMIZE)
817
			if ((current->flags & PF_RANDOMIZE) ||
818
			    (!load_addr_set && vaddr))
814
				load_bias = 0;
819
				load_bias = 0;
815
			else
820
			else
816
				load_bias = ELF_PAGESTART(ELF_ET_DYN_BASE - vaddr);
821
				load_bias = ELF_PAGESTART(ELF_ET_DYN_BASE - vaddr);
817
- 

Return to bug 66721