linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@kernel.org>
To: Kefeng Wang <wangkefeng.wang@huawei.com>
Cc: linux-mm@kvack.org, Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH] mm: do not hash address in print_bad_pte()
Date: Tue, 3 Sep 2019 15:12:46 +0200	[thread overview]
Message-ID: <20190903131246.GX14028@dhcp22.suse.cz> (raw)
In-Reply-To: <20190831011816.141002-1-wangkefeng.wang@huawei.com>

On Sat 31-08-19 09:18:16, Kefeng Wang wrote:
> Using %px to show the actual address in print_bad_pte()
> to help us to debug issue.

Yes, those values are of no use when hashed. At least __dump_page prints
mapping directly so there is no reason to differ here. anon_vma doesn't
really disclose much more AFAICS. Printing the addr might disclose
randomization offset for a vma but process usually doesn't live for long
after a bad pte is detected so it should be reasonably safe unless I
miss something
 
> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>

Acked-by: Michal Hocko <mhocko@suse.com>

> ---
>  mm/memory.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mm/memory.c b/mm/memory.c
> index e2bb51b6242e..3f0874c9ca38 100644
> --- a/mm/memory.c
> +++ b/mm/memory.c
> @@ -518,7 +518,7 @@ static void print_bad_pte(struct vm_area_struct *vma, unsigned long addr,
>  		 (long long)pte_val(pte), (long long)pmd_val(*pmd));
>  	if (page)
>  		dump_page(page, "bad pte");
> -	pr_alert("addr:%p vm_flags:%08lx anon_vma:%p mapping:%p index:%lx\n",
> +	pr_alert("addr:%px vm_flags:%08lx anon_vma:%px mapping:%px index:%lx\n",
>  		 (void *)addr, vma->vm_flags, vma->anon_vma, mapping, index);
>  	pr_alert("file:%pD fault:%ps mmap:%ps readpage:%ps\n",
>  		 vma->vm_file,
> -- 
> 2.20.1
> 

-- 
Michal Hocko
SUSE Labs


      reply	other threads:[~2019-09-03 13:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-31  1:18 Kefeng Wang
2019-09-03 13:12 ` Michal Hocko [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=20190903131246.GX14028@dhcp22.suse.cz \
    --to=mhocko@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-mm@kvack.org \
    --cc=wangkefeng.wang@huawei.com \
    /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