From patchwork Wed Nov 1 04:32:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tobin Harding X-Patchwork-Id: 10035903 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 2BD7A603B5 for ; Wed, 1 Nov 2017 04:33:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1CD2B28AE9 for ; Wed, 1 Nov 2017 04:33:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1167528AFA; Wed, 1 Nov 2017 04:33:03 +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 E941B28AE9 for ; Wed, 1 Nov 2017 04:33:01 +0000 (UTC) Received: (qmail 28312 invoked by uid 550); 1 Nov 2017 04:32:52 -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 28239 invoked from network); 1 Nov 2017 04:32:51 -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=QO3jv1hHSIV/hvk7Q ibIHuxQNBmUuklwvD6D/kyBO8g=; b=jw3pD0I9Al6Rpzb7WILQJ3LX6lq5HXnAP KCEHIXLHmCVbvF6wkzm77N4Ed8SbyBjMLzLSptU4rxXGlkKY5TGGluP6ASfz9dUW r0alzd9tGblUfieOTky7LZ6ITW6daGJeAceUkhOkHjePp/yz/rf7gP04wvbQZyN8 waiKjMI+yr1spoUUypY8r/72lPLazuUo012bvnycfpkfoSbuIIGyoevl9yy55Q/Z 3P+OyfELUMuyI7pma6dqAFqfHosooxDhYWSWXc2ik+7yiixz5uhgCp2PXyMxxK6J Zy3nwV3w4AqeWSlmneBFuGytW3ci7TjdQNUo4pKA6hl4BRw7uqbsw== 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=QO3jv1hHSIV/hvk7QibIHuxQNBmUuklwvD6D/kyBO8g=; b=CsoNq4nD ULMl8jRarOGadYkdDA/c6hYTVUh7Lvc7wsMKJkN5bYZKVnqDc5Frr4SZzAf8do6c Ns7FmJWP16LJzw9nNyOpbUVtlhX6M6cgxbRzXo9I0yfjXCly93CtDAbl5u0+hvP6 UxlneR2AQ6Ahe6O09QEoWJGg0w0HBPvrglcwzhUBckVFCwfVa6htQnnijf3PxcBz Dna+YVfuisbnGY9Br0pcSMpmQlSbcbZ2RB3ZSUEvRiUhnicvZfsAUqu6aY/LmGVB eSAFp3Fuzh/dQQrNvrBzsjW8X+q5IbhGjZGMdYIUxueROSX7WhMwKO6t9E8NRevU r0UBK0FsZh77mw== X-ME-Sender: From: "Tobin C. Harding" To: kernel-hardening@lists.openwall.com Cc: "Tobin C. Harding" , "Jason A. Donenfeld" , Theodore Ts'o , Linus Torvalds , 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 , linux-kernel@vger.kernel.org Date: Wed, 1 Nov 2017 15:32:22 +1100 Message-Id: <1509510743-28429-2-git-send-email-me@tobin.cc> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1509510743-28429-1-git-send-email-me@tobin.cc> References: <1509510743-28429-1-git-send-email-me@tobin.cc> Subject: [kernel-hardening] [PATCH V10 1/2] kasan: use %pK to print addresses instead of %p X-Virus-Scanned: ClamAV using ClamSMTP In preparation for hashing addresses printed using %p. We need the actual address for error reporting in kasan. Use %pK 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..ad042f025a1a 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 %pK 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 %pK\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 [%pK, %pK)\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) ? ">%pK: " : " %pK: ", kaddr); /* * We should not pass a shadow pointer to generic * function, because generic functions may try to