linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Petr Mladek <pmladek@suse.com>
To: Jaewon Kim <jaewon31.kim@samsung.com>
Cc: David Laight <David.Laight@aculab.com>,
	'Jaewon Kim' <jaewon31.kim@gmail.com>,
	"senozhatsky@chromium.org" <senozhatsky@chromium.org>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	GyeongHwan Hong <gh21.hong@samsung.com>
Subject: Re: [RFC] vsprintf: compile error on %09pK
Date: Tue, 4 Apr 2023 14:03:47 +0200	[thread overview]
Message-ID: <ZCwSIy5Tm0jAe1Ww@alley> (raw)
In-Reply-To: <20230404101201epcms1p615a6365e64fc6e0a0fa203d41404940c@epcms1p6>

On Tue 2023-04-04 19:12:01, Jaewon Kim wrote:
> >From: Jaewon Kim
> >> Sent: 03 April 2023 15:40
> >...
> >> I wanted to print phys_addr_t  type value only when kptr_restrict sysctl is
> >> allowed. So I thought I could use %pK for that purpose. And the physical
> >> address is not that long. I wanted to make that length short like 9 hex.
> >
> >Isn't that is the wrong format for physical addresses anyway?
> >They can be larger than virtual ones (eg x86 with PAE).
> 
> Yeah, correct. I just used %pK to hide physical address, I thought it could be
> leak in security perspective. Could you give me advice how I can hide the
> address by default and look the address if kptr_restrict allow it?

Could you please send a patch that would show what value you want to print?

The initial mail mentioned converting %09lx to %09pK in some driver.
Then it included a warning when compiling from mm/page_alloc.o

Honestly, I think that you could just use %pK or %p. IMHO, it does not
make sense to optimize it for the length.

Anyway, there is still the question if the address is really worth
printing. Will it really help to locate a potential problem?

Best Regards,
Petr


  reply	other threads:[~2023-04-04 12:03 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20230403104617epcms1p383bacbca705c0d7e4fffca6833050e42@epcms1p3>
2023-04-03 10:46 ` Jaewon Kim
2023-04-03 12:18   ` Sergey Senozhatsky
2023-04-03 12:53   ` Petr Mladek
2023-04-03 14:39     ` Jaewon Kim
2023-04-03 15:34       ` Sergey Senozhatsky
2023-04-03 16:04       ` David Laight
     [not found]       ` <CGME20230403104617epcms1p383bacbca705c0d7e4fffca6833050e42@epcms1p6>
2023-04-04 10:12         ` Jaewon Kim
2023-04-04 12:03           ` Petr Mladek [this message]
     [not found]           ` <CGME20230403104617epcms1p383bacbca705c0d7e4fffca6833050e42@epcms1p1>
2023-04-04 12:33             ` Jaewon Kim
     [not found]       ` <CGME20230403104617epcms1p383bacbca705c0d7e4fffca6833050e42@epcms1p5>
2023-04-04 10:16         ` Jaewon Kim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZCwSIy5Tm0jAe1Ww@alley \
    --to=pmladek@suse.com \
    --cc=David.Laight@aculab.com \
    --cc=gh21.hong@samsung.com \
    --cc=jaewon31.kim@gmail.com \
    --cc=jaewon31.kim@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=senozhatsky@chromium.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox