Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id EF960E00D9A; Wed, 27 Apr 2016 06:30:06 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on yocto-www.yoctoproject.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 X-Spam-HAM-Report: * -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low * trust * [185.38.181.41 listed in list.dnswl.org] * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] X-Greylist: delayed 133 seconds by postgrey-1.32 at yocto-www; Wed, 27 Apr 2016 06:30:03 PDT Received: from smtp-out11.electric.net (smtp-out11.electric.net [185.38.181.41]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id 8C528E00D91 for ; Wed, 27 Apr 2016 06:30:03 -0700 (PDT) Received: from 1avPVM-0001N0-WE by out11b.electric.net with emc1-ok (Exim 4.87) (envelope-from ) id 1avPVN-0001Nc-Ti for meta-freescale@yoctoproject.org; Wed, 27 Apr 2016 06:27:49 -0700 Received: by emcmailer; Wed, 27 Apr 2016 06:27:49 -0700 Received: from [192.36.1.72] (helo=mx-3.enea.com) by out11b.electric.net with esmtps (TLSv1:AES128-SHA:128) (Exim 4.87) (envelope-from ) id 1avPVM-0001N0-WE for meta-freescale@yoctoproject.org; Wed, 27 Apr 2016 06:27:48 -0700 Received: from sestofb10.enea.se (172.21.3.145) by smtp.enea.com (172.21.1.209) with Microsoft SMTP Server id 14.3.294.0; Wed, 27 Apr 2016 15:27:48 +0200 Received: by sestofb10.enea.se (Postfix, from userid 4538) id B8F3328D9F4; Wed, 27 Apr 2016 15:27:48 +0200 (CEST) From: Paul Vaduva To: Date: Wed, 27 Apr 2016 15:27:21 +0200 Message-ID: <1461763641-10680-1-git-send-email-Paul.Vaduva@enea.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 Received-SPF: None (SESTOEX03.enea.se: Paul.Vaduva@enea.com does not designate permitted sender hosts) X-Outbound-IP: 192.36.1.72 X-Env-From: Paul.Vaduva@enea.com X-PolicySMART: 6551647 X-Virus-Status: Scanned by VirusSMART (c) X-Virus-Status: Scanned by VirusSMART (s) X-Mailman-Approved-At: Fri, 29 Apr 2016 07:18:59 -0700 Cc: Paul Vaduva Subject: [meta-fsl-ppc krogoth][PATCH 1/1] ipc: fix compat msgrcv with negative msgtyp X-BeenThere: meta-freescale@yoctoproject.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Usage and development list for the meta-fsl-* layers List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Apr 2016 13:30:07 -0000 Content-Type: text/plain BugLink: http://bugs.launchpad.net/bugs/1393355 Compat function takes msgtyp argument as u32 and passes it down to do_msgrcv which results in casting to long, thus the sign is lost and we get a big positive number instead. Cast the argument to signed type before passing it down. Signed-off-by: Paul Vaduva --- ...pc-fix-compat-msgrcv-with-negative-msgtyp.patch | 27 ++++++++++++++++++++++ recipes-kernel/linux/linux-qoriq_3.12.bb | 1 + 2 files changed, 28 insertions(+) create mode 100644 recipes-kernel/linux/files/Trusty-SRU-ipc-fix-compat-msgrcv-with-negative-msgtyp.patch diff --git a/recipes-kernel/linux/files/Trusty-SRU-ipc-fix-compat-msgrcv-with-negative-msgtyp.patch b/recipes-kernel/linux/files/Trusty-SRU-ipc-fix-compat-msgrcv-with-negative-msgtyp.patch new file mode 100644 index 0000000..b90a114 --- /dev/null +++ b/recipes-kernel/linux/files/Trusty-SRU-ipc-fix-compat-msgrcv-with-negative-msgtyp.patch @@ -0,0 +1,27 @@ +BugLink: http://bugs.launchpad.net/bugs/1393355 + +Compat function takes msgtyp argument as u32 and passes it down to +do_msgrcv which results in casting to long, thus the sign is lost and we +get a big positive number instead. + +Cast the argument to signed type before passing it down. + +Signed-off-by: Mateusz Guzik +Reported-by: Gabriellla Schmidt + +Upstream-Status::Backport +Kernel 3.14 + +diff --git a/ipc/compat.c b/ipc/compat.c +index 892f658..d3b3760 100644 +--- a/ipc/compat.c ++++ b/ipc/compat.c +@@ -381,7 +381,7 @@ COMPAT_SYSCALL_DEFINE6(ipc, u32, call, int, first, int, second, + uptr = compat_ptr(ipck.msgp); + fifth = ipck.msgtyp; + } +- return do_msgrcv(first, uptr, second, fifth, third, ++ return do_msgrcv(first, uptr, second, (s32)fifth, third, + compat_do_msg_fill); + } + case MSGGET: diff --git a/recipes-kernel/linux/linux-qoriq_3.12.bb b/recipes-kernel/linux/linux-qoriq_3.12.bb index 110d7ce..889c564 100644 --- a/recipes-kernel/linux/linux-qoriq_3.12.bb +++ b/recipes-kernel/linux/linux-qoriq_3.12.bb @@ -4,5 +4,6 @@ SRC_URI = "git://git.freescale.com/ppc/sdk/linux.git;branch=sdk-v1.9.x \ file://modify-defconfig-t1040-nr-cpus.patch \ file://net-sctp-CVE-2014-0101.patch \ file://0001-powerpc-Align-TOC-to-256-bytes.patch \ + file://Trusty-SRU-ipc-fix-compat-msgrcv-with-negative-msgtyp.patch \ " SRCREV = "43cecda943a6c40a833b588801b0929e8bd48813" -- 1.9.1