[PATCHv2] arm64: Add CONFIG_CC_STACKPROTECTOR

Will Deacon will.deacon at arm.com
Mon Jan 27 04:59:58 EST 2014


Hi Laura,

On Fri, Jan 24, 2014 at 11:09:15PM +0000, Laura Abbott wrote:
> arm64 currently lacks support for -fstack-protector. Add
> similar functionality to arm to detect stack corruption.

[...]

> +/*
> + * Initialize the stackprotector canary value.
> + *
> + * NOTE: this must only be called from functions that never return,
> + * and it must always be inlined.
> + */
> +static __always_inline void boot_init_stack_canary(void)
> +{
> +	unsigned long canary;
> +
> +	/* Try to get a semi random initial value. */
> +	get_random_bytes(&canary, sizeof(canary));
> +	canary ^= LINUX_VERSION_CODE;
> +
> +	current->stack_canary = canary;

Do we actually need this line now?

Will



More information about the linux-arm-kernel mailing list