Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp4204441pxu; Mon, 30 Nov 2020 21:45:26 -0800 (PST) X-Google-Smtp-Source: ABdhPJyQI7p/CT91BOoj6sPihgZxws8P1WZlgZEQwXPRwbJIZq+/oysVJGuLCBrmgMs22eqBsyhV X-Received: by 2002:a17:906:2e82:: with SMTP id o2mr1510207eji.106.1606801526043; Mon, 30 Nov 2020 21:45:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606801526; cv=none; d=google.com; s=arc-20160816; b=zoQTuczXRNjdwrwbh1gecO5QW+nQ0DadN1E8uToSruXj136bcGxM3m3/Mm37OswuHs 63TqO3Bw75RVj5SyOjCHPiKrpXZh+Y0dIp/uZ56V+who9Ile1J/AijQELW9U9I1/4apV avWgysZoCXaJH6H62Idbn2XKzjowCw4syBL8UrRtqCAbPcJijBhxezoGy1NE20+gCMG+ DqoctrHtZF9LXGdskSXox6ES4jhMGQR7ruZWYkNz7qI4RXzu+xdZ6ySJrR6s8ruRViVo M6V8Wc9VRM6qEDC0fuaacek85NnKWupkN+ASStM+re99d8i/qgcCyqQPClUlvkxBJmW3 3NyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=ceHlRmC1uFpOozjahCXSrcOZDT8MWUveT2UPqdW2kpg=; b=hNjzLYj+o9N/qbeyMUc1bXull0ZSr2kLYQqcbW/cqnk1sDSR+pKPgdl1iAOyGYe0m3 1OkafeqwHw/29rEaDnFyQoWLXwR+h4etbbgPz/Ux/dhxwD9igNSoF/U3QHAuvLyCaw29 3lNPrMKS4oGEdW0rmx2OpPHaQRbNqe+piKkIrexaWEJalaJwllz8hXf/246WEnUwhEP5 sq/yoR3xLUat62L3cRC8y1Xt+Cx53spWFKk0L/aYRbvw5Oge5UeQtx2l+fF4FIyxP9pt jkOa00QE8INVtiolwW5dgzOFedDbk3irTlvmlzyshsIf0QZmqnS55DwAjjTy3mNLwQac JJmw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id oc24si293149ejb.367.2020.11.30.21.45.04; Mon, 30 Nov 2020 21:45:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726832AbgLAFVr (ORCPT + 99 others); Tue, 1 Dec 2020 00:21:47 -0500 Received: from atcsqr.andestech.com ([60.248.187.195]:11329 "EHLO ATCSQR.andestech.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726083AbgLAFVr (ORCPT ); Tue, 1 Dec 2020 00:21:47 -0500 Received: from mail.andestech.com (atcpcs16.andestech.com [10.0.1.222]) by ATCSQR.andestech.com with ESMTP id 0B15LHZx079928; Tue, 1 Dec 2020 13:21:17 +0800 (GMT-8) (envelope-from tesheng@andestech.com) Received: from atcfdc88 (10.0.15.120) by ATCPCS16.andestech.com (10.0.1.222) with Microsoft SMTP Server id 14.3.487.0; Tue, 1 Dec 2020 13:20:55 +0800 Date: Tue, 1 Dec 2020 13:20:49 +0800 From: Eric Lin To: Christoph Hellwig CC: "linux-kernel@vger.kernel.org" , "linux-riscv@lists.infradead.org" , "walken@google.com" , "daniel.m.jordan@oracle.com" , "peterx@redhat.com" , "akpm@linux-foundation.org" , "penberg@kernel.org" , "aou@eecs.berkeley.edu" , "palmer@dabbelt.com" , "paul.walmsley@sifive.com" , "dslin1010@gmail.com" , "Alan Quey-Liang Kao(?????})" Subject: Re: [PATCH] riscv/mm: Prevent kernel module access user-space memory without uaccess routines Message-ID: <20201201052048.GA7647@atcfdc88> References: <20201130053037.27006-1-tesheng@andestech.com> <20201130083015.GA14676@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20201130083015.GA14676@infradead.org> User-Agent: Mutt/1.9.4 (2018-02-28) X-Originating-IP: [10.0.15.120] X-DNSRBL: X-MAIL: ATCSQR.andestech.com 0B15LHZx079928 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 30, 2020 at 04:30:15PM +0800, Christoph Hellwig wrote: Hi Christoph, > > + if (!user_mode(regs) && addr < TASK_SIZE && unlikely(!(regs->status & SR_SUM))) > > Please avoid the overly long line. OK, I'll modify it in v2. Thanks for your review.