From patchwork Wed Nov 29 02:05:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tobin Harding X-Patchwork-Id: 10081363 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 302DD60311 for ; Wed, 29 Nov 2017 02:06:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 20E512982E for ; Wed, 29 Nov 2017 02:06:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1343929830; Wed, 29 Nov 2017 02:06:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from mother.openwall.net (mother.openwall.net [195.42.179.200]) by mail.wl.linuxfoundation.org (Postfix) with SMTP id E80122982E for ; Wed, 29 Nov 2017 02:06:21 +0000 (UTC) Received: (qmail 23686 invoked by uid 550); 29 Nov 2017 02:05:53 -0000 Mailing-List: contact kernel-hardening-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Delivered-To: mailing list kernel-hardening@lists.openwall.com Received: (qmail 23579 invoked from network); 29 Nov 2017 02:05:52 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tobin.cc; h=cc :date:from:in-reply-to:message-id:references:subject:to :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=UgxMzSa8ZaqbMz5ts V/xoK/juEqTOkbnIfSImlbUjqk=; b=EdjX3KIDltFM9c3JRk/dVXzong/+0UsB4 38ENURFCQ+j71yNnmvPCjydnCepSye29O05czH6Jw0xDiA+yG4zjvtQjtW1/E6EG RXFju97pqYcw9ejHT0gOHru8I+E7S3RiVRr9GUXvDu90QZpjbRuuW1lRy4PI1/dJ E9khm/o6RLyBRyQCbSMhHYwI0lTaAIzFjOzGxeEIX0njUkKXR7JnXxn4Q07+uyDi jrMzs8zIXg49kma7xilLZB/N9kIHp6xzMABAnLVRa+nkhh+TtGBy6J1T2f0thPey r+HeK4XV9DxArOmMQx60uG1geP6GPqh3JZ1H7u+zoiyU7RJ5wSeBw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:in-reply-to:message-id :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=UgxMzSa8ZaqbMz5tsV/xoK/juEqTOkbnIfSImlbUjqk=; b=TNFVbVsA /Kbvkj8/DC70ZVmw5/pOFTM0bpLyCe/NShaKyeWVYxVoPPesDvWplAkjn45BeFJb ecYNa2zAZ8O8bmY3L4YWv0BL7zXqjQE+Uz88CdfuCIjR5PR5hVC45hcDgXHpuzAl nXuoimCatiV1tqjSyyfY5X0lvJaREvYCuQKmzzOZwsRkTkVucHjoigGLo4tRow6K fjgB4mnIqtWqWP1BVWzYvzDZxNB4Bz4e6D9pKz8vceew5l0VdFNncZ7gaAP5zveE 2apoFc1dtlsB2YCLYMNQfyIpNXD0Qg7yI7ilqSQXF+UTL+xjWev/GCDCiQzjQIse CIksLQ4Ml/1Hcg== X-ME-Sender: From: "Tobin C. Harding" To: kernel-hardening@lists.openwall.com Cc: "Tobin C. Harding" , Linus Torvalds , "Jason A. Donenfeld" , Theodore Ts'o , Kees Cook , Paolo Bonzini , Tycho Andersen , "Roberts, William C" , Tejun Heo , Jordan Glover , Greg KH , Petr Mladek , Joe Perches , Ian Campbell , Sergey Senozhatsky , Catalin Marinas , Will Deacon , Steven Rostedt , Chris Fries , Dave Weinstein , Daniel Micay , Djalal Harouni , =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= , linux-kernel@vger.kernel.org, Network Development , David Miller , Stephen Rothwell , Andrey Ryabinin , Alexander Potapenko , Dmitry Vyukov , Andrew Morton Date: Wed, 29 Nov 2017 13:05:05 +1100 Message-Id: <1511921105-3647-6-git-send-email-me@tobin.cc> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1511921105-3647-1-git-send-email-me@tobin.cc> References: <1511921105-3647-1-git-send-email-me@tobin.cc> Subject: [kernel-hardening] [PATCH V11 5/5] kasan: use %px to print addresses instead of %p X-Virus-Scanned: ClamAV using ClamSMTP Pointers printed with %p are now hashed by default. Kasan needs the actual address. We can use the new printk specifier %px for this purpose. Use %px instead of %p to print addresses. Signed-off-by: Tobin C. Harding --- mm/kasan/report.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mm/kasan/report.c b/mm/kasan/report.c index 6bcfb01ba038..410c8235e671 100644 --- a/mm/kasan/report.c +++ b/mm/kasan/report.c @@ -134,7 +134,7 @@ static void print_error_description(struct kasan_access_info *info) pr_err("BUG: KASAN: %s in %pS\n", bug_type, (void *)info->ip); - pr_err("%s of size %zu at addr %p by task %s/%d\n", + pr_err("%s of size %zu at addr %px by task %s/%d\n", info->is_write ? "Write" : "Read", info->access_size, info->access_addr, current->comm, task_pid_nr(current)); } @@ -206,7 +206,7 @@ static void describe_object_addr(struct kmem_cache *cache, void *object, const char *rel_type; int rel_bytes; - pr_err("The buggy address belongs to the object at %p\n" + pr_err("The buggy address belongs to the object at %px\n" " which belongs to the cache %s of size %d\n", object, cache->name, cache->object_size); @@ -225,7 +225,7 @@ static void describe_object_addr(struct kmem_cache *cache, void *object, } pr_err("The buggy address is located %d bytes %s of\n" - " %d-byte region [%p, %p)\n", + " %d-byte region [%px, %px)\n", rel_bytes, rel_type, cache->object_size, (void *)object_addr, (void *)(object_addr + cache->object_size)); } @@ -302,7 +302,7 @@ static void print_shadow_for_address(const void *addr) char shadow_buf[SHADOW_BYTES_PER_ROW]; snprintf(buffer, sizeof(buffer), - (i == 0) ? ">%p: " : " %p: ", kaddr); + (i == 0) ? ">%px: " : " %px: ", kaddr); /* * We should not pass a shadow pointer to generic * function, because generic functions may try to