Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp664776pxv; Thu, 15 Jul 2021 12:53:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw6FWogyLIaJ+acfoztCi8rMZuXUCDd+BVemQYsKRdprPW3C6SmLYp6CS9RCK8OjNf2G0t7 X-Received: by 2002:a17:906:794b:: with SMTP id l11mr7115421ejo.343.1626378780070; Thu, 15 Jul 2021 12:53:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626378780; cv=none; d=google.com; s=arc-20160816; b=BU5iNPfAp5P2+0GEzP1M+g7Hn8XHNlhahL/1iG4YVTKJVRYuukgkWBm50r5weXFSK+ evB6FVpQbfe28PG/cTPPRT49U9PKq2CK7vXYj6c4UZ+bKghShKgFh3UGg9hYYIzFaycO FVS3s/boyW0V/TZw3S5OYp+g2IgYnrEvcDIbPgjwGqLgbM0sHGAlT/DzttrD0xECbUwO FB9Jxqs19xQw+k1Rzk2OwxhPcP8YlRtEGhni+A0LV9NjcsRw6m/jYi5/ZuOsNDcmzYra peVPkhTAezF8eBoG+bTKG5QdielMfViUuXdu2F27SbqU+GVAYvscNvXd9DxyU5BZXt7S yaBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=LJqjYJthS9puHe5fakhW+q7dIzW/Dw14djjqmvyuPQc=; b=nshY/bszqn9s/dIEyycfp+9VcOiZNIQk/HS6vmoBcQNzCwj5MMWvMqJWpOJhEgdrc8 Zs2q1vO8Dm55kfJ9S3R87uMSKM8VSIWsMgfD5+xbmPAH2A2+fX3CfB6GArYOPt2rfArJ eoUrOC9G387Iw+N86R03ysuWebgUTADJUMN2C013x8iDnN6e4kbaj5hI1sAO2MeWRQSr nZ4JZpUiAsssB/2mT9byDLfQS23eEcVX56dD5F44oD8xTdmhHtzQzyMcc5OEX3kITDhc g8tWofq3RsDzK6ZWV8tS0LjV0mOeGp7lD2FRphaBfRnXwkvqDPgwjLEahdKVZMhbJCpH HQqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=tDcXrbOM; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m24si9125697edv.366.2021.07.15.12.52.36; Thu, 15 Jul 2021 12:53:00 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=tDcXrbOM; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344007AbhGOTxv (ORCPT + 99 others); Thu, 15 Jul 2021 15:53:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:58956 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245063AbhGOTTP (ORCPT ); Thu, 15 Jul 2021 15:19:15 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3A78B613F5; Thu, 15 Jul 2021 19:13:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626376435; bh=qYwvKRZxDsClmqX/CnzXKCt+vvf788CcY/7PJ+WeTLY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tDcXrbOMvqXqblZW8bNa+GTp8QEhRKCcRklyJyBWp1TUg/KGqZWowqbdiS5x4wbeH tswQUp4yt5ughqgh0W9qmwBBkGlPKGXUVRJvgYRxHDSsFOKEjhjty2NueoBWO3WtaZ kQgcL0us7HYzzSDisUrA6tLL+xgTbubsSItUvebA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sven Schnelle , Heiko Carstens , Vasily Gorbik Subject: [PATCH 5.13 255/266] s390/vdso64: add sigreturn,rt_sigreturn and restart_syscall Date: Thu, 15 Jul 2021 20:40:10 +0200 Message-Id: <20210715182652.557225823@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210715182613.933608881@linuxfoundation.org> References: <20210715182613.933608881@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sven Schnelle commit 686341f2548b5a4c4ab1ee22427e046027ae1c9c upstream. Add minimalistic trampolines to vdso64 so we can return from signal without using the stack which requires pgm check handler hacks when NX is enabled. restart_syscall will be called from vdso to work around the architectural limitation that the syscall number might be encoded in the svc instruction, and therefore can not be changed. Signed-off-by: Sven Schnelle Reviewed-by: Heiko Carstens Signed-off-by: Vasily Gorbik Signed-off-by: Greg Kroah-Hartman --- arch/s390/kernel/vdso64/vdso64.lds.S | 3 +++ arch/s390/kernel/vdso64/vdso_user_wrapper.S | 17 +++++++++++++++++ 2 files changed, 20 insertions(+) --- a/arch/s390/kernel/vdso64/vdso64.lds.S +++ b/arch/s390/kernel/vdso64/vdso64.lds.S @@ -137,6 +137,9 @@ VERSION __kernel_clock_gettime; __kernel_clock_getres; __kernel_getcpu; + __kernel_restart_syscall; + __kernel_rt_sigreturn; + __kernel_sigreturn; local: *; }; } --- a/arch/s390/kernel/vdso64/vdso_user_wrapper.S +++ b/arch/s390/kernel/vdso64/vdso_user_wrapper.S @@ -37,3 +37,20 @@ vdso_func gettimeofday vdso_func clock_getres vdso_func clock_gettime vdso_func getcpu + +.macro vdso_syscall func,syscall + .globl __kernel_\func + .type __kernel_\func,@function + .align 8 +__kernel_\func: + CFI_STARTPROC + svc \syscall + /* Make sure we notice when a syscall returns, which shouldn't happen */ + .word 0 + CFI_ENDPROC + .size __kernel_\func,.-__kernel_\func +.endm + +vdso_syscall restart_syscall,__NR_restart_syscall +vdso_syscall sigreturn,__NR_sigreturn +vdso_syscall rt_sigreturn,__NR_rt_sigreturn