From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 19256C2D0A3 for ; Thu, 12 Nov 2020 10:13:43 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 924D422201 for ; Thu, 12 Nov 2020 10:13:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ogydb7GT"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="1mXVRfNZ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 924D422201 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Lsq83ZVhs5zQnH1y5cI5ZwnPR+LRzvP3ncVc4am1pLQ=; b=ogydb7GTOExVhtrnMOC+HS1ao xA5zC9nOTwTwaT3eUbYWK5G4AkIQWyjzlR9kVu1i6JkaDU7tdWV4dwQCrzY97NOeOlnkxW5g4nCEk cHNOxBZPtoGQkxXe/5R7GARXBX1Jr4p5rdthraz4ujJNMmDNz1nOE062K7Cstk6ammFGqrxuAnuq/ rx9+nx3bprjzsXYPGgT65UjQ3NFpm7x/PmvGHwY/3nP4P2iNEqDm0sHmxf3yi0EV2P7POEggiNu62 Bc8EDAsIBvxgTIuFjK/G1+Qc3YaVF+L3mz7dSuypZ+RASRUKEIqroH+GjWjmP6Wutllq3OvYPgZNX 3ZfB5pGRw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kd9aT-0001Gl-Vo; Thu, 12 Nov 2020 10:12:18 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kd9aO-0001G7-9r for linux-arm-kernel@lists.infradead.org; Thu, 12 Nov 2020 10:12:13 +0000 Received: from willie-the-truck (236.31.169.217.in-addr.arpa [217.169.31.236]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7263B22201; Thu, 12 Nov 2020 10:12:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1605175930; bh=kmZSycTo1OJG0RmzJymp5sNd0UwvtRmT+VJBSQ5dgUc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=1mXVRfNZd131W72MvrL8Y61x29PGib7RRXYOzdD+owhET3TvqhmSzsNJ+fwZGVVbH etvs521ZcSsoNxjw0jr0TPNgXUfsJCmooRSnd/kTNiEn9nka85l613AJ21NvH3y6dD VEUUqH4lfNPVszKIIZf1WBfGBfrCD6nd/aKMre50= Date: Thu, 12 Nov 2020 10:12:05 +0000 From: Will Deacon To: Will McVicker Subject: Re: [PATCH] arm64: Fix off-by-one vdso trampoline return value Message-ID: <20201112101204.GA19506@willie-the-truck> References: <20201112001422.340449-1-willmcvicker@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20201112001422.340449-1-willmcvicker@google.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201112_051212_670583_47A5366A X-CRM114-Status: GOOD ( 20.74 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Catalin Marinas , Nick Desaulniers , linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com, Andrei Vagin , Dmitry Safonov <0x7f454c46@gmail.com>, Nathan Chancellor , Vincenzo Frascino , kernel-team@android.com, Thomas Gleixner , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Nov 12, 2020 at 12:14:22AM +0000, Will McVicker wrote: > Depending on your host nm version, the generated header > `include/generated/vdso32-offsets.h` may have the bottom bit set for the > thumb vdso offset addresses (as observed when using llvm-nm). This > results in an additional +1 for thumb vdso trampoline return values > since compat_setup_return() already includes `vdso_trampoline + thumb`. > As a result, I see a SIGBUS error when running the LTP test > syscalls.rt_sigaction01. To fix this, let's clear the bottom bit of the > vdso_offset in the VDSO_SYMBOL macro. > > Test: LTP test syscalls.rt_sigaction01 > Fixes: f01703b3d2e6 ("arm64: compat: Get sigreturn trampolines from vDSO") > Signed-off-by: Will McVicker > --- > arch/arm64/include/asm/vdso.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/arm64/include/asm/vdso.h b/arch/arm64/include/asm/vdso.h > index f99dcb94b438..a7384379e8e1 100644 > --- a/arch/arm64/include/asm/vdso.h > +++ b/arch/arm64/include/asm/vdso.h > @@ -23,7 +23,7 @@ > > #define VDSO_SYMBOL(base, name) \ > ({ \ > - (void *)(vdso_offset_##name - VDSO_LBASE + (unsigned long)(base)); \ > + (void *)((vdso_offset_##name & ~1UL) - VDSO_LBASE + (unsigned long)(base)); \ I don't think we need this in mainline, because the sigreturn trampoline is just a bunch of .byte directives and I removed the sigreturn code from the compat vdso in 2d071968a405 ("arm64: compat: Remove 32-bit sigreturn code from the vDSO"). Might be needed in some stable kernels though (or we just backport the patch I mentioned above) Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel