Received: by 10.223.176.46 with SMTP id f43csp613756wra; Fri, 26 Jan 2018 04:14:42 -0800 (PST) X-Google-Smtp-Source: AH8x2247njJtWprmF9kruFJhVC1406s2xZ7Txn6adn2T6+VRnF16/p0Zo5GuSuFDlubUXMEluuRH X-Received: by 2002:a17:902:15c5:: with SMTP id a5-v6mr14343667plh.277.1516968882299; Fri, 26 Jan 2018 04:14:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516968882; cv=none; d=google.com; s=arc-20160816; b=Y00Ub3etRk5OmaFbhjoVFEcwOeL4H0vT/qBVRRhzCZE5jrPJwggDHgwAh299StRNDo 4TydTXHtgRY2yJVhGNvshfGqfvVfbaekO7ZkSlqrXFCJ/Q0bQaVi+Iiyae9I23ohgZEa ggUaci/Gl2LB8WmzHiKUIvDtGM0BUGf/CZm3z3HUKVeEE+rJQKOlebNFHuF2YI2TGY+W KxM7HdNMGpYoIHJLaB9hIlpmu9x7mbWNSxe3b1mKBsaKLKrwyKD8KiJCu28sfTI5N47o bZyXnWawsnH+3KV3RwdrNbiH2cEe74rMG8KYs/fnTctcT8c5T8+NgzkHJ1p0AQOwZcmg 9YNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=xtrXze7R6o7dv8ZbKUimxdeIIA725BgTZ7wbXWFbNJM=; b=Nm5PCw5vYkjfFJD3Xvs2VdR7Qqe9rahlU47mi8KDgmHrp2yzowei2zGUa/Upkn/4ZF dZzRw10Ge9sW8tKEJprIYdF9GWb7XbUnTleRcyec7TAerCHEVvj9H5dMfTsz+2BplYLq 2VyVj6vPmalrlSxeDff+xkUB3wv5b6NlpGavq8A5OTI/XRuu50GKdJFJie/u4TtbGREv rxzEST0L0A/J6UKRNMPEK8kEh1V8XWzOAdZ1VKakW05CAX/msDZXl4LMBqICfFAFcv2E aiG3F8L2MNjOaKOkacW1cZ44FpsBBkczHPuqUvPdxaxlSajEhxNma/TdJ/8uDNgB8WRj XDcg== 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 k29si6268539pfj.228.2018.01.26.04.14.28; Fri, 26 Jan 2018 04:14:42 -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 S1751976AbeAZMM6 (ORCPT + 99 others); Fri, 26 Jan 2018 07:12:58 -0500 Received: from mail.skyhub.de ([5.9.137.197]:57402 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751510AbeAZML4 (ORCPT ); Fri, 26 Jan 2018 07:11:56 -0500 X-Virus-Scanned: Nedap ESD1 at mail.skyhub.de Received: from mail.skyhub.de ([127.0.0.1]) by localhost (blast.alien8.de [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id VxDO9gh_8vBQ; Fri, 26 Jan 2018 13:11:55 +0100 (CET) Received: from pd.tnic (p200300EC2BCF3A0024194793E6CFFC7A.dip0.t-ipconnect.de [IPv6:2003:ec:2bcf:3a00:2419:4793:e6cf:fc7a]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id F0D791EC03F6; Fri, 26 Jan 2018 13:11:54 +0100 (CET) From: Borislav Petkov To: X86 ML Cc: LKML , David Woodhouse , Josh Poimboeuf , tim.c.chen@linux.intel.com, pjt@google.com, jikos@kernel.org, gregkh@linux-foundation.org, dave.hansen@intel.com, riel@redhat.com, luto@amacapital.net, torvalds@linux-foundation.org, ak@linux.intel.com, keescook@google.com, peterz@infradead.org Subject: [PATCH 1/4] x86/alternative: Print unadorned pointers Date: Fri, 26 Jan 2018 13:11:36 +0100 Message-Id: <20180126121139.31959-2-bp@alien8.de> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20180126121139.31959-1-bp@alien8.de> References: <20180126121139.31959-1-bp@alien8.de> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Borislav Petkov 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 --- arch/x86/kernel/alternative.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c index 4817d743c263..30571fdaaf6f 100644 --- a/arch/x86/kernel/alternative.c +++ b/arch/x86/kernel/alternative.c @@ -298,7 +298,7 @@ recompute_jump(struct alt_instr *a, u8 *orig_insn, u8 *repl_insn, u8 *insnbuf) 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) @@ -355,7 +355,7 @@ static void __init_or_module noinline optimize_nops(struct alt_instr *a, u8 *ins add_nops(instr + (a->instrlen - a->padlen), a->padlen); 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); } @@ -376,7 +376,7 @@ void __init_or_module noinline apply_alternatives(struct alt_instr *start, 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. @@ -400,14 +400,14 @@ void __init_or_module noinline apply_alternatives(struct alt_instr *start, 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; @@ -433,7 +433,7 @@ void __init_or_module noinline apply_alternatives(struct alt_instr *start, 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); } -- 2.13.0