Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1852148ybk; Thu, 21 May 2020 17:25:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwXz9fjHJiihedi4pH1mRu1NSHFVfB4UEdorNkUjFe1olzsHR4OVFGjaSZCCkZxuIeR4V84 X-Received: by 2002:a50:a693:: with SMTP id e19mr1027225edc.275.1590107147069; Thu, 21 May 2020 17:25:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590107147; cv=none; d=google.com; s=arc-20160816; b=kCUsUZ9vKFeqjhRMf0YchQOfd/sW3eVuPVMMwUG1nIh4G4qKXIq31PcrYUVAsWL+VB nv7Ay4xf2YWC5LMynpGyfHJ+OgLXtNwECegYGSpUjnyXZhTzwCOpl8ZJNTLcx7i0jG8e +WPPOMrFzXfFAH6N7T+jwOvoG6aMychdnz2ET5/x9eckI6SIiMR0C4rWtoOCXzGaC621 LX2jTKG5YBhvkR2bvsUOIELrMqs+/qDiAE/+nOImshZfXt7lehfZxJamunpObGKOEBCG JQYzYcFX+vdCl25oWxskr+IOtecETU9769iShTa2ldGA0CYKIK75LzyRQLM7N5pH7fyj V6Cw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=pZvGxoNaLJQXIpB0y8nBADKASdAjpF/6Gux1zmTlkek=; b=VL/FsfqQPzDVgMFHvZySlmLyjw29W4iepStSB1w/bn0Pdjhm786gHDKPcPe93wu/Ga t1dFlnRSdDIw4wT1A6TS/jgShFnx7TIi1Txq7qtaL/74DJsCuDLDlgm1eFR7WnHS2nXv f4HXsMlHnTrK64FhHybKTiQkyyDEaWp32ccVb4LEb88N4MyXuPC2rRbTuc9X7hQ/u0WI APxHvizW0Svm96iTWjbFNW3M7JSdNwCQfTYxXHq2LkEhvOzLkT7+OMtNIiGS74sTRu8/ TDRU0P9zXjhfYoVif+NLIJT4x40Kj7buGaJHKrrqY2yZXmXxN/y+BAwh6fofISWUY60N 8gsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=CoNgODwu; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a17si4231063eje.506.2020.05.21.17.25.22; Thu, 21 May 2020 17:25:47 -0700 (PDT) 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; dkim=pass header.i=@kernel.org header.s=default header.b=CoNgODwu; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726857AbgEVAWS (ORCPT + 99 others); Thu, 21 May 2020 20:22:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:35626 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726693AbgEVAWS (ORCPT ); Thu, 21 May 2020 20:22:18 -0400 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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