From patchwork Wed Nov 8 03:37:33 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tobin Harding X-Patchwork-Id: 10047601 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 330D0603FA for ; Wed, 8 Nov 2017 03:38:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 266EE2A3A7 for ; Wed, 8 Nov 2017 03:38:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1B0BE2A3A9; Wed, 8 Nov 2017 03:38:18 +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 472282A3A7 for ; Wed, 8 Nov 2017 03:38:17 +0000 (UTC) Received: (qmail 10184 invoked by uid 550); 8 Nov 2017 03:38:08 -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 9854 invoked from network); 8 Nov 2017 03:38:02 -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=M5AEyt0FwZBcPX4CBFpXb4a7huBVn5ReD 4/FgDLDaLlLyu8shMuCEU+uYisn7je+y6qYoTcmLTbHW+MjybpQnkIUvkTGlq6Pr l6rQLYKFYrOE4uEPYfLe9gsZKfdw1DLTkuRZYjmhoJ/ueUo2GR6dnkwunu1o2CKw eQMofME+oxUVZD8z+Xoic+BTdiXFvruQdQ15L3NnXmRe1eGK0o18gXPkrWcGQbuQ gKQ+qk3K8vhBK6ZtWJxaG6J/DJ82Jv10bTPzdWO2xDdz8YAm+gxS1O65AQ8mncbu xfxHzq5fRveY7dWp1bEIesR6UQ1hN4/pf1Mb4zVAsjG6xmBlL2njw== 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=S5kDuHJc f+v5VMSSaqagPOFK8roBrXhBNKZbZWPb5ca52XN9TxU1fMs5sB9pCbM0K2rt2Uil CyI63OxFjM5gr9Cvyi4GJ0pzXcF32qR6SrpuT35Kai0d5zvt/Kmex4E5B9qeYPBt 3Jpul1t7EoniR0OoRlGxf89mkMMURNuBNxE2F9yRrlb8OqPfkpziEGiMSM1rcVja 0Gq/z+iCDSEBDW7oaPNET1CxQzJT8G7PyU+OnSK96X0G0RM8jpuXaOSJDaqAKg84 xZw1ykjgptCjn2vMMu4J0Csw95GXZtWQH6Kz/WawEtMgDDfOhTKqb4A61KM2oEJJ wD7sa/jGwgBc+g== 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 , linux-kernel@vger.kernel.org, Network Development , David Miller , kernel-hardening@lists.openwall.com, "Paul E. McKenney" , Andy Lutomirski , Peter Zijlstra Date: Wed, 8 Nov 2017 14:37:33 +1100 Message-Id: <1510112259-11572-2-git-send-email-me@tobin.cc> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1510112259-11572-1-git-send-email-me@tobin.cc> References: <1510112259-11572-1-git-send-email-me@tobin.cc> Subject: [kernel-hardening] [PATCH 1/7] 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