From patchwork Wed Mar 1 00:06:07 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 9597203 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 20E6B60429 for ; Wed, 1 Mar 2017 00:06:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0DF552756B for ; Wed, 1 Mar 2017 00:06:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 005E627FBC; Wed, 1 Mar 2017 00:06:25 +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.2 required=2.0 tests=BAYES_00, 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 7DC9127FAC for ; Wed, 1 Mar 2017 00:06:23 +0000 (UTC) Received: (qmail 10105 invoked by uid 550); 1 Mar 2017 00:06:22 -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 10070 invoked from network); 1 Mar 2017 00:06:20 -0000 Date: Tue, 28 Feb 2017 16:06:07 -0800 From: Andrew Morton To: Joe Perches Cc: Andy Whitcroft , "Roberts, William C" , kernel-hardening@lists.openwall.com, linux-kernel@vger.kernel.org Message-Id: <20170228160607.183a88bd491e97fa6a7ded9c@linux-foundation.org> In-Reply-To: <163a690510e636a23187c0dc9caa09ddac6d4cde.1488228427.git.joe@perches.com> References: <476DC76E7D1DF2438D32BFADF679FC562307BAE6@ORSMSX103.amr.corp.intel.com> <163a690510e636a23187c0dc9caa09ddac6d4cde.1488228427.git.joe@perches.com> X-Mailer: Sylpheed 3.4.1 (GTK+ 2.24.23; x86_64-pc-linux-gnu) Mime-Version: 1.0 Subject: [kernel-hardening] Re: [PATCH] checkpatch: Add ability to find bad uses of vsprintf %p extensions X-Virus-Scanned: ClamAV using ClamSMTP On Mon, 27 Feb 2017 12:54:55 -0800 Joe Perches wrote: > %pK was at least once misused at %pk in an out-of-tree module. > This lead to some security concerns. Add the ability to track > single and multiple line statements for misuses of %p. Should we also do this? --- a/lib/vsprintf.c~checkpatch-add-ability-to-find-bad-uses-of-vsprintf-%pfoo-extensions-fix +++ a/lib/vsprintf.c @@ -1477,6 +1477,9 @@ int kptr_restrict __read_mostly; * by an extra set of alphanumeric characters that are extended format * specifiers. * + * Please update scripts/checkpatch.pl when adding new conversion characters. + * (search for "check for vsprintf extension"). + * * Right now we handle: * * - 'F' For symbolic function descriptor pointers with offset