From patchwork Thu Jan 11 02:02:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 10156473 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 8FC07605BA for ; Thu, 11 Jan 2018 02:04:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 80058286DF for ; Thu, 11 Jan 2018 02:04:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 73FE7286E2; Thu, 11 Jan 2018 02:04:56 +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 9B53C286DF for ; Thu, 11 Jan 2018 02:04:55 +0000 (UTC) Received: (qmail 30105 invoked by uid 550); 11 Jan 2018 02:03:43 -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 30018 invoked from network); 11 Jan 2018 02:03:40 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=rce/8yLxCDvKGLUc4g1e41q5D0vc20s6LbKhcE+fd7Y=; b=JvYnbqjaeSO5zNaY23ENl4aUk83MCR/W4LhM2s3jL2dka6kn0fDcAYKK6WVgXhJziH KxbzGJkjnjeQ3S7Fu04yhta8BYm3eQElv2KiAjU6PRtQIfuGmez9WfuXLmd+ssJve3xu zaj5HRB7umlWmpgnaI5tki5E8Amd0ndjDnMH0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=rce/8yLxCDvKGLUc4g1e41q5D0vc20s6LbKhcE+fd7Y=; b=iph+jpLPfaof1mGz8WzargilpDJFYW4RFLkZAGiBzEETiEMhpSySc+2IE8E6wa1Dtf uXfcEp+1uLXDEQWLSTvxS2ZatWNfKf/r1cl1mbvEYAaFJb0gh+01/3XjgtsZciHAufdc 1AZzgPKwPCnpt9YOVMTK1R9J57gFuMjeP1zUN91H/l/MC4Wl4NsiE70wV39yZKINZNFu UBo3yl77k9/KJJHnVbUyf4XC+U0+AmR0EkAYrgmgOyjzAcIgqfd4esk9jsu1JQYhHD97 z7EMefWdtu/qlKThrQbFqt9wOmAUfxtw/Xe0mooAVw7DGAcbGldJ+WSuH5AVvfBz59y+ iTqQ== X-Gm-Message-State: AKGB3mJCjdcZ1uvBaW9s9DNwEix/EdbfjupgFrRWkFCi18+ZGvSTpuIG 2IMcrDLCuwNGxbifPdx9SrgPTA== X-Google-Smtp-Source: ACJfBosaSzAMKlKkPkXhPZsFOod+LN0lvUFqZoYKeJwJSKgvBnU+4IOly2LW6zopWF8WemgoSZ79nA== X-Received: by 10.84.253.143 with SMTP id a15mr20920980plm.283.1515636201215; Wed, 10 Jan 2018 18:03:21 -0800 (PST) From: Kees Cook To: linux-kernel@vger.kernel.org Cc: Kees Cook , Linus Torvalds , David Windsor , Alexander Viro , Andrew Morton , Andy Lutomirski , Christoph Hellwig , Christoph Lameter , "David S. Miller" , Laura Abbott , Mark Rutland , "Martin K. Petersen" , Paolo Bonzini , Christian Borntraeger , Christoffer Dall , Dave Kleikamp , Jan Kara , Luis de Bethencourt , Marc Zyngier , Rik van Riel , Matthew Garrett , linux-fsdevel@vger.kernel.org, linux-arch@vger.kernel.org, netdev@vger.kernel.org, linux-mm@kvack.org, kernel-hardening@lists.openwall.com Date: Wed, 10 Jan 2018 18:02:33 -0800 Message-Id: <1515636190-24061-2-git-send-email-keescook@chromium.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1515636190-24061-1-git-send-email-keescook@chromium.org> References: <1515636190-24061-1-git-send-email-keescook@chromium.org> Subject: [kernel-hardening] [PATCH 01/38] usercopy: Remove pointer from overflow report X-Virus-Scanned: ClamAV using ClamSMTP Using %p was already mostly useless in the usercopy overflow reports, so this removes it entirely to avoid confusion now that %p-hashing is enabled. Fixes: ad67b74d2469d9b8 ("printk: hash addresses printed with %p") Signed-off-by: Kees Cook --- mm/usercopy.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/mm/usercopy.c b/mm/usercopy.c index a9852b24715d..5df1e68d4585 100644 --- a/mm/usercopy.c +++ b/mm/usercopy.c @@ -58,12 +58,11 @@ static noinline int check_stack_object(const void *obj, unsigned long len) return GOOD_STACK; } -static void report_usercopy(const void *ptr, unsigned long len, - bool to_user, const char *type) +static void report_usercopy(unsigned long len, bool to_user, const char *type) { - pr_emerg("kernel memory %s attempt detected %s %p (%s) (%lu bytes)\n", + pr_emerg("kernel memory %s attempt detected %s '%s' (%lu bytes)\n", to_user ? "exposure" : "overwrite", - to_user ? "from" : "to", ptr, type ? : "unknown", len); + to_user ? "from" : "to", type ? : "unknown", len); /* * For greater effect, it would be nice to do do_group_exit(), * but BUG() actually hooks all the lock-breaking and per-arch @@ -261,6 +260,6 @@ void __check_object_size(const void *ptr, unsigned long n, bool to_user) return; report: - report_usercopy(ptr, n, to_user, err); + report_usercopy(n, to_user, err); } EXPORT_SYMBOL(__check_object_size);