Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp642106imb; Fri, 1 Mar 2019 10:00:41 -0800 (PST) X-Google-Smtp-Source: APXvYqwcWbBUobzQmKNMfSUTNjrcP/joJujT+quqUtEV2wuFsodpH3ACafX5vdqgjxMafgrlwDB6 X-Received: by 2002:a62:458a:: with SMTP id n10mr7010011pfi.136.1551463240972; Fri, 01 Mar 2019 10:00:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551463240; cv=none; d=google.com; s=arc-20160816; b=I845hbdsv9rO8DjsaEwx/TdeikX2LuAvU3Sxks9NfoeRJ9jSxCZS1QUc2b3KKOdiMR yrZ0lPcMAQ+/SiztwlLG5C9Eb4FrfBl8rveEkfCRQLM2cAarA+hkFML0E17QVUEy/3og M9DiwqAmqkw/Rer2WJIEU+v7Vo8hD+Ua04JVOze21Jr2x+TmOEcenRPWhNlVLe864yRh xVrVIKFX2haslRZ2XZ1JZ25E1W99liBPY3Y8vuqsl5r/yZmfRwk6gpzC4zQUNjW997Jc 95plhrooZgGFiybvKDCRyN9Q2xAtzTgu26tZScMYihWaYUfjeDoCVTv9MKvaNCrtnqGd RuTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=FOUGz1ICVnNqYtnbV0Q7jJXXd1UcUGnj1080uMWB6yo=; b=GVfOc1fIFTMZqAuWWIHSoXyL7SPWCaUZsxhUFME76KTdpDPekwZZ/5DjSjJ/DJ8atU x1a6IdjGmxZDbbrjkbG+BATYNFMICRgeonOn82D+ZuWTfZUlAuNURD9Se65bD/3e48pz vf9PefEG8AZ9rVy6Yoz10nod8H5kwqlpsk06zzMLeFeRsZe4CSAVaJURAW23LI5nE0/E EmRas92tg5OJl9Df8jn0LAnChuDycHAEfWWlIZuBCt8WnTh2kwX5SeixgVh5TOOwTPn/ e7EVCKpkrudN1hwspcvfxkVYwbgNzR/J7+WOS1K3Lb/F5OIkh+B6K67QynjvoVcyT3dY l3mA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i10si7976607pgs.572.2019.03.01.10.00.25; Fri, 01 Mar 2019 10:00:40 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389269AbfCAQ7Q (ORCPT + 99 others); Fri, 1 Mar 2019 11:59:16 -0500 Received: from foss.arm.com ([217.140.101.70]:39128 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389170AbfCAQ7Q (ORCPT ); Fri, 1 Mar 2019 11:59:16 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id D6B7080D; Fri, 1 Mar 2019 08:59:15 -0800 (PST) Received: from arrakis.emea.arm.com (arrakis.cambridge.arm.com [10.1.196.78]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 0CD8F3F575; Fri, 1 Mar 2019 08:59:10 -0800 (PST) Date: Fri, 1 Mar 2019 16:59:08 +0000 From: Catalin Marinas To: Andrey Konovalov Cc: Dave Hansen , Will Deacon , Mark Rutland , Robin Murphy , Kees Cook , Kate Stewart , Greg Kroah-Hartman , Andrew Morton , Ingo Molnar , "Kirill A . Shutemov" , Shuah Khan , Vincenzo Frascino , Linux ARM , "open list:DOCUMENTATION" , Linux Memory Management List , linux-arch , "open list:KERNEL SELFTEST FRAMEWORK" , LKML , Dmitry Vyukov , Kostya Serebryany , Evgeniy Stepanov , Lee Smith , Ramana Radhakrishnan , Jacob Bramley , Ruben Ayrapetyan , Chintan Pandya , Luc Van Oostenryck , Dave Martin , Kevin Brodsky , Szabolcs Nagy Subject: Re: [PATCH v10 07/12] fs, arm64: untag user pointers in fs/userfaultfd.c Message-ID: <20190301165908.GA130541@arrakis.emea.arm.com> References: <8343cd77ca301df15839796f3b446b75ce5ffbbf.1550839937.git.andreyknvl@google.com> <73f2f3fe-9a66-22a1-5aae-c282779a75f5@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 26, 2019 at 03:39:08PM +0100, Andrey Konovalov wrote: > On Sat, Feb 23, 2019 at 12:06 AM Dave Hansen wrote: > > > > On 2/22/19 4:53 AM, Andrey Konovalov wrote: > > > userfaultfd_register() and userfaultfd_unregister() use provided user > > > pointers for vma lookups, which can only by done with untagged pointers. > > > > So, we have to patch all these sites before the tagged values get to the > > point of hitting the vma lookup functions. Dumb question: Why don't we > > just patch the vma lookup functions themselves instead of all of these > > callers? > > That might be a working approach as well. We'll still need to fix up > places where the vma fields are accessed directly. Catalin, what do > you think? Most callers of find_vma*() always follow it by a check of vma->vma_start against some tagged address ('end' in the userfaultfd_(un)register()) case. So it's not sufficient to untag it in find_vma(). -- Catalin