Received: by 10.223.176.5 with SMTP id f5csp704803wra; Fri, 9 Feb 2018 06:00:19 -0800 (PST) X-Google-Smtp-Source: AH8x225l3DygIlt5pWdngsc2kuji/HKuyQd4OfW8uTHL30d0/Y77kOsvcROmx0rXsuGmdLnE63l/ X-Received: by 10.99.120.139 with SMTP id t133mr2458530pgc.382.1518184818912; Fri, 09 Feb 2018 06:00:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518184818; cv=none; d=google.com; s=arc-20160816; b=rT1TF5Hu6pjR/rfC6iLwqYRix4x0hDu76ztBM9f9ggXY+O/wikC+eLfZB3+2+Jgb5n J/9NeWYnumE+dJt0bgcpLgvbxfa+ZlKVSu1ZkasGwFchhdpYuQdLKwaorMwb37ILSKPz KvxCgEUqXYQs//sMDFo1RDwRa/hITQlTlLJHnKsfX83fVX8x2WJYE7+KLrTL1sJKjs2P o2fES30C4sw5i9fp+9usxGexy2L/h6GDfoKwaOnfjJMywk6ZLNj9oer2ZHm0Z527DO1e fHrK22y7MujDOd17iyBZPqyvwSGmippOsoioLqkMeBhsquYQbhmqkKSvxkQh/Grg09Px Z/OA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=cBEOWApNg7vCJbn45XfoErhgD6OwLmqJrMNYqVUhz1c=; b=xwdmY4dwn8hZhnMnlmt/IX3wSxUCeAK84pdvsH76U7qwJjWq4TH0DqJ+hJQ4H1PbMb IKGxxYhzRf01D8qGVqa9u1WlvYEnxvV7fLjZ1Fru6adImB05szbzV3wVBaSQMg2kxhOX 0L2WyqklW/5vbvAzDeOUVb0NnlSrD3bnE8LVkx+Chrt3BdcZhmSnfdEAjPIMsRjrK/B7 xsxBmFRuwsTjZlafxiYq4ucd1kMDLhRLtX219dxBjNhoQC3iwyDSF9BF1k8mhD9THxqM VkAi4CRxoM0IhkzDTrkqNy6t1qAw+9h1YlSa6zqtPSX1/y0KG2le2RbVWLlYqBFGNLua Zxdg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f13si1374533pgn.155.2018.02.09.06.00.04; Fri, 09 Feb 2018 06:00:18 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753611AbeBIN6v (ORCPT + 99 others); Fri, 9 Feb 2018 08:58:51 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:51468 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753337AbeBINod (ORCPT ); Fri, 9 Feb 2018 08:44:33 -0500 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 0E369FF5; Fri, 9 Feb 2018 13:44:32 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Borislav Petkov , Thomas Gleixner , riel@redhat.com, ak@linux.intel.com, peterz@infradead.org, David Woodhouse , jikos@kernel.org, luto@amacapital.net, dave.hansen@intel.com, torvalds@linux-foundation.org, keescook@google.com, Josh Poimboeuf , tim.c.chen@linux.intel.com, pjt@google.com, David Woodhouse , gregkh@linux-foundation.org Subject: [PATCH 4.9 46/92] x86/alternative: Print unadorned pointers Date: Fri, 9 Feb 2018 14:39:15 +0100 Message-Id: <20180209133934.472824776@linuxfoundation.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180209133931.211869118@linuxfoundation.org> References: <20180209133931.211869118@linuxfoundation.org> User-Agent: quilt/0.65 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Borislav Petkov (cherry picked from commit 0e6c16c652cadaffd25a6bb326ec10da5bcec6b4) After commit ad67b74d2469 ("printk: hash addresses printed with %p") pointers are being hashed when printed. However, this makes the alternative debug output completely useless. Switch to %px in order to see the unadorned kernel pointers. Signed-off-by: Borislav Petkov Signed-off-by: Thomas Gleixner Cc: riel@redhat.com Cc: ak@linux.intel.com Cc: peterz@infradead.org Cc: David Woodhouse Cc: jikos@kernel.org Cc: luto@amacapital.net Cc: dave.hansen@intel.com Cc: torvalds@linux-foundation.org Cc: keescook@google.com Cc: Josh Poimboeuf Cc: tim.c.chen@linux.intel.com Cc: gregkh@linux-foundation.org Cc: pjt@google.com Link: https://lkml.kernel.org/r/20180126121139.31959-2-bp@alien8.de Signed-off-by: David Woodhouse Signed-off-by: Greg Kroah-Hartman --- arch/x86/kernel/alternative.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) --- a/arch/x86/kernel/alternative.c +++ b/arch/x86/kernel/alternative.c @@ -298,7 +298,7 @@ recompute_jump(struct alt_instr *a, u8 * tgt_rip = next_rip + o_dspl; n_dspl = tgt_rip - orig_insn; - DPRINTK("target RIP: %p, new_displ: 0x%x", tgt_rip, n_dspl); + DPRINTK("target RIP: %px, new_displ: 0x%x", tgt_rip, n_dspl); if (tgt_rip - orig_insn >= 0) { if (n_dspl - 2 <= 127) @@ -352,7 +352,7 @@ static void __init_or_module optimize_no sync_core(); local_irq_restore(flags); - DUMP_BYTES(instr, a->instrlen, "%p: [%d:%d) optimized NOPs: ", + DUMP_BYTES(instr, a->instrlen, "%px: [%d:%d) optimized NOPs: ", instr, a->instrlen - a->padlen, a->padlen); } @@ -370,7 +370,7 @@ void __init_or_module apply_alternatives u8 *instr, *replacement; u8 insnbuf[MAX_PATCH_LEN]; - DPRINTK("alt table %p -> %p", start, end); + DPRINTK("alt table %px, -> %px", start, end); /* * The scan order should be from start to end. A later scanned * alternative code can overwrite previously scanned alternative code. @@ -394,14 +394,14 @@ void __init_or_module apply_alternatives continue; } - DPRINTK("feat: %d*32+%d, old: (%p, len: %d), repl: (%p, len: %d), pad: %d", + DPRINTK("feat: %d*32+%d, old: (%px len: %d), repl: (%px, len: %d), pad: %d", a->cpuid >> 5, a->cpuid & 0x1f, instr, a->instrlen, replacement, a->replacementlen, a->padlen); - DUMP_BYTES(instr, a->instrlen, "%p: old_insn: ", instr); - DUMP_BYTES(replacement, a->replacementlen, "%p: rpl_insn: ", replacement); + DUMP_BYTES(instr, a->instrlen, "%px: old_insn: ", instr); + DUMP_BYTES(replacement, a->replacementlen, "%px: rpl_insn: ", replacement); memcpy(insnbuf, replacement, a->replacementlen); insnbuf_sz = a->replacementlen; @@ -422,7 +422,7 @@ void __init_or_module apply_alternatives a->instrlen - a->replacementlen); insnbuf_sz += a->instrlen - a->replacementlen; } - DUMP_BYTES(insnbuf, insnbuf_sz, "%p: final_insn: ", instr); + DUMP_BYTES(insnbuf, insnbuf_sz, "%px: final_insn: ", instr); text_poke_early(instr, insnbuf, insnbuf_sz); }