Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp890457ybh; Wed, 22 Jul 2020 16:22:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzyUEOpFTi7sK35spJFMK0Ozej80BaH7V5AmGe/TpFveJkMHJxvu5CZqRtd+kgV/WmAYXjn X-Received: by 2002:a05:6402:2d7:: with SMTP id b23mr1680468edx.145.1595460142028; Wed, 22 Jul 2020 16:22:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595460142; cv=none; d=google.com; s=arc-20160816; b=VdlxE7fFQT6YH5UbhcwU69y+rJuZ8md3eMh/OGIev8V3UmmgXptpSMaH7s0s4L7Sq6 RySVkYaL/t9tMuw5gPcumAAySgKGdWMd0tDrxGCsUny59+BOUE3oI5oAMXiJh+/EVP8v k6Xfpb/V3Ln/23Yn2/B4XrPP9+0mjNyX/67hwOZmKpdmHQp68aY7lX6GqIBhM9wW6ODG MUrolVeGYLcYkenDtfoxQMVCfkNA6GYj0tk3fRgHGScuuR16H+hooXJYJxRPXL1jQKh5 Sa2fGXWwh1UwktapL28857KXuubaq/kwTyzznvDzV7s9gmmqklPza0l5AOKk/BO+SBEI 3rDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=X4T+utlvw4n6svcCTBkC6P4CixexyT6EoCQOI7kTDBY=; b=Nj1J1ghyR4cF+fy0GSX9RrIfgiR5zLneawXLMLCu9rqS9WEjQyPNDeTDHQv+5Ig+9p 1GQs0bDSIu70/YeL105RXVdo8fLKv+SV8ky6ZM3y22b04F9U6I6BMSSSLf60GyTljIEy mB7gYggb+RSbbfp4kwlhC0eW4EbEhJzA6ptO60gIkZUbr4DcMMlzgOpwp/ZgggCP3jwM wPjgnj0Mg4htcZaOmlDpJlAgrOxeoEFTf/JgPhNHw5m2p1QHnvYkpZI8ZM2doEZb5JzC Mnb2PvAvuHIE7EjtGTejyGGTni3Qd2HrUNV2x9XlbL+f4KSpZfio5k30OTaHm0HFkzB1 8cKQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a26si802293ejf.701.2020.07.22.16.22.00; Wed, 22 Jul 2020 16:22:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733218AbgGVXVO (ORCPT + 99 others); Wed, 22 Jul 2020 19:21:14 -0400 Received: from outpost17.zedat.fu-berlin.de ([130.133.4.110]:40571 "EHLO outpost17.zedat.fu-berlin.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733132AbgGVXVN (ORCPT ); Wed, 22 Jul 2020 19:21:13 -0400 X-Greylist: delayed 420 seconds by postgrey-1.27 at vger.kernel.org; Wed, 22 Jul 2020 19:21:08 EDT Received: from relay1.zedat.fu-berlin.de ([130.133.4.67]) by outpost.zedat.fu-berlin.de (Exim 4.93) with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (envelope-from ) id 1jyNw6-000bTh-Pw; Thu, 23 Jul 2020 01:14:06 +0200 Received: from mx.physik.fu-berlin.de ([160.45.64.218]) by relay1.zedat.fu-berlin.de (Exim 4.93) with esmtps (TLS1.2) tls TLS_DHE_RSA_WITH_AES_128_CBC_SHA (envelope-from ) id 1jyNw6-001IqQ-Nc; Thu, 23 Jul 2020 01:14:06 +0200 Received: from epyc.physik.fu-berlin.de ([160.45.64.180]) by mx.physik.fu-berlin.de with esmtps (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1jyNvz-0002Sc-H5; Thu, 23 Jul 2020 01:13:59 +0200 Received: from mkarcher by epyc.physik.fu-berlin.de with local (Exim 4.94 #2 (Debian)) id 1jyNvz-001lBb-8G; Thu, 23 Jul 2020 01:13:59 +0200 From: Michael Karcher To: linux-sh@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Yoshinori Sato , Rich Felker , Adrian Glaubitz , Michael Karcher Subject: [PATCH 1/4] sh: Fix validation of system call number Date: Thu, 23 Jul 2020 01:13:19 +0200 Message-Id: <20200722231322.419642-1-kernel@mkarcher.dialup.fu-berlin.de> X-Mailer: git-send-email 2.28.0.rc1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Originating-IP: 160.45.64.218 X-ZEDAT-Hint: RV Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The slow path for traced system call entries accessed a wrong memory location to get the number of the maximum allowed system call number. Renumber the numbered "local" label for the correct location to avoid collisions with actual local labels. Signed-off-by: Michael Karcher --- arch/sh/kernel/entry-common.S | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/sh/kernel/entry-common.S b/arch/sh/kernel/entry-common.S index 956a7a03b0c8..9bac5bbb67f3 100644 --- a/arch/sh/kernel/entry-common.S +++ b/arch/sh/kernel/entry-common.S @@ -199,7 +199,7 @@ syscall_trace_entry: mov.l @(OFF_R7,r15), r7 ! arg3 mov.l @(OFF_R3,r15), r3 ! syscall_nr ! - mov.l 2f, r10 ! Number of syscalls + mov.l 6f, r10 ! Number of syscalls cmp/hs r10, r3 bf syscall_call mov #-ENOSYS, r0 @@ -353,7 +353,7 @@ ENTRY(system_call) tst r9, r8 bf syscall_trace_entry ! - mov.l 2f, r8 ! Number of syscalls + mov.l 6f, r8 ! Number of syscalls cmp/hs r8, r3 bt syscall_badsys ! @@ -392,7 +392,7 @@ syscall_exit: #if !defined(CONFIG_CPU_SH2) 1: .long TRA #endif -2: .long NR_syscalls +6: .long NR_syscalls 3: .long sys_call_table 7: .long do_syscall_trace_enter 8: .long do_syscall_trace_leave -- 2.28.0.rc1