* [PATCH] mm: do not hash address in print_bad_pte()
@ 2019-08-31 1:18 Kefeng Wang
2019-09-03 13:12 ` Michal Hocko
0 siblings, 1 reply; 2+ messages in thread
From: Kefeng Wang @ 2019-08-31 1:18 UTC (permalink / raw)
To: linux-mm; +Cc: Andrew Morton, Kefeng Wang
Using %px to show the actual address in print_bad_pte()
to help us to debug issue.
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] mm: do not hash address in print_bad_pte()
2019-08-31 1:18 [PATCH] mm: do not hash address in print_bad_pte() Kefeng Wang
@ 2019-09-03 13:12 ` Michal Hocko
0 siblings, 0 replies; 2+ messages in thread
From: Michal Hocko @ 2019-09-03 13:12 UTC (permalink / raw)
To: Kefeng Wang; +Cc: linux-mm, Andrew Morton
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-09-03 13:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-31 1:18 [PATCH] mm: do not hash address in print_bad_pte() Kefeng Wang
2019-09-03 13:12 ` Michal Hocko
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).