New issue
Advanced search Search tips

Issue 657550 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Oct 2016
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

ppc:pasemi_defconfig build failure

Project Member Reported by groeck@chromium.org, Oct 19 2016

Issue description

/work/build/batch/arch/powerpc/kernel/ptrace.c: In function 'fpr_get':
/work/build/batch/arch/powerpc/kernel/ptrace.c:378:104: error: index 32 denotes an offset greater than size of 'u64[32][1] {aka long long unsigned int[32][1]}' [-Werror=array-bounds]
  BUILD_BUG_ON(offsetof(struct thread_fp_state, fpscr) !=
                                                                                                        ^              
/work/build/batch/arch/powerpc/kernel/ptrace.c: In function 'fpr_set':
/work/build/batch/arch/powerpc/kernel/ptrace.c:406:104: error: index 32 denotes an offset greater than size of 'u64[32][1] {aka long long unsigned int[32][1]}' [-Werror=array-bounds]
  BUILD_BUG_ON(offsetof(struct thread_fp_state, fpscr) !=
                                                                                                        ^              
cc1: all warnings being treated as errors
make[3]: *** [arch/powerpc/kernel/ptrace.o] Error 1
make[3]: Target '__build' not remade because of errors.

 
Project Member

Comment 1 by bugdroid1@chromium.org, Oct 20 2016

Labels: merge-merged-chromeos-4.4
The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/024d71d26bbe5bab5cd560104b9719b5d71d7c73

commit 024d71d26bbe5bab5cd560104b9719b5d71d7c73
Author: Khem Raj <raj.khem@gmail.com>
Date: Mon Apr 25 16:19:17 2016

UPSTREAM: powerpc/ptrace: Fix out of bounds array access warning

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@gmail.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Segher Boessenkool <segher@kernel.crashing.org>
Tested-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Acked-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>

BUG= chromium:657550 
TEST=Build ppc:pasemi_defconfig

(cherry picked from commit 1e407ee3b21f981140491d5b8a36422979ca246f)
Signed-off-by: Guenter Roeck <groeck@chromium.org>

Change-Id: I2e0bc979a42b229df3c2e9f01c68243d65cb9172
Reviewed-on: https://chromium-review.googlesource.com/399990
Commit-Ready: Guenter Roeck <groeck@chromium.org>
Tested-by: Guenter Roeck <groeck@chromium.org>
Reviewed-by: Matthias Kaehlcke <mka@chromium.org>

[modify] https://crrev.com/024d71d26bbe5bab5cd560104b9719b5d71d7c73/arch/powerpc/kernel/ptrace.c

Comment 2 by groeck@chromium.org, Oct 25 2016

Status: Fixed (was: Started)

Sign in to add a comment