Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp636269ybk; Wed, 13 May 2020 09:05:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzLm1B3Ehmi6Dm4/buKDOIfYZO3RURafCtMdBFur5dnlS9Nx7/+4DEuTyDm9lkfOvlxQUkB X-Received: by 2002:aa7:cb4f:: with SMTP id w15mr317341edt.239.1589385942039; Wed, 13 May 2020 09:05:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589385942; cv=none; d=google.com; s=arc-20160816; b=mhrqzxKbwqXE6xzWP+AaXag+C1HTLFvv7GkrEqHLTz08JLiQW4fawkutPRga+S4w8N h5XU+L9lZVbjGcVv/ZjVEbR0Yd2uK6eZVoXh0YurNcHiny5rJo+1+7Gr5ToCBj+zjR+Y umvYp6RgfU3hK8uwbLQvP3SiZZhVbVIgcZvrJSvb81e80wba7lWx4aY6FaN1j6kE9E6T +jRn3tBN9vOwU0G9lUduKyPgGaHWkRorgsME7e2nlnetc9Z7Fec1fsqiGnBerixojneU Vkdmu2Qm4zCLf6sLgAMtybeeaIGCbFEnSChGy5SqI9ZkgMG1poe287uiOm2i9BLsCjiF K4MQ== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=MBXmzxvlvBp3urj1EfRdDjo/Nomb7enLOBCi4+LnpPQ=; b=FWl2WZAO1+9PB19mC+G0K9LPwxCrvUER2NK3i4XOYCnglTiTUpEdxaCCcQMVthSENs UzelzgDp5A/1SSo/ud8322LbV6fNs3bQrzQFQr75lkw0cOyBnLTJrK84WftkINn4qFtd di8PtyZTfV+EzWmAGPv1NHHmmC+U9FO7IQ2Hh1UrNkEAElaJlRwIrfIEkKaxVpV/UggJ C/HIwI2LVf/bmww+FAp8aM+ih5/FwIMrVFx1DEMjC5uwnvGIZe82jwskNtQIU4qVtQwU StF3mlCaW9uGNFmTEqrYr2AhVJlEaiR8OeR0hUJuLAYP3NsJ9teIkbr1fW0R2tMaYl1z fmqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b="Ib3n/68s"; 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 qp11si77080ejb.316.2020.05.13.09.05.19; Wed, 13 May 2020 09:05:42 -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=fail header.i=@infradead.org header.s=bombadil.20170209 header.b="Ib3n/68s"; 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 S2388837AbgEMQAo (ORCPT + 99 others); Wed, 13 May 2020 12:00:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50728 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729561AbgEMQAo (ORCPT ); Wed, 13 May 2020 12:00:44 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ECCC0C061A0C; Wed, 13 May 2020 09:00:43 -0700 (PDT) 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=MBXmzxvlvBp3urj1EfRdDjo/Nomb7enLOBCi4+LnpPQ=; b=Ib3n/68sFKiWSoHFw243qGtEKT uIMPw1Lc04Of4bpkSt7Yyoo0wEMWGWlEBGRZGg5YyY/J85MCuuRtD8Ut4Pn8dQ6rjt2FAKlGCj3sb EEPJaiqvvdNnys5f1elW1iOxmECbdFi3IJvzsq+A0h2GI5wayolWIt/6gvyUvcZ01/Szg72cbrPCN qNmqVuL9aiEVYBc2HDVNuCEJXxyCpm8znHdnG6ASXSUsHemRJz+fYGd/RxrRO30wHhzmQ+8ewNAa3 f6A+qvxSlwXvcBAMKYxwhnw2ERDv5CBYBSAprCzOe7Y+NJNQef3YEA4wJB2dhF3pa55P9f2f8xwIL Xthl7C4w==; Received: from [2001:4bb8:180:9d3f:c70:4a89:bc61:2] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jYtoF-0004fx-T9; Wed, 13 May 2020 16:00:41 +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 v2 Date: Wed, 13 May 2020 18:00:20 +0200 Message-Id: <20200513160038.2482415-1-hch@lst.de> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.