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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 59E7CC43334 for ; Thu, 16 Jun 2022 09:34:26 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 643146B0074; Thu, 16 Jun 2022 05:34:25 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5F3916B0075; Thu, 16 Jun 2022 05:34:25 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4BAC76B0078; Thu, 16 Jun 2022 05:34:25 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 39F9B6B0074 for ; Thu, 16 Jun 2022 05:34:25 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 06CCD15F0 for ; Thu, 16 Jun 2022 09:34:25 +0000 (UTC) X-FDA: 79583588490.08.2AF016D Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) by imf31.hostedemail.com (Postfix) with ESMTP id AD46F200A2 for ; Thu, 16 Jun 2022 09:34:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=IdZ9P0l3nWpjnGWfPtV/wrhTZhkFfoKTiNu/6UnWni0=; b=fAcBemFJ7ryTficeed5VZ9Jies 0ciz1gmqVePqskvIT3SgaefkW/Tf3MIFMs5+fxas/pO/UXtRlVmhZ71/FH2IY3fVfhc8lV9wzfr+t /LtmfqmTxv+nOFdrGlGxft9R5UlTDun/khkDqHUSSrDwGdUFf5/lXZptbpuYJlr2i7DzxAMHmeCXK 8/nANe3fC4f5dPpodu6ywHHI+6dEdtF+fmDfNhQapYVjwqDhZaYMoIktL7Egy9ZF/XDFcoORRnaYw ZjTr211tJ5xEoX8oBMVZ0IqvydeMCRRjpccJ2B5Iq48UbkcMGUl9dz+cTEePasjpARYGgYne/P6Vs ASrAgY8Q==; Received: from dhcp-077-249-017-003.chello.nl ([77.249.17.3] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1o1ltH-008Nd0-Da; Thu, 16 Jun 2022 09:34:15 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 0DA9E30008D; Thu, 16 Jun 2022 11:34:15 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id E6F3B2014ABD6; Thu, 16 Jun 2022 11:34:14 +0200 (CEST) Date: Thu, 16 Jun 2022 11:34:14 +0200 From: Peter Zijlstra To: "Edgecombe, Rick P" Cc: "kirill.shutemov@linux.intel.com" , "Lutomirski, Andy" , "dave.hansen@linux.intel.com" , "linux-kernel@vger.kernel.org" , "hjl.tools@gmail.com" , "linux-mm@kvack.org" , "kcc@google.com" , "andreyknvl@gmail.com" , "ak@linux.intel.com" , "dvyukov@google.com" , "x86@kernel.org" , "ryabinin.a.a@gmail.com" , "glider@google.com" Subject: Re: [PATCHv3 5/8] x86/uaccess: Provide untagged_addr() and remove tags before address check Message-ID: References: <20220610143527.22974-1-kirill.shutemov@linux.intel.com> <20220610143527.22974-6-kirill.shutemov@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1655372064; a=rsa-sha256; cv=none; b=Ogp1KYT33ZETs2XT8TPFW7kXQ+3mHcKE5SoZ6vBk9f9c2LKhAge4Lw4db33s4gD23YRd6C 2FbY8EFOmcHQEY0mdvpdzRDNWiQ1Te4XFDJG4h4RhMwaEOi32atKzbDfWqun1OsQEIglTy s6J3rLmFdQn9Bc2wgYFcsZv1xgjQdWo= ARC-Authentication-Results: i=1; imf31.hostedemail.com; dkim=pass header.d=infradead.org header.s=desiato.20200630 header.b=fAcBemFJ; dmarc=none; spf=none (imf31.hostedemail.com: domain of peterz@infradead.org has no SPF policy when checking 90.155.92.199) smtp.mailfrom=peterz@infradead.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1655372064; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=IdZ9P0l3nWpjnGWfPtV/wrhTZhkFfoKTiNu/6UnWni0=; b=oa2wj95+yrs9w9ZAyBiUxsUUNDKEYot2Z+Dyp3PK90euRGxHHarJnDrjSpzJKqXzng+AJK MyjFS8RC9Uv551XanyS6Qb9EbxFg0kj4TaAOzkVYRL75qGk3Nu5oXtcnh2/TbQ0YwyWH4V CROvl9jJsK1PQroyPxgM52WZz0if1FM= X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: AD46F200A2 X-Stat-Signature: jwg9wh1kh1de7od9xkhpuo8chy37rzhs Authentication-Results: imf31.hostedemail.com; dkim=pass header.d=infradead.org header.s=desiato.20200630 header.b=fAcBemFJ; dmarc=none; spf=none (imf31.hostedemail.com: domain of peterz@infradead.org has no SPF policy when checking 90.155.92.199) smtp.mailfrom=peterz@infradead.org X-Rspam-User: X-HE-Tag: 1655372064-579264 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 Mon, Jun 13, 2022 at 05:36:43PM +0000, Edgecombe, Rick P wrote: > Is this special kernel address handling only needed because > copy_to_kernel_nofault(), etc call the user helpers? It is to make absolutely sure we don't need to go audit everything, if code is correct without untag_pointer() it will still be correct with it on. Also avoids future bugs due to being robust in general.