From patchwork Fri Feb 21 07:41:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 230693 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A4DD1C35640 for ; Fri, 21 Feb 2020 08:40:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 733DF2073A for ; Fri, 21 Feb 2020 08:40:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582274422; bh=4aonCssWYdstuScFHWHex3lRsbsWzswOK1XgUJWXPzA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=cdYs3HggH+XriQpRwXDmQZoRN7outcAhleeqAtmsbbiNoAv6QX7o2t4WU1PAFBY0c DEkkY1x7XRAZnXXNO1aeaKurHrdbyhM8mUj19AEHVwNtxdt07Kue9rHcieRdla/giL X37Zo0gppQwzd+rb86GbILI7pGPM4/xzu9Zu94QE= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730591AbgBUH7Q (ORCPT ); Fri, 21 Feb 2020 02:59:16 -0500 Received: from mail.kernel.org ([198.145.29.99]:59272 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730873AbgBUH7P (ORCPT ); Fri, 21 Feb 2020 02:59:15 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2D2D620578; Fri, 21 Feb 2020 07:59:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582271954; bh=4aonCssWYdstuScFHWHex3lRsbsWzswOK1XgUJWXPzA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rbo4wvdplNdLmL2j4FBc9dRTw22rFDm215JViWFT2pZgC++s01wVYgwaKsJNaICsk rjJXEcNZadCo9Qr5wxRk0hcbbs/s3tKwinu/qpGr1FNNlBOeCHL78V2A0kuIXheCzx 5c/lTX6fR1+tb8YhPwDIh0Dr5dI81MCAJO6umYf0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christophe Leroy , Michael Ellerman , Sasha Levin Subject: [PATCH 5.5 354/399] powerpc/mm: Dont log user reads to 0xffffffff Date: Fri, 21 Feb 2020 08:41:19 +0100 Message-Id: <20200221072435.333365196@linuxfoundation.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200221072402.315346745@linuxfoundation.org> References: <20200221072402.315346745@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Christophe Leroy [ Upstream commit 0f9aee0cb9da7db7d96f63cfa2dc5e4f1bffeb87 ] Running vdsotest leaves many times the following log: [ 79.629901] vdsotest[396]: User access of kernel address (ffffffff) - exploit attempt? (uid: 0) A pointer set to (-1) is likely a programming error similar to a NULL pointer and is not worth logging as an exploit attempt. Don't log user accesses to 0xffffffff. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/0728849e826ba16f1fbd6fa7f5c6cc87bd64e097.1577087627.git.christophe.leroy@c-s.fr Signed-off-by: Sasha Levin --- arch/powerpc/mm/fault.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/powerpc/mm/fault.c b/arch/powerpc/mm/fault.c index 1baeb045f7f4b..e083a9f67f701 100644 --- a/arch/powerpc/mm/fault.c +++ b/arch/powerpc/mm/fault.c @@ -354,6 +354,9 @@ static void sanity_check_fault(bool is_write, bool is_user, * Userspace trying to access kernel address, we get PROTFAULT for that. */ if (is_user && address >= TASK_SIZE) { + if ((long)address == -1) + return; + pr_crit_ratelimited("%s[%d]: User access of kernel address (%lx) - exploit attempt? (uid: %d)\n", current->comm, current->pid, address, from_kuid(&init_user_ns, current_uid()));