stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Daniel Rosenberg <drosen@google.com>
Cc: Sumit Semwal <sumit.semwal@linaro.org>,
	linux-kernel@vger.kernel.org,
	Gustavo Padovan <gustavo@padovan.org>,
	linux-media@vger.kernel.org, linaro-mm-sig@lists.linaro.org,
	dri-devel@lists.freedesktop.org, kernel-team@android.com,
	Divya Ponnusamy <pdivya@codeaurora.org>,
	stable <stable@vger.kernel.org>
Subject: Re: [PATCH resend] drivers: dma-buf: Change %p to %pK in debug messages
Date: Wed, 6 Jun 2018 11:07:53 +0200	[thread overview]
Message-ID: <20180606090753.GA27744@kroah.com> (raw)
In-Reply-To: <20180605234041.246060-1-drosen@google.com>

On Tue, Jun 05, 2018 at 04:40:41PM -0700, Daniel Rosenberg wrote:
> The format specifier %p can leak kernel addresses
> while not valuing the kptr_restrict system settings.
> Use %pK instead of %p, which also evaluates whether
> kptr_restrict is set.
> 
> Signed-off-by: Divya Ponnusamy <pdivya@codeaurora.org>
> Signed-off-by: Daniel Rosenberg <drosen@google.com>
> Cc: stable <stable@vger.kernel.org>
> ---
>  drivers/dma-buf/sync_debug.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/dma-buf/sync_debug.c b/drivers/dma-buf/sync_debug.c
> index c4c8ecb24aa9..d8d340542a79 100644
> --- a/drivers/dma-buf/sync_debug.c
> +++ b/drivers/dma-buf/sync_debug.c
> @@ -133,7 +133,7 @@ static void sync_print_sync_file(struct seq_file *s,
>  	char buf[128];
>  	int i;
>  
> -	seq_printf(s, "[%p] %s: %s\n", sync_file,
> +	seq_printf(s, "[%pK] %s: %s\n", sync_file,

This is a root-only file, right?  So it's not that bad of a problem.
Also, by default, all %p pointers are now hashed so what really is
leaking here?

And finally, why even print out a pointer at all?  Why not just stick
with the name and not worry about the pointer?

thanks,

greg k-h

      parent reply	other threads:[~2018-06-06  9:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-05 23:40 [PATCH resend] drivers: dma-buf: Change %p to %pK in debug messages Daniel Rosenberg
2018-06-05 23:51 ` [Linaro-mm-sig] " Chris Wilson
2018-06-06  9:07 ` Greg KH [this message]

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=20180606090753.GA27744@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=drosen@google.com \
    --cc=gustavo@padovan.org \
    --cc=kernel-team@android.com \
    --cc=linaro-mm-sig@lists.linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=pdivya@codeaurora.org \
    --cc=stable@vger.kernel.org \
    --cc=sumit.semwal@linaro.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;
as well as URLs for NNTP newsgroup(s).