RE: [PATCH v2] binfmt_elf: Fix PIE execution with randomizationdisabled (was Re: [RFC PATCH] binfmt_elf: Fix PIE execution with randomizationdisabled)

From: Jiri Kosina
Date: Mon Oct 03 2011 - 17:14:37 EST


On Mon, 3 Oct 2011, Lu, Hongjiu wrote:

> Why not
>
> #if defined(CONFIG_X86) || defined(CONFIG_ARM)
> #define CHECK_PF_RANDOMIZE 1
> #else
> #define CHECK_PF_RANDOMIZE 0
> #endif
> if (CHECK_PF_RANDOMIZE && (current->flags & PF_RANDOMIZE))
> load_bias = 0;
> else
> load_bias = ELF_PAGESTART(ELF_ET_DYN_BASE - vaddr);

If anything, that is not particularly good name for that macro (as we are
checking current->flags for PF_RANDOMIZE at other places indepenedntly on
this).

Personally, I find my original patch the most readable one, but I don't
care much, it's really bike-shedding.

--
Jiri Kosina
SUSE Labs
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/