[V2] powerpc/ptrace: Fix out of bounds array access warning

Michael Ellerman mpe at ellerman.id.au
Tue Jun 7 13:35:49 AEST 2016


On Mon, 2016-25-04 at 16:19:17 UTC, Khem Raj wrote:
> gcc-6 correctly warns about a out of bounds access
> 
> arch/powerpc/kernel/ptrace.c:407:24: warning: index 32 denotes an offset greater than size of 'u64[32][1] {aka long long unsigned int[32][1]}' [-Warray-bounds]
>         offsetof(struct thread_fp_state, fpr[32][0]));
>                         ^
> 
> check the end of array instead of beginning of next element to fix this
> 
> Signed-off-by: Khem Raj <raj.khem at gmail.com>
> Cc: Kees Cook <keescook at chromium.org>
> Cc: Michael Ellerman <mpe at ellerman.id.au>
> Cc: Segher Boessenkool <segher at kernel.crashing.org>
> Tested-by: Aaro Koskinen <aaro.koskinen at iki.fi>
> Acked-by: Olof Johansson <olof at lixom.net>

Applied to powerpc fixes, thanks.

https://git.kernel.org/powerpc/c/1e407ee3b21f981140491d5b8a

cheers


More information about the Linuxppc-dev mailing list