Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp712565pxv; Thu, 15 Jul 2021 14:11:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwOXfwlQxZ7DI8rW8fEL0Qu5sjsOpdIKJ/E2faeztevGjyAVECcYktxlRPl2BCyD7ZXYO10 X-Received: by 2002:a17:906:6011:: with SMTP id o17mr7452532ejj.157.1626383462593; Thu, 15 Jul 2021 14:11:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626383462; cv=none; d=google.com; s=arc-20160816; b=OiTXio4OVg/qzl33B8WvhOn1HoVkqPD7y074YZeMJrIGmW/auWesLMfUaZhrzTbLbN bTTQUsRj9QDgYuqlnQOtl0/GbWEfluRSlmez7iEiGGBB8OZwCEGFDGkxxNhy9Mo9hAdv EnlkJJKo7Js6OnWh7bN+iBl7fJVdmMjlbfxEluAKjgRJHDNcT/I8uOWGq+C++y2RK0Rn CCZgqknwRBhGkExg0bUgH82ej3v9s7yH3rNhgvWrIAjdJy4KFU+/21FVo3xxJeLTa+bn pcbvD9+44RWkCujVU/S75v+0AYOlc8Qe9SMiKeIS2WY4FrNWjAzu47JsLnk0gC0owsdd QXyA== 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=Vhg504hjF9jtrsce7+c7q39C5bVZaYICwBHAh3/FDulzVvCNFjMCBzlimzM4/bmRSP 9R0L62N6oEjTDPzQQlcCJ1uE8aAESYSFlSKivjkqOaXVHQ1WT9mJ/XLm2KlK25aEA0Nj 8v+gbeTJx75lultJkqyurGSjPq362NvUlKspvHX4+doniCGhmXfoWpFJmc4XE2Cdll/V xPTIUKPtvdIy6sJwLPLToS/WaBdu/rd36bzWJmxkYT0h//kZ+pGlvE6KIrM+fiE7lxje YO0SvKuCZ0Lhb1Ue2Ph7HGixLj2uv/BFfjlQjcK8bU23vPhEiUWKippbRiUSHPiu8UbF ux9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=GdCHtxXc; 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 ka25si8857617ejc.354.2021.07.15.14.10.39; Thu, 15 Jul 2021 14:11:02 -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=GdCHtxXc; 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 S244070AbhGOTXf (ORCPT + 99 others); Thu, 15 Jul 2021 15:23:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:46398 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242394AbhGOTGx (ORCPT ); Thu, 15 Jul 2021 15:06:53 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 82237613FE; Thu, 15 Jul 2021 19:02:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626375776; bh=qYwvKRZxDsClmqX/CnzXKCt+vvf788CcY/7PJ+WeTLY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GdCHtxXcfeLLUECxYQVI6fzBlLQPqCaoUi9PanzH6tmJQl/laV6k/l4brtnIiz8k9 qPb6mNiiMhNfK/3V6hLBfV+Oe7zFbBYwp5Yn3g6vwK+LEQimgUjEwaN5wZTkM8E0N7 DSodWsWh/zb4JNurqcksA5qPDAGLYBvwTsVk+5ao= 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.12 231/242] s390/vdso64: add sigreturn,rt_sigreturn and restart_syscall Date: Thu, 15 Jul 2021 20:39:53 +0200 Message-Id: <20210715182633.531536608@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210715182551.731989182@linuxfoundation.org> References: <20210715182551.731989182@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