From patchwork Thu Feb 7 22:50:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Tobin C. Harding" X-Patchwork-Id: 10802309 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 434BA13A4 for ; Fri, 8 Feb 2019 00:46:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3340F2DE1A for ; Fri, 8 Feb 2019 00:46:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 278FA2E636; Fri, 8 Feb 2019 00:46:57 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED 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 4A9852DE1A for ; Fri, 8 Feb 2019 00:46:56 +0000 (UTC) Received: (qmail 23857 invoked by uid 550); 8 Feb 2019 00:46:51 -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 Delivered-To: moderator for kernel-hardening@lists.openwall.com Received: (qmail 3403 invoked from network); 7 Feb 2019 22:51:00 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=q1B/CJMZvoxqeOLP75leRL91Q4hN5azLv72yIUplkAg=; b=wX05h86f z47aZ82udeyhgS0O7oWVNdhuJZgYLzOMRY6REaetzFbBdWff9Q6e79YjOvCKvEae 4jrTYE3nqxtVxffR3c2niZEWpwfH+X1sXfsQanwCGIFJ//JFIPgU80ySScAo38Jx 6r/50jqM1DDVWOoaIEC9E6I90hpnJ0BV4jriMuahdu22gi5Rn0k5StzS0/k+6V1S 604uOkgu6ubFqjrHCYFqsIRKaMuwu5qLUD8IW9VPWOkG4ab8ShFNqSQJEoamSNKA zwdMvKHXr94HW3HvPx34PGnrjXarSwm/oc4HvD5fCM60l7XZHsvFMGIKKAZN28bK /578NH2k5eJX0A== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledrledugddtudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfhuthenuceurghilhhouhhtmecufedt tdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufffkffojg hfggfgsedtkeertdertddtnecuhfhrohhmpedfvfhosghinhcuvedrucfjrghrughinhhg fdcuoehtohgsihhnsehkvghrnhgvlhdrohhrgheqnecukfhppeduvddurdeggedrudelle druddtleenucfrrghrrghmpehmrghilhhfrhhomhepthhosghinheskhgvrhhnvghlrdho rhhgnecuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: From: "Tobin C. Harding" To: kernel-hardening@lists.openwall.com Cc: "Tobin C. Harding" , Tycho Andersen , linux-kernel@vger.kernel.org Subject: [PATCH 1/3] leaking_addresses: Fix calls to dprint Date: Fri, 8 Feb 2019 09:50:24 +1100 Message-Id: <20190207225026.11723-2-tobin@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190207225026.11723-1-tobin@kernel.org> References: <20190207225026.11723-1-tobin@kernel.org> MIME-Version: 1.0 X-Virus-Scanned: ClamAV using ClamSMTP Currently calls to function dprint() are non uniform and at times incorrect. Use uniform _correct_ call to function dprint(). Signed-off-by: Tobin C. Harding --- scripts/leaking_addresses.pl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/leaking_addresses.pl b/scripts/leaking_addresses.pl index 6a897788f5a7..214c12be8c86 100755 --- a/scripts/leaking_addresses.pl +++ b/scripts/leaking_addresses.pl @@ -231,7 +231,7 @@ sub get_kernel_config_option my $tmp_file = "/tmp/tmpkconf"; if (system("gunzip < /proc/config.gz > $tmp_file")) { - dprint "$0: system(gunzip < /proc/config.gz) failed\n"; + dprint("system(gunzip < /proc/config.gz) failed\n"); return ""; } else { @config_files = ($tmp_file); @@ -243,7 +243,7 @@ sub get_kernel_config_option } foreach my $file (@config_files) { - dprint("parsing config file: %s\n", $file); + dprint("parsing config file: $file\n"); $value = option_from_file($option, $file); if ($value ne "") { last; @@ -502,7 +502,7 @@ sub walk next; } - dprint "parsing: $path\n"; + dprint("parsing: $path\n"); timed_parse_file($path); } } From patchwork Thu Feb 7 22:50:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Tobin C. Harding" X-Patchwork-Id: 10802311 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6FD9513A4 for ; Fri, 8 Feb 2019 00:47:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5E27F2E62E for ; Fri, 8 Feb 2019 00:47:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 512332DE1A; Fri, 8 Feb 2019 00:47:04 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED 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 7C6A62DE1A for ; Fri, 8 Feb 2019 00:47:03 +0000 (UTC) Received: (qmail 25683 invoked by uid 550); 8 Feb 2019 00:46:59 -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 Delivered-To: moderator for kernel-hardening@lists.openwall.com Received: (qmail 3481 invoked from network); 7 Feb 2019 22:51:02 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=2PLl/V120Makw5/D9oj8o1udfl+b3JNvXdyz9y+DaR0=; b=5gsJr4Fn 1LUW0R9O2N9hb/flq7PqxE+/Bo5+NqsKKr2RDzt7Twg8QLUMwdA7/9uMQXSwbWaT vvApyvUv8MB93LCh99dclEzn25zXpa0QC6DFRPRK7GFNvhdk7Hw4YWtXUmrouOSC LUtqP6uxgwFONrnTS+WsLSDK9/31DEKOclXbBf89Vz4g0MCwIy1hfNeXyQhxuqdH qqnNGcOZIgO2zlafIa3QWSayrW/vA+9Kq5uStm48JkKjtyBAvM8JNbC2a0IZtdnE 3EFDSxOIu+bPOSm+ccLsPkIHs2HZP6aDJnMXv7HUuJolpC25B+7mb3buGN0hcS1G nNhorXyrt7GGgw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledrledugddtudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfhuthenuceurghilhhouhhtmecufedt tdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufffkffojg hfggfgsedtkeertdertddtnecuhfhrohhmpedfvfhosghinhcuvedrucfjrghrughinhhg fdcuoehtohgsihhnsehkvghrnhgvlhdrohhrgheqnecukfhppeduvddurdeggedrudelle druddtleenucfrrghrrghmpehmrghilhhfrhhomhepthhosghinheskhgvrhhnvghlrdho rhhgnecuvehluhhsthgvrhfuihiivgepud X-ME-Proxy: From: "Tobin C. Harding" To: kernel-hardening@lists.openwall.com Cc: "Tobin C. Harding" , Tycho Andersen , linux-kernel@vger.kernel.org Subject: [PATCH 2/3] leaking_addresses: Completely remove --version flag Date: Fri, 8 Feb 2019 09:50:25 +1100 Message-Id: <20190207225026.11723-3-tobin@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190207225026.11723-1-tobin@kernel.org> References: <20190207225026.11723-1-tobin@kernel.org> MIME-Version: 1.0 X-Virus-Scanned: ClamAV using ClamSMTP Recently attempt to remove the '--version' flag was made, badly. I failed to remove mention of it from the help output. And also I failed to actually remove the flag from the options list. _Completely_ remove --version flag. Signed-off-by: Tobin C. Harding --- scripts/leaking_addresses.pl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/leaking_addresses.pl b/scripts/leaking_addresses.pl index 214c12be8c86..ef9e5b2a1614 100755 --- a/scripts/leaking_addresses.pl +++ b/scripts/leaking_addresses.pl @@ -97,7 +97,7 @@ Options: --32-bit Scan 32-bit kernel. --page-offset-32-bit=o Page offset (for 32-bit kernel 0xABCD1234). -d, --debug Display debugging output. - -h, --help, --version Display this help and exit. + -h, --help Display this help and exit. Scans the running kernel for potential leaking addresses. @@ -108,7 +108,6 @@ EOM GetOptions( 'd|debug' => \$debug, 'h|help' => \$help, - 'version' => \$help, 'o|output-raw=s' => \$output_raw, 'i|input-raw=s' => \$input_raw, 'suppress-dmesg' => \$suppress_dmesg, From patchwork Thu Feb 7 22:50:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Tobin C. Harding" X-Patchwork-Id: 10802313 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BC7961390 for ; Fri, 8 Feb 2019 00:47:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AC8AD2DE1A for ; Fri, 8 Feb 2019 00:47:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9F7FD2E636; Fri, 8 Feb 2019 00:47:12 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED 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 D72472DE1A for ; Fri, 8 Feb 2019 00:47:11 +0000 (UTC) Received: (qmail 26066 invoked by uid 550); 8 Feb 2019 00:47:03 -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 Delivered-To: moderator for kernel-hardening@lists.openwall.com Received: (qmail 3603 invoked from network); 7 Feb 2019 22:51:05 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=rl9IOz7bUSqbOMyGkhPi6aRMwmI5d43wx7DRds0uh/4=; b=j//XwNNY x67JRCHmIIU1wa4IoY4O5vgv0aGupjDmbAAT+hm+yqE+lz5ZbD1i4Tu6qqeC57uK e4Zrnfly5CZsWHZ3K98wZY7axHfgSvLtObu2hk74++g6rozSN8HFcIEMaAudKSfC 3K9iCCa6fLfhyM/4wraKWrSgDvD7mTCLNBBMvukHv9cSNT+J31GMOQm7uQg0qYXD 0AqPDld20Nz77IKJ7Bte1apee7YJy8zSHBT37EeoecPCiIYxOeSb9GwGMoJmRO8T 8zXiI4TOK6mq70llkv4cjVJCHdkhrMkccGNTG2S1iy0rw9AO0h25svMh4Y1eKlg7 GCnJwhPI2G+/8Q== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledrledugddtudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfhuthenuceurghilhhouhhtmecufedt tdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufffkffojg hfggfgsedtkeertdertddtnecuhfhrohhmpedfvfhosghinhcuvedrucfjrghrughinhhg fdcuoehtohgsihhnsehkvghrnhgvlhdrohhrgheqnecukfhppeduvddurdeggedrudelle druddtleenucfrrghrrghmpehmrghilhhfrhhomhepthhosghinheskhgvrhhnvghlrdho rhhgnecuvehluhhsthgvrhfuihiivgepud X-ME-Proxy: From: "Tobin C. Harding" To: kernel-hardening@lists.openwall.com Cc: "Tobin C. Harding" , Tycho Andersen , linux-kernel@vger.kernel.org Subject: [PATCH 3/3] leaking_addresses: Expand tilde in output file name Date: Fri, 8 Feb 2019 09:50:26 +1100 Message-Id: <20190207225026.11723-4-tobin@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190207225026.11723-1-tobin@kernel.org> References: <20190207225026.11723-1-tobin@kernel.org> MIME-Version: 1.0 X-Virus-Scanned: ClamAV using ClamSMTP Currently if user passes an output file to the script via --output-raw we do not handle expansion of tilde. Use perl function glob() to expand tilde in output file name. Signed-off-by: Tobin C. Harding --- scripts/leaking_addresses.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/leaking_addresses.pl b/scripts/leaking_addresses.pl index ef9e5b2a1614..ce545ca3fb70 100755 --- a/scripts/leaking_addresses.pl +++ b/scripts/leaking_addresses.pl @@ -150,7 +150,7 @@ if (!(is_supported_architecture() or $opt_32bit or $page_offset_32bit)) { } if ($output_raw) { - open my $fh, '>', $output_raw or die "$0: $output_raw: $!\n"; + open my $fh, '>', glob($output_raw) or die "$0: $output_raw: $!\n"; select $fh; }