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=-10.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 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 1168FC433E6 for ; Mon, 1 Feb 2021 13:21:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C2F9664E2A for ; Mon, 1 Feb 2021 13:21:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232143AbhBANVc (ORCPT ); Mon, 1 Feb 2021 08:21:32 -0500 Received: from imap3.hz.codethink.co.uk ([176.9.8.87]:47902 "EHLO imap3.hz.codethink.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232033AbhBANTk (ORCPT ); Mon, 1 Feb 2021 08:19:40 -0500 Received: from cpc79921-stkp12-2-0-cust288.10-2.cable.virginm.net ([86.16.139.33] helo=[192.168.0.18]) by imap3.hz.codethink.co.uk with esmtpsa (Exim 4.92 #3 (Debian)) id 1l6Z6E-0003lO-2b; Mon, 01 Feb 2021 13:18:38 +0000 Subject: Re: [PATCH v3 0/2] Let illegal access to user-space memory die To: Palmer Dabbelt , tesheng@andestech.com Cc: aou@eecs.berkeley.edu, linux-kernel@vger.kernel.org, peterx@redhat.com, penberg@kernel.org, Paul Walmsley , akpm@linux-foundation.org, walken@google.com, linux-riscv@lists.infradead.org, vbabka@suse.cz References: From: Ben Dooks Organization: Codethink Limited. Message-ID: Date: Mon, 1 Feb 2021 13:18:36 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 22/12/2020 02:35, Palmer Dabbelt wrote: > On Thu, 03 Dec 2020 21:42:57 PST (-0800), tesheng@andestech.com wrote: >> Accesses to user-space memory without calling uaccess routine >> leads to hanging in page fault handler. Like arm64, we let it >> die earlier in page fault handler. >> >> Changes in v3: >>     -Let no_context() use die_kernel_fault() helper >> >> Changes in v2: >>     -Add a die_kernel_fault() helper >>     -Split one long line code into two >> >> Eric Lin (2): >>   riscv/mm: Introduce a die_kernel_fault() helper function >>   riscv/mm: Prevent kernel module to access user memory without uaccess >>     routines >> >>  arch/riscv/mm/fault.c | 28 ++++++++++++++++++++++------ >>  1 file changed, 22 insertions(+), 6 deletions(-) > > Thanks, these will be on for-next when the merge window ends. Just tested this and it seems to be working. -- Ben Dooks http://www.codethink.co.uk/ Senior Engineer Codethink - Providing Genius https://www.codethink.co.uk/privacy.html