Received: by 10.213.65.68 with SMTP id h4csp922820imn; Wed, 14 Mar 2018 04:26:34 -0700 (PDT) X-Google-Smtp-Source: AG47ELuCSbeHWbauChgAmy777l5GjF5p1KDxZR6ybDEy3L/GR81wgAXJKQFpjxPgIR1QFoMRf9/s X-Received: by 2002:a17:902:887:: with SMTP id 7-v6mr3826505pll.89.1521026794101; Wed, 14 Mar 2018 04:26:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521026794; cv=none; d=google.com; s=arc-20160816; b=fYLElLiHkdw/XWznBVyHrCAeqIr4I6IPwQ6FJba8XtLE11cq226V5LZUFnKngQArmQ PhBCOwB9aV0WkdfaVs7DjiNm9wvVtBgn2qU43qP8ni0UNVAn4ve78bwByu6tQRQYSaAo UBfhWsPhp5EGzV+UxOBWkSThpU3pjd2zaYdINarFz/cBhfkGtHhqfmBKNl/Cyv19sDqH SAwl0A8NRgzb3NLla4qC2WFgBl/2G2Q4JFCsi2Mve5/pVlDOL1qncQU9qg6cbPduQqLV HwEqN5Jvmll/W98+pQlwuQSXfdkhyOcFhc1la6/k32YieqOegq5syl6Sz48b09bUoomM HZwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=J33FkMdZIgb9yVFe4UPchUzDESjfTf9XnQC1JDp0d4k=; b=EingfwFF+HpEVdKer9WDputcGWUU+vHied4j6T3HvertcKvxnfxnya3VDntg853M8i WvEX62kGH+6SZek3UtmsTbUzvkFUQ4QpInsqe/5P+xdN+ssoKSmkGQux3ODo9t0wKdYA NFbnDabfN3QRkCmlRP+tZsvwtXsEOuZdrSWQ+2hXksaws+xCHCa2UTSXBtya9N4ONtQw OenOaP/u1GOAbu5EFnlr9b9MJ+XEJkHsyN1pjUVOePC0GnHDwQJam+eeQBtWExq1IX2e YXJ+Y/Hxiwj11yqk3WuSjMiN7rUCYOKFWy1eMgXviMPLyUV6Ar2l2lyVsP7d/dCr7xdT vCHQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a9si1908540pff.263.2018.03.14.04.26.17; Wed, 14 Mar 2018 04:26:34 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751842AbeCNLYs (ORCPT + 99 others); Wed, 14 Mar 2018 07:24:48 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:51666 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751344AbeCNLYr (ORCPT ); Wed, 14 Mar 2018 07:24:47 -0400 Received: from 1.general.apw.uk.vpn ([10.172.192.78] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1ew4WB-00081s-Sy; Wed, 14 Mar 2018 11:24:28 +0000 From: Andy Whitcroft To: Thomas Gleixner , Ingo Molnar , David Woodhouse , Peter Zijlstra Cc: Andy Whitcroft , "H. Peter Anvin" , x86@kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/1] x86/speculation, objtool: Annotate indirect calls/jumps for objtool on 32bit Date: Wed, 14 Mar 2018 11:24:27 +0000 Message-Id: <20180314112427.22351-1-apw@canonical.com> X-Mailer: git-send-email 2.15.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In 9e0e3c5130e9 ("x86/speculation, objtool: Annotate indirect calls/jumps for objtool") we added annotations for CALL_NOSPEC/JMP_NOSPEC on x86 64bit. We did not annotate the 32bit path. Annotate it similarly. Signed-off-by: Andy Whitcroft --- arch/x86/include/asm/nospec-branch.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) While reviewing indirect calls in our builds I noted that the i386 retpoline CALL_NOSPEC is not annotated safe even though its amd64 equivalent is. I cannot see any reason this is not also inherantly safe. Peter was there a reason that you did not annotate this one too? Anyhow, on the assumption this was just missed, this patch annotates it. -apw diff --git a/arch/x86/include/asm/nospec-branch.h b/arch/x86/include/asm/nospec-branch.h index d0dabeae0505..07886162bdf8 100644 --- a/arch/x86/include/asm/nospec-branch.h +++ b/arch/x86/include/asm/nospec-branch.h @@ -183,7 +183,10 @@ * otherwise we'll run out of registers. We don't care about CET * here, anyway. */ -# define CALL_NOSPEC ALTERNATIVE("call *%[thunk_target]\n", \ +# define CALL_NOSPEC \ + ALTERNATIVE( \ + ANNOTATE_RETPOLINE_SAFE \ + "call *%[thunk_target]\n", \ " jmp 904f;\n" \ " .align 16\n" \ "901: call 903f;\n" \ -- 2.15.1