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=-3.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT 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 B3748C433E2 for ; Tue, 19 May 2020 13:44:58 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7694D207FB for ; Tue, 19 May 2020 13:44:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="s5jGcOuF" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7694D207FB Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 26432900003; Tue, 19 May 2020 09:44:57 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 21450900002; Tue, 19 May 2020 09:44:57 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 104F9900003; Tue, 19 May 2020 09:44:57 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0026.hostedemail.com [216.40.44.26]) by kanga.kvack.org (Postfix) with ESMTP id E981A900002 for ; Tue, 19 May 2020 09:44:56 -0400 (EDT) Received: from smtpin15.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id AE2BC4826 for ; Tue, 19 May 2020 13:44:56 +0000 (UTC) X-FDA: 76833589392.15.drain02_826e783954c26 X-HE-Tag: drain02_826e783954c26 X-Filterd-Recvd-Size: 2832 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf19.hostedemail.com (Postfix) with ESMTP for ; Tue, 19 May 2020 13:44:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: MIME-Version:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:In-Reply-To:References; bh=VA+rkbbJ9Gdu2pIdIJCd0hxkxzOrtfH9/4cfURE97w4=; b=s5jGcOuFcMqXXsAcexu5WkkZpW SqMchNqCMYatHho2iD6t0yuHPPsnOU7ddh0uHbCBrRC1iUo6xwomnsizcFL8lqJCbsH762aqgv9f1 M3UX75xgLM/hLHthh07qF4USOtDaNRjvSnclU4YUozuiTb8LWYOEgjMlNNXPhMl5uBUDJ/VaVA6ju ZYOmK5YEdFlIf5whS9gHwr3RdmlbwgpmqhC40VmWGXUQmYyfNQUPBdsaCPh1TLNjxE1ub3Q8jgTGh VjQUwge2yc4VojVSjpq7694uk3yIBqjzpHN6/RQXB0KByEZY3OhQCrBzDRPhy3k9+ljWwoFcuXPml UbSLfoTA==; Received: from [2001:4bb8:188:1506:c70:4a89:bc61:2] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jb2Y7-0000zQ-W6; Tue, 19 May 2020 13:44:52 +0000 From: Christoph Hellwig To: x86@kernel.org, Alexei Starovoitov , Daniel Borkmann , Masami Hiramatsu , Linus Torvalds , Andrew Morton Cc: 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: clean up and streamline probe_kernel_* and friends v3 Date: Tue, 19 May 2020 15:44:29 +0200 Message-Id: <20200519134449.1466624-1-hch@lst.de> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Content-Transfer-Encoding: quoted-printable 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: 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 helprs 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 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