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=-1.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no 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 BC9B4C433DF for ; Fri, 22 May 2020 00:22:19 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7A8732072C for ; Fri, 22 May 2020 00:22:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="CoNgODwu" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7A8732072C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 0BFA080008; Thu, 21 May 2020 20:22:19 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 06FF480007; Thu, 21 May 2020 20:22:19 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E9FAB80008; Thu, 21 May 2020 20:22:18 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0075.hostedemail.com [216.40.44.75]) by kanga.kvack.org (Postfix) with ESMTP id D171380007 for ; Thu, 21 May 2020 20:22:18 -0400 (EDT) Received: from smtpin09.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 907AD82499A8 for ; Fri, 22 May 2020 00:22:18 +0000 (UTC) X-FDA: 76842453156.09.cats49_88893d75e3333 X-HE-Tag: cats49_88893d75e3333 X-Filterd-Recvd-Size: 3141 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf31.hostedemail.com (Postfix) with ESMTP for ; Fri, 22 May 2020 00:22:18 +0000 (UTC) Received: from devnote2 (NE2965lan1.rev.em-net.ne.jp [210.141.244.193]) (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 4BF7A20825; Fri, 22 May 2020 00:22:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1590106937; bh=UQBu9s+09ZRXhgbAFPY56Fnwnv0wKwGiaFArpYa/goQ=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=CoNgODwuHX4WaU/4wf7BBMTIy5y5apCsVJb/nk5LzA7PjS9dtkTxf+x23sRxmB19K Nm8y7bAP+SetbndPW4bAnJO6ogntIKnO13z394/LWPcP8zcpAQ28nfqnNTM4OIhfYc Z2D014SfbcQR1RDa6rypeFF5ViJGPZWCWIeNXLME= Date: Fri, 22 May 2020 09:22:11 +0900 From: Masami Hiramatsu To: Christoph Hellwig Cc: x86@kernel.org, Alexei Starovoitov , Daniel Borkmann , Linus Torvalds , Andrew Morton , linux-parisc@vger.kernel.org, linux-um@lists.infradead.org, netdev@vger.kernel.org, bpf@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: clean up and streamline probe_kernel_* and friends v4 Message-Id: <20200522092211.dd45d126b7598c4bf2182859@kernel.org> In-Reply-To: <20200521152301.2587579-1-hch@lst.de> References: <20200521152301.2587579-1-hch@lst.de> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, 21 May 2020 17:22:38 +0200 Christoph Hellwig wrote: > Hi all, > > this series start cleaning up the safe kernel and user memory probing > helpers in mm/maccess.c, and then allows architectures to implement > the kernel probing without overriding the address space limit and > temporarily allowing access to user memory. It then switches x86 > over to this new mechanism by reusing the unsafe_* uaccess logic. > > This version also switches to the saner copy_{from,to}_kernel_nofault > naming suggested by Linus. > > I kept the x86 helpers as-is without calling unsage_{get,put}_user as > that avoids a number of hard to trace casts, and it will still work > with the asm-goto based version easily. > > Changes since v3: > - cleanup how bpf and trace_kprobe perform the TASK_SIZE checks > - remove the unused dst argument to probe_kernel_read_allowed > - document the -ERANGE return value This series looks good to me. Reviewed-by: Masami Hiramatsu for this series. Thank you! > > Changes since v2: > - rebased on 5.7-rc6 with the bpf trace format string changes > - rename arch_kernel_read to __get_kernel_nofault and arch_kernel_write > to __put_kernel_nofault > - clean up the tracers to only allowd "mixed" reads when the kernel > has non-overlapping address spaces -- Masami Hiramatsu