Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp1866382ybd; Sun, 23 Jun 2019 18:43:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqwUEKGHMkU5pkJcmzcLqLshVMmG6zo/8diWz9JLcS2nAn723UHRaORbA74mO8VwF0OfiWgM X-Received: by 2002:a63:1243:: with SMTP id 3mr19400719pgs.235.1561340635302; Sun, 23 Jun 2019 18:43:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561340635; cv=none; d=google.com; s=arc-20160816; b=TT5/FjUwRVSuROvMful/XksJFeUHTglhzLY9yT3xi5LOnHEx83fK5OJTRx9gNEz6L/ fsPDRfUpNqDhNhuWSvN0hredRHyT5KiUZfruMhJxlUdemalTZB7HFTuMN+liJNUrW/br CnUO3YM8web3GgHQ0P5i5l4yapvIrePdpodktiiE4R7DIf2lE+JFlruGCMa0kwyHKCu8 Ga5BF0CMYDrcuXP0m8g7atFoYF8QJK7sVAljy6poNN+rEugGBgeaXTs5008x3tx4hIFS udxuAkVurYwovYHMLRqW7b4Utf/LX4wf4yp708Gpv5Iuf56i/nAHA5kZa8hSyjalcWwX 6w9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date:dkim-signature:dkim-filter; bh=LUevjWnxulWmyQspA1Jq/kxZST/G4AGPNALMYRoAZXo=; b=apTy1uez7QDTUrtupWv4TiYYDjzUdAHCPSqJMOkWntT7V6UFYUzgfXopiFLRSJ1Rgb lZ1T4oslDvQWMLvRAs7h5EIKkT2Ygw3v46Nwdj8QOv9SHDzlL/RF68+2idkxHG6Bm7s2 J0/pNTB5mRbYEa3DNX8hfKrwrJhrROrHsD6p1AjjPYPALvcUErHeZIkQ5Kv7E1GjVop+ vWbVATesYvrMHgUtAUfwIMc5/0JtnT1VSHzFdXL92VnPwauUP6mg8o5egXik8LVPmnjD FR8aZQ16F2Pa9fo1v6936OneXzAsqezGuqPqShbpyZ41K9g7N3ecZWqggtuztNmbsGJK VTyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zytor.com header.s=2019061801 header.b=x2RdswGX; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zytor.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y17si9770534pfe.220.2019.06.23.18.43.40; Sun, 23 Jun 2019 18:43:55 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@zytor.com header.s=2019061801 header.b=x2RdswGX; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zytor.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726841AbfFXBll (ORCPT + 99 others); Sun, 23 Jun 2019 21:41:41 -0400 Received: from terminus.zytor.com ([198.137.202.136]:43987 "EHLO mail.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726557AbfFXBk6 (ORCPT ); Sun, 23 Jun 2019 21:40:58 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id x5NNrsq72859764 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Sun, 23 Jun 2019 16:53:54 -0700 DKIM-Filter: OpenDKIM Filter v2.11.0 terminus.zytor.com x5NNrsq72859764 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com; s=2019061801; t=1561334036; bh=LUevjWnxulWmyQspA1Jq/kxZST/G4AGPNALMYRoAZXo=; h=Date:From:Cc:Reply-To:In-Reply-To:References:To:Subject:From; b=x2RdswGXZX5lL4IIy8hAgUUZVwDgJHbXlsl1CfWHavmITTUnFuPs0RvDFLQtEPi3A HGz9vUFYMaouLloGcBY90WxAwsuHWodr6QGNNwzbIuqqiRYyEI/njk6yS/L8QdWIk+ h9fHtXUrAz8JJ+IwRbB5buIs1N/vFRgmzXYxHu9x5GCNA6EfEbAd0xGSoMQNF6nDaM jbjDfGC7p0KrYbnDYGwVIfSzZY7qF+G3J+Om0rdc3zm5212Bwo1U7gX3ezJw4BspwM YzTG1OCMmN/UeplOsBs2Ihf3J8YuI3+dbe8RX8PGclm8+DZuZUaCpQoNcuG+xVvW3G P/Tnjpu3AF/HQ== Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id x5NNrs1J2859761; Sun, 23 Jun 2019 16:53:54 -0700 Date: Sun, 23 Jun 2019 16:53:54 -0700 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Vincenzo Frascino Message-ID: Cc: sthotton@marvell.com, hpa@zytor.com, tglx@linutronix.de, andre.przywara@arm.com, 0x7f454c46@gmail.com, arnd@arndb.de, linux@rasmusvillemoes.dk, linux-kernel@vger.kernel.org, will.deacon@arm.com, pcc@google.com, paul.burton@mips.com, mingo@kernel.org, shuah@kernel.org, catalin.marinas@arm.com, daniel.lezcano@linaro.org, salyzyn@android.com, huw@codeweavers.com, vincenzo.frascino@arm.com, ralf@linux-mips.org, linux@armlinux.org.uk Reply-To: arnd@arndb.de, linux@rasmusvillemoes.dk, linux-kernel@vger.kernel.org, tglx@linutronix.de, sthotton@marvell.com, hpa@zytor.com, 0x7f454c46@gmail.com, andre.przywara@arm.com, paul.burton@mips.com, will.deacon@arm.com, pcc@google.com, daniel.lezcano@linaro.org, salyzyn@android.com, mingo@kernel.org, shuah@kernel.org, catalin.marinas@arm.com, ralf@linux-mips.org, linux@armlinux.org.uk, vincenzo.frascino@arm.com, huw@codeweavers.com In-Reply-To: <20190621095252.32307-15-vincenzo.frascino@arm.com> References: <20190621095252.32307-15-vincenzo.frascino@arm.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:timers/vdso] arm64: compat: Get sigreturn trampolines from vDSO Git-Commit-ID: f01703b3d2e6faf7233cedf78f1e2d31b39fa90f X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=2.3 required=5.0 tests=ALL_TRUSTED,BAYES_00, DATE_IN_FUTURE_03_06,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU, DKIM_VALID_EF,FREEMAIL_FORGED_REPLYTO,FREEMAIL_REPLYTO_END_DIGIT autolearn=no autolearn_force=no version=3.4.2 X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: f01703b3d2e6faf7233cedf78f1e2d31b39fa90f Gitweb: https://git.kernel.org/tip/f01703b3d2e6faf7233cedf78f1e2d31b39fa90f Author: Vincenzo Frascino AuthorDate: Fri, 21 Jun 2019 10:52:41 +0100 Committer: Thomas Gleixner CommitDate: Sat, 22 Jun 2019 21:21:09 +0200 arm64: compat: Get sigreturn trampolines from vDSO When the compat vDSO is enabled, the sigreturn trampolines are not anymore available through [sigpage] but through [vdso]. Add the relevant code the enable the feature. Signed-off-by: Vincenzo Frascino Signed-off-by: Thomas Gleixner Tested-by: Shijith Thotton Tested-by: Andre Przywara Cc: linux-arch@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-mips@vger.kernel.org Cc: linux-kselftest@vger.kernel.org Cc: Catalin Marinas Cc: Will Deacon Cc: Arnd Bergmann Cc: Russell King Cc: Ralf Baechle Cc: Paul Burton Cc: Daniel Lezcano Cc: Mark Salyzyn Cc: Peter Collingbourne Cc: Shuah Khan Cc: Dmitry Safonov <0x7f454c46@gmail.com> Cc: Rasmus Villemoes Cc: Huw Davies Link: https://lkml.kernel.org/r/20190621095252.32307-15-vincenzo.frascino@arm.com --- arch/arm64/include/asm/vdso.h | 3 +++ arch/arm64/kernel/signal32.c | 26 ++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/arch/arm64/include/asm/vdso.h b/arch/arm64/include/asm/vdso.h index 1f94ec19903c..9c15e0a06301 100644 --- a/arch/arm64/include/asm/vdso.h +++ b/arch/arm64/include/asm/vdso.h @@ -17,6 +17,9 @@ #ifndef __ASSEMBLY__ #include +#ifdef CONFIG_COMPAT_VDSO +#include +#endif #define VDSO_SYMBOL(base, name) \ ({ \ diff --git a/arch/arm64/kernel/signal32.c b/arch/arm64/kernel/signal32.c index 8a9a5ceb63b7..12a585386c2f 100644 --- a/arch/arm64/kernel/signal32.c +++ b/arch/arm64/kernel/signal32.c @@ -18,6 +18,7 @@ #include #include #include +#include struct compat_vfp_sigframe { compat_ulong_t magic; @@ -341,6 +342,30 @@ static void compat_setup_return(struct pt_regs *regs, struct k_sigaction *ka, retcode = ptr_to_compat(ka->sa.sa_restorer); } else { /* Set up sigreturn pointer */ +#ifdef CONFIG_COMPAT_VDSO + void *vdso_base = current->mm->context.vdso; + void *vdso_trampoline; + + if (ka->sa.sa_flags & SA_SIGINFO) { + if (thumb) { + vdso_trampoline = VDSO_SYMBOL(vdso_base, + compat_rt_sigreturn_thumb); + } else { + vdso_trampoline = VDSO_SYMBOL(vdso_base, + compat_rt_sigreturn_arm); + } + } else { + if (thumb) { + vdso_trampoline = VDSO_SYMBOL(vdso_base, + compat_sigreturn_thumb); + } else { + vdso_trampoline = VDSO_SYMBOL(vdso_base, + compat_sigreturn_arm); + } + } + + retcode = ptr_to_compat(vdso_trampoline) + thumb; +#else unsigned int idx = thumb << 1; if (ka->sa.sa_flags & SA_SIGINFO) @@ -348,6 +373,7 @@ static void compat_setup_return(struct pt_regs *regs, struct k_sigaction *ka, retcode = (unsigned long)current->mm->context.vdso + (idx << 2) + thumb; +#endif } regs->regs[0] = usig;