From mboxrd@z Thu Jan 1 00:00:00 1970 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=ham 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 41C96C35641 for ; Fri, 21 Feb 2020 08:14:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1579D24680 for ; Fri, 21 Feb 2020 08:14:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582272872; bh=H01V1yAvGUnL110QyGxoWUFcprdk0MX1LGVD14UnwEQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=pC/uhVqRfIzEx5m4RjTX03vQQJk8vedbmlU4ojeNJr37udHd8bdO8c+7P+LjraNMz F3FyTAzVDYn7PDPQHeHpUdv+jjKMSFE4CSefnh7KigC07eUiyiue7SUagJNBcAbfjE WaPNvOqU+D7HbyP9WRAKeI0YqKKzpZwmI7XT3uaQ= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733194AbgBUIOb (ORCPT ); Fri, 21 Feb 2020 03:14:31 -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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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())); -- 2.20.1