From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753179AbdEFEmx (ORCPT ); Sat, 6 May 2017 00:42:53 -0400 Received: from smtprelay0068.hostedemail.com ([216.40.44.68]:38171 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751312AbdEFEms (ORCPT ); Sat, 6 May 2017 00:42:48 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::::::::::,RULES_HIT:41:355:379:541:599:800:960:973:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1540:1593:1594:1711:1730:1747:1777:1792:2282:2393:2559:2562:2828:3138:3139:3140:3141:3142:3352:3622:3865:3866:3867:3868:3874:4250:4321:5007:6117:6119:6120:7576:7903:10004:10400:10848:11026:11232:11658:11914:12043:12048:12438:12555:12740:12760:12895:12986:13069:13095:13161:13229:13311:13357:13439:14181:14659:14721:21080:21433:21627:30003:30012:30054:30062:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:2,LUA_SUMMARY:none X-HE-Tag: bomb73_6ee705dcdfe2c X-Filterd-Recvd-Size: 2016 Message-ID: <1494045760.31950.21.camel@perches.com> Subject: Re: [RFC 5/6] lib: vsprintf: Add "%paP", "%padP" options From: Joe Perches To: Greg KH , kernel-hardening@lists.openwall.com, Petr Mladek , Sergey Senozhatsky Cc: linux-kernel@vger.kernel.org, Catalin Marinas , Will Deacon , Steven Rostedt , William Roberts , Chris Fries , Dave Weinstein Date: Fri, 05 May 2017 21:42:40 -0700 In-Reply-To: <20170506040747.GF32707@kroah.com> References: <20170506040641.GA32707@kroah.com> <20170506040747.GF32707@kroah.com> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.22.6-1ubuntu1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2017-05-05 at 21:07 -0700, Greg KH wrote: > From: Chris Fries > > Add %paP and %padP for physical address that need to always be shown > regardless of kptr restrictions. The commit message could be improved. I had to look at the actual code to see if %papP was supported. > diff --git a/Documentation/printk-formats.txt b/Documentation/printk-formats.txt [] > @@ -82,18 +82,20 @@ Struct Resources: > > Physical addresses types phys_addr_t: > > - %pa[p] 0x01234567 or 0x0123456789abcdef > + %pa[p][P] 0x01234567 or 0x0123456789abcdef Well, that's good. > diff --git a/lib/vsprintf.c b/lib/vsprintf.c [] > @@ -1394,23 +1394,29 @@ static noinline_for_stack > char *address_val(char *buf, char *end, const void *addr, const char *fmt) > { > unsigned long long num; > + int cleanse = kptr_restrict_cleanse_addresses(); bool From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <1494045760.31950.21.camel@perches.com> From: Joe Perches Date: Fri, 05 May 2017 21:42:40 -0700 In-Reply-To: <20170506040747.GF32707@kroah.com> References: <20170506040641.GA32707@kroah.com> <20170506040747.GF32707@kroah.com> Content-Type: text/plain; charset="ISO-8859-1" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [kernel-hardening] Re: [RFC 5/6] lib: vsprintf: Add "%paP", "%padP" options To: Greg KH , kernel-hardening@lists.openwall.com, Petr Mladek , Sergey Senozhatsky Cc: linux-kernel@vger.kernel.org, Catalin Marinas , Will Deacon , Steven Rostedt , William Roberts , Chris Fries , Dave Weinstein List-ID: On Fri, 2017-05-05 at 21:07 -0700, Greg KH wrote: > From: Chris Fries > > Add %paP and %padP for physical address that need to always be shown > regardless of kptr restrictions. The commit message could be improved. I had to look at the actual code to see if %papP was supported. > diff --git a/Documentation/printk-formats.txt b/Documentation/printk-formats.txt [] > @@ -82,18 +82,20 @@ Struct Resources: > > Physical addresses types phys_addr_t: > > - %pa[p] 0x01234567 or 0x0123456789abcdef > + %pa[p][P] 0x01234567 or 0x0123456789abcdef Well, that's good. > diff --git a/lib/vsprintf.c b/lib/vsprintf.c [] > @@ -1394,23 +1394,29 @@ static noinline_for_stack > char *address_val(char *buf, char *end, const void *addr, const char *fmt) > { > unsigned long long num; > + int cleanse = kptr_restrict_cleanse_addresses(); bool