Re: [PATCH backport for 4.18] rseq/selftests: fix parametrized test with -fpie

From: Shuah Khan
Date: Thu Oct 04 2018 - 15:19:10 EST


On 10/04/2018 01:04 PM, Mathieu Desnoyers wrote:
> commit ce01a1575f45bf319e374592656441021a7f5823 upstream.
>
> On x86-64, the parametrized selftest code for rseq crashes with a
> segmentation fault when compiled with -fpie. This happens when the
> param_test binary is loaded at an address beyond 32-bit on x86-64.
>
> The issue is caused by use of a 32-bit register to hold the address
> of the loop counter variable.
>
> Fix this by using a 64-bit register to calculate the address of the
> loop counter variables as an offset from rip.
>
> Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@xxxxxxxxxxxx>
> Acked-by: "Paul E . McKenney" <paulmck@xxxxxxxxxxxxxxxxxx>

Thanks for q quick back-port.

Acked-by: Shuah Khan (Samsung OSG) <shuah@xxxxxxxxxx>

thanks,
-- Shuah