Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757278AbcK3IIx (ORCPT ); Wed, 30 Nov 2016 03:08:53 -0500 Received: from mailout1.samsung.com ([203.254.224.24]:41508 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754686AbcK3IIt (ORCPT ); Wed, 30 Nov 2016 03:08:49 -0500 X-AuditID: cbfee61b-f796f6d000004092-60-583e890f792f From: Maninder Singh To: catalin.marinas@arm.com, will.deacon@arm.com, james.morse@arm.com, mark.rutland@arm.com, akpm@linux-foundation.org, sandeepa.s.prabhu@gmail.com, labbott@redhat.com, shijie.huang@arm.com Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, ajeet.y@samsung.com, pankaj.m@samsung.com, Maninder Singh , Vaneet Narang Subject: [PATCH 1/2] arm64: Correcting format specifier for printin 64 bit addresses Date: Wed, 30 Nov 2016 13:33:56 +0530 Message-id: <1480493036-47334-1-git-send-email-maninder1.s@samsung.com> X-Mailer: git-send-email 1.9.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpikeLIzCtJLcpLzFFi42I5/e+xoC5/p12Ewexf4hYvXk1gsZizfg2b xftlPYwW9/ctZ7JYuecHk8Wmx9dYLS7vmsNmcXh+G4vF0usXmSzuvdnKZPFoyQE2iztds5gs Dp2cy2jx8uMJFgc+jzXz1jB67Jx1l93jxIzfLB6bl9R7vN93lc2jb8sqRo/Pm+QC2KPcbDJS E1NSixRS85LzUzLz0m2VQkPcdC2UFPISc1NtlSJ0fUOClBTKEnNKgTwjAzTg4BzgHqykb5fg ljF54hGWgk7hinNdi9gaGG/ydzFyckgImEh0duxkhrDFJC7cW8/WxcjFISQwi1HiRfcesISQ wE9GiW2XS0FsNgE9iVW79rCAFIkIHGSU2NmxBqyDWeAoo8TEa11gHcICYRKdbc/ZQWwWAVWJ o8c7GEFsXgF3iXkbm6DWyUmcPDaZdQIj9wJGhlWMEqkFyQXFSem5Rnmp5XrFibnFpXnpesn5 uZsYweH/THoH4+Fd7ocYBTgYlXh4F8yxjRBiTSwrrsw9xCjBwawkwmvebhchxJuSWFmVWpQf X1Sak1p8iNEU6ICJzFKiyfnA2MwriTc0MTcxNzawMLe0NDFSEudtnP0sXEggPbEkNTs1tSC1 CKaPiYNTqoHxqMzimxKyXb9UlR7cdLkvKX/Q3zunfHPhhpQ/rDP12k0dl8/flNG65brMulSB 829tLAsnM22/waqrdZIhIP3Vn5337Le/PfPu5t7r+/na3bSZo1dJb/Ta8WfNm+MqcrP+nCw3 uM0sVr/2v69scJkXx/bwbYdjI6YcKrec94rD1OVQ2IMLge3sSizFGYmGWsxFxYkAN82dfZUC AAA= X-MTR: 20000000000000000@CPGS Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2374 Lines: 65 This patch corrects format specifier for printing 64 bit addresses. Before Patch ============ [ 68.251603] Unable to handle kernel NULL pointer dereference at virtual address 00000000 [ 68.251673] pgd = ffffffc013950000 [ 68.251782] [00000000] *pgd=0000000093e19003, *pud=0000000093e19003, *pmd=0000000000000000 After patch =========== [ 8.565030] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000000 [ 8.565389] pgd = ffffffc013872000 [ 8.565553] [0000000000000000] *pgd=0000000093874003, *pud=0000000093874003, *pmd=0000000000000000 and same for user space fault. Signed-off-by: Vaneet Narang Signed-off-by: Maninder Singh --- arch/arm64/mm/fault.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c index a78a5c4..8cb5c93 100644 --- a/arch/arm64/mm/fault.c +++ b/arch/arm64/mm/fault.c @@ -77,7 +77,7 @@ void show_pte(struct mm_struct *mm, unsigned long addr) pr_alert("pgd = %p\n", mm->pgd); pgd = pgd_offset(mm, addr); - pr_alert("[%08lx] *pgd=%016llx", addr, pgd_val(*pgd)); + pr_alert("[%016lx] *pgd=%016llx", addr, pgd_val(*pgd)); do { pud_t *pud; @@ -177,7 +177,7 @@ static void __do_kernel_fault(struct mm_struct *mm, unsigned long addr, * No handler, we'll have to terminate things with extreme prejudice. */ bust_spinlocks(1); - pr_alert("Unable to handle kernel %s at virtual address %08lx\n", + pr_alert("Unable to handle kernel %s at virtual address %016lx\n", (addr < PAGE_SIZE) ? "NULL pointer dereference" : "paging request", addr); @@ -198,9 +198,15 @@ static void __do_user_fault(struct task_struct *tsk, unsigned long addr, struct siginfo si; if (unhandled_signal(tsk, sig) && show_unhandled_signals_ratelimited()) { - pr_info("%s[%d]: unhandled %s (%d) at 0x%08lx, esr 0x%03x\n", - tsk->comm, task_pid_nr(tsk), fault_name(esr), sig, - addr, esr); + if (compat_user_mode(regs)) + pr_info("%s[%d]: unhandled %s (%d) at 0x%08lx, esr 0x%03x\n", + tsk->comm, task_pid_nr(tsk), fault_name(esr), sig, + addr, esr); + else + pr_info("%s[%d]: unhandled %s (%d) at 0x%016lx, esr 0x%03x\n", + tsk->comm, task_pid_nr(tsk), fault_name(esr), sig, + addr, esr); + show_pte(tsk->mm, addr); show_regs(regs); } -- 1.9.1