From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi0-f65.google.com (mail-oi0-f65.google.com [209.85.218.65]) by mail.openembedded.org (Postfix) with ESMTP id 94C2F606D0 for ; Wed, 11 May 2016 21:27:05 +0000 (UTC) Received: by mail-oi0-f65.google.com with SMTP id i2so9317672oib.3 for ; Wed, 11 May 2016 14:27:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=2gZ4wjONatepUAIxaCvVM45FV++7gfqYXusYdKR8F1c=; b=opiLTH6xU/nwfy6BV8h3ZHV3B5s6X/iaktoxHBqWEYo+zAeIyA18T/WNw0/s62V00u BvjJ8Wvd7Qxm4lEViRaJOdVyJ8ayPzZ8l/SkxsqJ64X9mIRPIPXROa98bHuepj87bqeZ 2+W0DKnVKGCAov7Fq8AqL9djm+nMFNXxYnFv6UnT9HYtpevXHLi1vPGpIDEzDd2fzFF0 kmFPqLwC8uWZaLopa8Ow96IQ37VlA2NCFxkdDtQV0iJoCs9NDQODjUejcxKZD1kG2A5y /hwHWQsLKLXN/0Q1T2V5IxhcSIKps7pTcn2rluUhbgkLPEC5RcWYm10GafjoUGpXelPH nuBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=2gZ4wjONatepUAIxaCvVM45FV++7gfqYXusYdKR8F1c=; b=KUHtZCe1nstl4plEEb9FvKxHZ814Meijs91I5j42fDe2HwbI1Bsjra+Ewx/isksPtb XPfpMGCkf4N1NIBPVhij4A73jLICDYP2NMarWgRL3Y7V8/oB9rPpmcYfrRqqoaNtUb1B mH9bunMa3FDk8j3u3HBTeyYeRkj/0Kg6sQ2HQVSVL409EVv/2ItAqwtI/ECxL8+e6euR O3vLS9GGfJaUOgqI4x+0R6apRmuGoFTaJOi6FvqnIBnk2hLnppDPdNzol5GFd8CIW1xl +CS1mZ5BIxbzZVr+C5HiPMKUExZgs8LLIRs4/nmHYLUT/nImqTD6py0IoTeGtQZsPhxq iI+w== X-Gm-Message-State: AOPr4FWlx3Ntt5l3l39QvRXV/nQSS/yraxlAcoAntgqLxiDYiN2Nq1ZsSLOAqRF0kSs7LJnC1Q932qE2zUH5rw== MIME-Version: 1.0 X-Received: by 10.157.37.45 with SMTP id k42mr3586426otb.119.1463002025777; Wed, 11 May 2016 14:27:05 -0700 (PDT) Received: by 10.157.32.135 with HTTP; Wed, 11 May 2016 14:27:05 -0700 (PDT) In-Reply-To: <1d16314288f1f93b21bacd0016d23abcab52b501.1462987863.git.raj.khem@gmail.com> References: <2e51e9b5fb3911436afc1becd5feb9351b896fa4.1462987863.git.raj.khem@gmail.com> <1d16314288f1f93b21bacd0016d23abcab52b501.1462987863.git.raj.khem@gmail.com> Date: Wed, 11 May 2016 17:27:05 -0400 Message-ID: From: Bruce Ashfield To: Khem Raj Cc: Patches and discussions about the oe-core layer Subject: Re: [PATCH 22/42] linux-yocto: Fix build on ppc with gcc-6 X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 May 2016 21:27:06 -0000 Content-Type: multipart/alternative; boundary=001a11352e460d62ff053297b494 --001a11352e460d62ff053297b494 Content-Type: text/plain; charset=UTF-8 On Wed, May 11, 2016 at 1:35 PM, Khem Raj wrote: > Signed-off-by: Khem Raj > These shouldn't be carried out of tree. So can you drop the linux-yocto changes from the series, and I'll look at getting them integrated later. Bruce > --- > ...ace-Fix-out-of-bounds-array-access-warnin.patch | 50 > ++++++++++++++++++++++ > meta/recipes-kernel/linux/linux-yocto_4.4.bb | 4 +- > 2 files changed, 53 insertions(+), 1 deletion(-) > create mode 100644 > meta/recipes-kernel/linux/linux-yocto/0001-powerpc-ptrace-Fix-out-of-bounds-array-access-warnin.patch > > diff --git > a/meta/recipes-kernel/linux/linux-yocto/0001-powerpc-ptrace-Fix-out-of-bounds-array-access-warnin.patch > b/meta/recipes-kernel/linux/linux-yocto/0001-powerpc-ptrace-Fix-out-of-bounds-array-access-warnin.patch > new file mode 100644 > index 0000000..05315ed > --- /dev/null > +++ > b/meta/recipes-kernel/linux/linux-yocto/0001-powerpc-ptrace-Fix-out-of-bounds-array-access-warnin.patch > @@ -0,0 +1,50 @@ > +From 32acc1d9a5738b02e8815047af8886978aa40ead Mon Sep 17 00:00:00 2001 > +From: Khem Raj > +Date: Mon, 25 Apr 2016 05:47:01 +0000 > +Subject: [PATCH V2] 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 > +Cc: Kees Cook > +Cc: Michael Ellerman > +Cc: Segher Boessenkool > +--- > +Changes from v1 to v2: > + > +- Check for fpr[32] instead of fpr[31][1] > + > + arch/powerpc/kernel/ptrace.c | 4 ++-- > + 1 file changed, 2 insertions(+), 2 deletions(-) > + > +diff --git a/arch/powerpc/kernel/ptrace.c b/arch/powerpc/kernel/ptrace.c > +index 737c0d0..b38fd08 100644 > +--- a/arch/powerpc/kernel/ptrace.c > ++++ b/arch/powerpc/kernel/ptrace.c > +@@ -376,7 +376,7 @@ static int fpr_get(struct task_struct *target, const > struct user_regset *regset, > + > + #else > + BUILD_BUG_ON(offsetof(struct thread_fp_state, fpscr) != > +- offsetof(struct thread_fp_state, fpr[32][0])); > ++ offsetof(struct thread_fp_state, fpr[32])); > + > + return user_regset_copyout(&pos, &count, &kbuf, &ubuf, > + &target->thread.fp_state, 0, -1); > +@@ -404,7 +404,7 @@ static int fpr_set(struct task_struct *target, const > struct user_regset *regset, > + return 0; > + #else > + BUILD_BUG_ON(offsetof(struct thread_fp_state, fpscr) != > +- offsetof(struct thread_fp_state, fpr[32][0])); > ++ offsetof(struct thread_fp_state, fpr[32])); > + > + return user_regset_copyin(&pos, &count, &kbuf, &ubuf, > + &target->thread.fp_state, 0, -1); > +-- > +1.9.1 > + > diff --git a/meta/recipes-kernel/linux/linux-yocto_4.4.bb > b/meta/recipes-kernel/linux/linux-yocto_4.4.bb > index b74903e..fbb592a 100644 > --- a/meta/recipes-kernel/linux/linux-yocto_4.4.bb > +++ b/meta/recipes-kernel/linux/linux-yocto_4.4.bb > @@ -22,7 +22,9 @@ SRCREV_machine ?= > "b18090556c1d1b449233cd555c27a04d38272d6d" > SRCREV_meta ?= "9ab4787fe2aea2ae0fcc31a5e067eaba19ef64c8" > > SRC_URI = "git:// > git.yoctoproject.org/linux-yocto-4.4.git;name=machine;branch=${KBRANCH}; \ > - git:// > git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-4.4;destsuffix=${KMETA} > " > + git:// > git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-4.4;destsuffix=${KMETA} > \ > + > file://0001-powerpc-ptrace-Fix-out-of-bounds-array-access-warnin.patch \ > +" > > LINUX_VERSION ?= "4.4.3" > > -- > 2.8.2 > > -- > _______________________________________________ > Openembedded-core mailing list > Openembedded-core@lists.openembedded.org > http://lists.openembedded.org/mailman/listinfo/openembedded-core > -- "Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end" --001a11352e460d62ff053297b494 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


On Wed, May 11, 2016 at 1:35 PM, Khem Raj <raj.khem@gmail.com>= wrote:
Signed-off-by: Khem Raj &l= t;raj.khem@gmail.com>


These shouldn't be carried o= ut of tree. So can you drop the linux-yocto changes from the
seri= es, and I'll look at getting them integrated later.

Bruce
=C2=A0
---
=C2=A0...ace-Fix-out-of-bounds-array-access-warnin.patch | 50 +++++++++++++= +++++++++
=C2=A0meta/recipes-kernel/linux/linux-yocto_4.4.bb=C2=A0 =C2=A0 =C2= =A0 =C2=A0|=C2=A0 4 +-
=C2=A02 files changed, 53 insertions(+), 1 deletion(-)
=C2=A0create mode 100644 meta/recipes-kernel/linux/linux-yocto/0001-powerpc= -ptrace-Fix-out-of-bounds-array-access-warnin.patch

diff --git a/meta/recipes-kernel/linux/linux-yocto/0001-powerpc-ptrace-Fix-= out-of-bounds-array-access-warnin.patch b/meta/recipes-kernel/linux/linux-y= octo/0001-powerpc-ptrace-Fix-out-of-bounds-array-access-warnin.patch
new file mode 100644
index 0000000..05315ed
--- /dev/null
+++ b/meta/recipes-kernel/linux/linux-yocto/0001-powerpc-ptrace-Fix-out-of-= bounds-array-access-warnin.patch
@@ -0,0 +1,50 @@
+From 32acc1d9a5738b02e8815047af8886978aa40ead Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.co= m>
+Date: Mon, 25 Apr 2016 05:47:01 +0000
+Subject: [PATCH V2] 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 g= reater than size of 'u64[32][1] {aka long long unsigned int[32][1]}'= ; [-Warray-bounds]
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 offsetof(struct thread_fp_state, fpr[32][0]));=
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 ^
+
+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@chromi= um.org>
+Cc: Michael Ellerman <mpe@ellerma= n.id.au>
+Cc: Segher Boessenkool <s= egher@kernel.crashing.org>
+---
+Changes from v1 to v2:
+
+- Check for fpr[32] instead of fpr[31][1]
+
+ arch/powerpc/kernel/ptrace.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/arch/powerpc/kernel/ptrace.c b/arch/powerpc/kernel/ptrace.c +index 737c0d0..b38fd08 100644
+--- a/arch/powerpc/kernel/ptrace.c
++++ b/arch/powerpc/kernel/ptrace.c
+@@ -376,7 +376,7 @@ static int fpr_get(struct task_struct *target, const s= truct user_regset *regset,
+
+ #else
+=C2=A0 =C2=A0 =C2=A0 =C2=A0BUILD_BUG_ON(offsetof(struct thread_fp_state, f= pscr) !=3D
+-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0offs= etof(struct thread_fp_state, fpr[32][0]));
++=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0offs= etof(struct thread_fp_state, fpr[32]));
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0return user_regset_copyout(&pos, &count= , &kbuf, &ubuf,
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &target->thread.fp_sta= te, 0, -1);
+@@ -404,7 +404,7 @@ static int fpr_set(struct task_struct *target, const s= truct user_regset *regset,
+=C2=A0 =C2=A0 =C2=A0 =C2=A0return 0;
+ #else
+=C2=A0 =C2=A0 =C2=A0 =C2=A0BUILD_BUG_ON(offsetof(struct thread_fp_state, f= pscr) !=3D
+-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0offs= etof(struct thread_fp_state, fpr[32][0]));
++=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0offs= etof(struct thread_fp_state, fpr[32]));
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0return user_regset_copyin(&pos, &count,= &kbuf, &ubuf,
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&target->thread.fp_stat= e, 0, -1);
+--
+1.9.1
+
diff --git a/meta/recipes-kernel/linux/linux-yocto_4.4.bb b/meta/recipe= s-kernel/linux/linux-yocto_4.4.bb
index b74903e..fbb592a 100644
--- a/meta/recipes-kernel/linux/linux-yocto_4.4.bb
+++ b/meta/recipes-kernel/linux/linux-yocto_4.4.bb
@@ -22,7 +22,9 @@ SRCREV_machine ?=3D "b18090556c1d1b449233cd555c27a04= d38272d6d"
=C2=A0SRCREV_meta ?=3D "9ab4787fe2aea2ae0fcc31a5e067eaba19ef64c8"=

=C2=A0SRC_URI =3D "git://git.yoctoproject.org/linux-yocto-4.4.git;name=3Dmachine;branch= =3D${KBRANCH}; \
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0git://git.yoctoprojec= t.org/yocto-kernel-cache;type=3Dkmeta;name=3Dmeta;branch=3Dyocto-4.4;destsu= ffix=3D${KMETA}"
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0git://git.yoctoprojec= t.org/yocto-kernel-cache;type=3Dkmeta;name=3Dmeta;branch=3Dyocto-4.4;destsu= ffix=3D${KMETA} \
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0file://0001-powerpc-ptrace-Fix-ou= t-of-bounds-array-access-warnin.patch \
+"

=C2=A0LINUX_VERSION ?=3D "4.4.3"

--
2.8.2

--
_______________________________________________
Openembedded-core mailing list
Openembedded-co= re@lists.openembedded.org
http://lists.openembedded.org/mailma= n/listinfo/openembedded-core



--
"Thou shalt not follow the NULL point= er, for chaos and madness await thee at its end"
--001a11352e460d62ff053297b494--