From patchwork Thu Nov 9 05:09:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tobin Harding X-Patchwork-Id: 10050103 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E5AF0602D7 for ; Thu, 9 Nov 2017 05:10:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D44B32A966 for ; Thu, 9 Nov 2017 05:10:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C8B4F2AA0E; Thu, 9 Nov 2017 05:10:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from mother.openwall.net (mother.openwall.net [195.42.179.200]) by mail.wl.linuxfoundation.org (Postfix) with SMTP id 05F832A9FB for ; Thu, 9 Nov 2017 05:10:14 +0000 (UTC) Received: (qmail 32334 invoked by uid 550); 9 Nov 2017 05:10:07 -0000 Mailing-List: contact kernel-hardening-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Delivered-To: mailing list kernel-hardening@lists.openwall.com Received: (qmail 32184 invoked from network); 9 Nov 2017 05:10:06 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tobin.cc; h=cc :date:from:in-reply-to:message-id:references:subject:to :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=UcHiLZWr2plgieR9P aB9lh0Gyq+kmFtxSyMT2wkC6l4=; b=XodbmzGeMkAtjQ0g0NlJR8Jfe/dtNS6qx Zjf6Tn8XEKWPPClCKgkMAmRJNO1c2iFc/7BSHKyqoaJC27PZEKsbzIUWb5lAk04R zHRq+avrl9CuDV9xpN+2Sjpc2O9Cq8Fz1aD7g5/VhgZJ8uArPyUddXs7QEYx9zK9 ORSS1XLaGYKboZDFu+Rk9m/1AneBCb4u1glpPcP0N0Egarmc9C20jtiEGHPecDY2 h64xR2le2Nn2TNj+trgK+KYX7VqKdnIHHWk4tzNFb5+eyBfKUuwy1spf6FgLvSot bIVnLX02urt8X8JZs8z0mnmimaqLZ5BLtq0DnpoFcruepr7mr8Kzw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:in-reply-to:message-id :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=UcHiLZWr2plgieR9PaB9lh0Gyq+kmFtxSyMT2wkC6l4=; b=BQYKhpKX pBqF95oDX1+F5tYqxZefDS0+7KyUN8Zzas63TJsa5weOXEkut1fJPQHlhltwHvdM pmD9rSdEmVvYmoyMZ2me/eNHCrQWiwQlyrG7rPTyhS7Y/JsrCCUJ9+u8kD+MuzTM WqKf8dSIaHRwzJu9Hpo+5yURUi0+PWwUtwu5dKLuj9S77LgV/eqvGSQiV+aS+J18 eINUw80enqNYgdLOKPJbD1GbONktNS9SsuBHmWbhZYV9K7661/R5NbVS3o+kVGE0 nacL8wCOys+UVbzeTMAiv+WK9Vo6+Bg9CNZS5fEbvN4y6AcVyvnRsgR8CytGCMgI KPSaH8eTvO9v/w== X-ME-Sender: From: "Tobin C. Harding" To: Linus Torvalds Cc: "Tobin C. Harding" , "Jason A. Donenfeld" , Theodore Ts'o , Kees Cook , Paolo Bonzini , Tycho Andersen , "Roberts, William C" , Tejun Heo , Jordan Glover , Greg KH , Petr Mladek , Joe Perches , Ian Campbell , Sergey Senozhatsky , Catalin Marinas , Will Deacon , Steven Rostedt , Chris Fries , Dave Weinstein , Daniel Micay , Djalal Harouni , "Paul E. McKenney" , Andy Lutomirski , Peter Zijlstra , Michael Ellerman , David Miller , Network Development , linux-kernel@vger.kernel.org, kernel-hardening@lists.openwall.com Date: Thu, 9 Nov 2017 16:09:28 +1100 Message-Id: <1510204175-10138-2-git-send-email-me@tobin.cc> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1510204175-10138-1-git-send-email-me@tobin.cc> References: <1510204175-10138-1-git-send-email-me@tobin.cc> Subject: [kernel-hardening] [PATCH v2 1/8] scripts/leaking_addresses: use tabs not spaces X-Virus-Scanned: ClamAV using ClamSMTP Current code uses spaces instead of tabs in places. Use tabs instead of spaces. Signed-off-by: Tobin C. Harding --- scripts/leaking_addresses.pl | 54 ++++++++++++++++++++++---------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/scripts/leaking_addresses.pl b/scripts/leaking_addresses.pl index 2977371b2956..b64efcecbb5e 100755 --- a/scripts/leaking_addresses.pl +++ b/scripts/leaking_addresses.pl @@ -170,46 +170,46 @@ sub push_to_global sub is_false_positive { - my ($match) = @_; + my ($match) = @_; + + if ($match =~ '\b(0x)?(f|F){16}\b' or + $match =~ '\b(0x)?0{16}\b') { + return 1; + } - if ($match =~ '\b(0x)?(f|F){16}\b' or - $match =~ '\b(0x)?0{16}\b') { - return 1; - } - # vsyscall memory region, we should probably check against a range here. - if ($match =~ '\bf{10}600000\b' or - $match =~ '\bf{10}601000\b') { - return 1; - } + if ($match =~ '\bf{10}600000\b' or# vsyscall memory region, we should probably check against a range here. + $match =~ '\bf{10}601000\b') { + return 1; + } - return 0; + return 0; } # True if argument potentially contains a kernel address. sub may_leak_address { - my ($line) = @_; - my $address = '\b(0x)?ffff[[:xdigit:]]{12}\b'; + my ($line) = @_; + my $address = '\b(0x)?ffff[[:xdigit:]]{12}\b'; - # Signal masks. - if ($line =~ '^SigBlk:' or - $line =~ '^SigCgt:') { - return 0; - } + # Signal masks. + if ($line =~ '^SigBlk:' or + $line =~ '^SigCgt:') { + return 0; + } - if ($line =~ '\bKEY=[[:xdigit:]]{14} [[:xdigit:]]{16} [[:xdigit:]]{16}\b' or - $line =~ '\b[[:xdigit:]]{14} [[:xdigit:]]{16} [[:xdigit:]]{16}\b') { + if ($line =~ '\bKEY=[[:xdigit:]]{14} [[:xdigit:]]{16} [[:xdigit:]]{16}\b' or + $line =~ '\b[[:xdigit:]]{14} [[:xdigit:]]{16} [[:xdigit:]]{16}\b') { return 0; - } + } - while (/($address)/g) { - if (!is_false_positive($1)) { - return 1; - } - } + while (/($address)/g) { + if (!is_false_positive($1)) { + return 1; + } + } - return 0; + return 0; } sub parse_dmesg