Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1636824

Re: [RFC 5/6] lib: vsprintf: Add "%paP", "%padP" options

From Joe Perches <joe@perches.com>
Newsgroups linux.kernel
Subject Re: [RFC 5/6] lib: vsprintf: Add "%paP", "%padP" options
Date 2017-05-06 06:50 +0200
Message-ID <tDZPj-3qA-1@gated-at.bofh.it> (permalink)
References <tDZcB-36m-1@gated-at.bofh.it> <tDZcB-36m-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Fri, 2017-05-05 at 21:07 -0700, Greg KH wrote:
> From: Chris Fries <cfries@google.com>
> 
> 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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[RFC 00/06] printk: add more new kernel pointer filter options. Greg KH <gregkh@linuxfoundation.org> - 2017-05-06 06:10 +0200
  [RFC 6/6] drivers: uio: Un-restrict sysfs pointers for UIO Greg KH <gregkh@linuxfoundation.org> - 2017-05-06 06:10 +0200
  [RFC 5/6] lib: vsprintf: Add "%paP", "%padP" options Greg KH <gregkh@linuxfoundation.org> - 2017-05-06 06:10 +0200
    Re: [RFC 5/6] lib: vsprintf: Add "%paP", "%padP" options Joe Perches <joe@perches.com> - 2017-05-06 06:50 +0200
      Re: [RFC 5/6] lib: vsprintf: Add "%paP", "%padP" options Greg KH <gregkh@linuxfoundation.org> - 2017-05-06 07:10 +0200
  [RFC 4/6] lib: vsprintf: default kptr_restrict to the maximum value Greg KH <gregkh@linuxfoundation.org> - 2017-05-06 06:10 +0200
  [RFC 1/6] lib: vsprintf: additional kernel pointer filtering options Greg KH <gregkh@linuxfoundation.org> - 2017-05-06 06:10 +0200
  [RFC 3/6] lib: vsprintf: physical address kernel pointer filtering  options Greg KH <gregkh@linuxfoundation.org> - 2017-05-06 06:10 +0200
    Re: [kernel-hardening] [RFC 3/6] lib: vsprintf: physical address  kernel pointer filtering options Ian Campbell <ijc@hellion.org.uk> - 2017-05-06 12:50 +0200
  [RFC 2/6] lib: vsprintf: whitelist stack traces Greg KH <gregkh@linuxfoundation.org> - 2017-05-06 06:10 +0200
  Re: [RFC 00/06] printk: add more new kernel pointer filter options. Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2017-05-11 03:40 +0200

csiph-web