From patchwork Fri Mar 2 07:54:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Beattie X-Patchwork-Id: 880360 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ubuntu.com Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) by ozlabs.org (Postfix) with ESMTP id 3zt1mT0FGrz9sWQ; Fri, 2 Mar 2018 18:54:49 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1erfWb-0003CT-73; Fri, 02 Mar 2018 07:54:41 +0000 Received: from 208-151-246-43.dq1sn.easystreet.com ([208.151.246.43] helo=lizaveta.nxnw.org) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1erfWY-0003C2-2a for kernel-team@lists.ubuntu.com; Fri, 02 Mar 2018 07:54:38 +0000 Received: from kryten.nxnw.org (kryten.nxnw.org [10.19.96.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "kryten.int.wirex.com", Issuer "nxnw.org" (not verified)) by lizaveta.nxnw.org (Postfix) with ESMTPS id D165560794 for ; Thu, 1 Mar 2018 23:54:34 -0800 (PST) Received: by kryten.nxnw.org (Postfix, from userid 1000) id 6E0B81D600C8; Thu, 1 Mar 2018 23:54:34 -0800 (PST) Date: Thu, 1 Mar 2018 23:54:34 -0800 From: Steve Beattie To: kernel-team@lists.ubuntu.com Subject: [PATCH][Bionic] UBUNTU: [Packaging] retpoline-extract: flag *0xNNN(%reg) branches Message-ID: <20180302075434.GA11600@nxnw.org> MIME-Version: 1.0 Organization: North by Northwest Consolidated Industries, LLC X-Paranoia: Greetings CIA, FBI, MI5, NSA, ATF, Immigration! X-Message-Flag: Repeal the DMCA! Real security is only possible when subject to open critical review. X-PGP-Key: http://www.NxNW.org/~steve/005E81F4.txt User-Agent: Mutt/1.9.3 (2018-01-21) X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" UBUNTU: [Packaging] retpoline-extract: flag *0xNNN(%reg) branches Catch indirect jmps and calls of the form 'jmp *0xNNNN(%reg)'. Signed-off-by: Steve Beattie Acked-by: Andy Whitcroft --- debian/scripts/retpoline-extract | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/scripts/retpoline-extract b/debian/scripts/retpoline-extract index 5baa35e74cc5..83cbc9e50211 100755 --- a/debian/scripts/retpoline-extract +++ b/debian/scripts/retpoline-extract @@ -9,6 +9,6 @@ cd "$1" || exit 1 awk -F' ' ' /^.\// { file=$1; sub(":.*", "", file); sub("^.*/", "", file); } /^[0-9a-f][0-9a-f]* <.*>:/ { tag=$1; sub(".*<", "", tag); sub(">.*", "", tag); tag=file " " tag; } - $3 ~ /(call|jmp)q? *\*%/ { print(tag " " $3); } + $3 ~ /(call|jmp)q? *\*(0x[a-f0-9]+\()?%/ { print(tag " " $3); } ' | \ grep -v " \*%cs:0x" # elide 32bit code-segment absolute offsets.