From patchwork Wed Apr 27 01:56:11 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Dmitry V. Levin" X-Patchwork-Id: 8951571 Return-Path: X-Original-To: patchwork-linux-parisc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id AE0A29F441 for ; Wed, 27 Apr 2016 02:02:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EC85020219 for ; Wed, 27 Apr 2016 02:02:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 25648201BB for ; Wed, 27 Apr 2016 02:02:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753175AbcD0CCK (ORCPT ); Tue, 26 Apr 2016 22:02:10 -0400 Received: from vmicros1.altlinux.org ([194.107.17.57]:58808 "EHLO micros1.altlinux.org" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753092AbcD0CCI (ORCPT ); Tue, 26 Apr 2016 22:02:08 -0400 X-Greylist: delayed 353 seconds by postgrey-1.27 at vger.kernel.org; Tue, 26 Apr 2016 22:02:08 EDT Received: from mua.local.altlinux.org (mua.local.altlinux.org [192.168.1.14]) by micros1.altlinux.org (Postfix) with ESMTP id 052D372E51C; Wed, 27 Apr 2016 04:56:12 +0300 (MSK) Received: by mua.local.altlinux.org (Postfix, from userid 508) id EA65E7CDED9; Wed, 27 Apr 2016 04:56:11 +0300 (MSK) Date: Wed, 27 Apr 2016 04:56:11 +0300 From: "Dmitry V. Levin" To: "James E.J. Bottomley" , Helge Deller Cc: Mike Frysinger , linux-parisc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] parisc: fix a bug when syscall number of tracee is __NR_Linux_syscalls Message-ID: <20160427015611.GA23316@altlinux.org> Mime-Version: 1.0 Content-Disposition: inline Sender: linux-parisc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org X-Spam-Status: No, score=-7.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Do not load one entry beyond the end of the syscall table when the syscall number of a traced process equals to __NR_Linux_syscalls. Similar bug with regular processes was fixed by commit 3bb457af4fa8 ("[PARISC] Fix bug when syscall nr is __NR_Linux_syscalls"). This bug was found by strace test suite. Cc: stable@vger.kernel.org Signed-off-by: Dmitry V. Levin Acked-by: Helge Deller --- arch/parisc/kernel/syscall.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/parisc/kernel/syscall.S b/arch/parisc/kernel/syscall.S index c976ebf..57b4836 100644 --- a/arch/parisc/kernel/syscall.S +++ b/arch/parisc/kernel/syscall.S @@ -344,7 +344,7 @@ tracesys_next: #endif cmpib,COND(=),n -1,%r20,tracesys_exit /* seccomp may have returned -1 */ - comiclr,>>= __NR_Linux_syscalls, %r20, %r0 + comiclr,>> __NR_Linux_syscalls, %r20, %r0 b,n .Ltracesys_nosys LDREGX %r20(%r19), %r19