From patchwork Mon Feb 19 02:50:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tobin Harding X-Patchwork-Id: 10227039 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 7E40C602B1 for ; Mon, 19 Feb 2018 02:51:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7012F2886C for ; Mon, 19 Feb 2018 02:51:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 631582887B; Mon, 19 Feb 2018 02:51:27 +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.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, 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 683EE2886C for ; Mon, 19 Feb 2018 02:51:25 +0000 (UTC) Received: (qmail 2017 invoked by uid 550); 19 Feb 2018 02:51:14 -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 1879 invoked from network); 19 Feb 2018 02:51:12 -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=fm2; bh=wNKDrZ+zIgYg1yyn1 wDiQdiQjjWWzuKIOYt96iYicug=; b=NNMRITuzYCQ1BbVjbctfa0fmd8cAluMr4 573KxmxNcyeX5t/CUGYe7hdMyq6UF2X2PE6qgQgc3EvN33pB1qkS0BdXFE8cnAla cUSBXW4H5iRL9wEO+LagOHHeFhgqEuoEVvrCgG9++TdzyTKn+gFKcxBVNYWeWJjD 9tR341m13ICjmfFKZE9Qf828xJ0i5OyH573+qthHAZIlFinBjUJjJyerJ/DVnlKe JlQYc7A9543VwXJhPnfxpoqArKxf6EEWK3rHUMPMDJAir9z0kOVgD/JOW0M20Op9 ZdZgD+KVldLFoEC7gQmQ+obGn8z0FhSQBBnkJOreyPz5zquyrssUQ== 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= fm2; bh=wNKDrZ+zIgYg1yyn1wDiQdiQjjWWzuKIOYt96iYicug=; b=QPo0GJMy XRrFEBoeZ9NKHw6M8huM7h2FU65Q9h/6/90yJl6soaDFrYKi4FMgxEZQkdM28NX5 8fiSArz8tRM0Adymt+sGCDRsnEu3q7o9ZEyZTvel0J0OE7VROXCQwn39GoHyPa1I hTIgNjzQYJhuO30fRvfqNr4nMUtb3DEiWxuIm4najuKqvovlTvkvBhiCAaMxNBbG IXigCvovI2T5DSNJiNgmQgUuN/XKlW1J9gharJtUGZ7pl/x0vYUQcw5Kiqy2L6dH CWank6DeIlLcrznQo1xkbd4qSFLfMtGRp5ar2UVoudQAdswM/fju5/+ujKxtKUzU e6/1MXkpxE14hw== X-ME-Sender: From: "Tobin C. Harding" To: Kernel Hardening Cc: "Tobin C. Harding" , Tycho Andersen , LKML Subject: [PATCH 1/4] leaking_addresses: do not parse binary files Date: Mon, 19 Feb 2018 13:50:46 +1100 Message-Id: <1519008649-15782-2-git-send-email-me@tobin.cc> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1519008649-15782-1-git-send-email-me@tobin.cc> References: <1519008649-15782-1-git-send-email-me@tobin.cc> X-Virus-Scanned: ClamAV using ClamSMTP Currently script parses binary files. Since we are scanning for readable kernel addresses there is no need to parse binary files. We can use Perl to check if file is binary and skip parsing it if so. Do not parse binary files. Signed-off-by: Tobin C. Harding --- scripts/leaking_addresses.pl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/leaking_addresses.pl b/scripts/leaking_addresses.pl index 05906f6cf6b9..3d5c3096aac8 100755 --- a/scripts/leaking_addresses.pl +++ b/scripts/leaking_addresses.pl @@ -462,6 +462,10 @@ sub parse_file return; } + if (! -T $file) { + return; + } + if (skip_parse($file)) { dprint "skipping file: $file\n"; return;