From patchwork Fri Feb 21 07:41:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 230797 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, 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 62636C35642 for ; Fri, 21 Feb 2020 08:31:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2B1EC20637 for ; Fri, 21 Feb 2020 08:31:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582273874; bh=H01V1yAvGUnL110QyGxoWUFcprdk0MX1LGVD14UnwEQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=i57U2BI2NieaTmKFs/lT2kclIWQxM7LRb8tcrPVIVjTaqWrUf9OZSTlmKFOgjxJyM /fi7ZdLNgHPPx7pJmtLy+U9WdtXre+u4eSa/aDhueQe6V7r/2MRtQe7d/MBKRJU8Hf EGe2FcwFCIpich+b+13HE62qzcFlxevsZsqwFtvU= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732548AbgBUIOa (ORCPT ); Fri, 21 Feb 2020 03:14:30 -0500 Received: from mail.kernel.org ([198.145.29.99]:50972 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732511AbgBUIO3 (ORCPT ); Fri, 21 Feb 2020 03:14:29 -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 4D68C24670; Fri, 21 Feb 2020 08:14:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582272868; bh=H01V1yAvGUnL110QyGxoWUFcprdk0MX1LGVD14UnwEQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FJxtnFwOUHB4V4lLQGIc+r7VwKy/5LNNjIzcIzZ6GOqd6oUpXkWfYcJwFkoGgNEXV 0ePOEJuBFi+QXQQ4Psr6p84bOho1ACiILs23uVq1HKxSk+v/Aubh8lJXFSYFRPCbhn eDN1k1XtTG5ujbOOrCEZNpuvso60vCWAKNlZfKV4= 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.4 306/344] powerpc/mm: Dont log user reads to 0xffffffff Date: Fri, 21 Feb 2020 08:41:45 +0100 Message-Id: <20200221072417.741880131@linuxfoundation.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200221072349.335551332@linuxfoundation.org> References: <20200221072349.335551332@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 9298905cfe74f..881a026a603a6 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()));