From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on archive.lwn.net X-Spam-Level: X-Spam-Status: No, score=-5.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham autolearn_force=no version=3.4.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by archive.lwn.net (Postfix) with ESMTP id 288467DE74 for ; Tue, 8 May 2018 15:11:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754554AbeEHPLq (ORCPT ); Tue, 8 May 2018 11:11:46 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:59692 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752575AbeEHPLp (ORCPT ); Tue, 8 May 2018 11:11:45 -0400 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 56E3980D; Tue, 8 May 2018 08:11:45 -0700 (PDT) Received: from armageddon.cambridge.arm.com (armageddon.cambridge.arm.com [10.1.206.84]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A6A753F58C; Tue, 8 May 2018 08:11:40 -0700 (PDT) Date: Tue, 8 May 2018 16:11:38 +0100 From: Catalin Marinas To: Andrey Konovalov Cc: "Kirill A. Shutemov" , Mark Rutland , Kate Stewart , linux-doc@vger.kernel.org, Will Deacon , Linux Memory Management List , Ingo Molnar , Jacob Bramley , Jonathan Corbet , Dmitry Vyukov , Bart Van Assche , Ramana Radhakrishnan , Evgeniy Stepanov , Kees Cook , Ruben Ayrapetyan , Lee Smith , Dan Williams , Robin Murphy , Al Viro , Thomas Gleixner , Linux ARM , Kostya Serebryany , Greg Kroah-Hartman , LKML , James Morse , "Aneesh Kumar K . V" , Philippe Ombredanne , Andrew Morton , Zi Yan Subject: Re: [PATCH 4/6] mm, arm64: untag user addresses in mm/gup.c Message-ID: <20180508151137.zguepljs3pa7xv5g@armageddon.cambridge.arm.com> References: <0db34d04fa16be162336106e3b4a94f3dacc0af4.1524077494.git.andreyknvl@google.com> <20180426174714.4jtb72q56w3xonsa@armageddon.cambridge.arm.com> <20180502153645.fui4ju3scsze3zkq@black.fi.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-doc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-doc@vger.kernel.org On Wed, May 02, 2018 at 07:25:17PM +0200, Andrey Konovalov wrote: > On Wed, May 2, 2018 at 5:36 PM, Kirill A. Shutemov > wrote: > > On Wed, May 02, 2018 at 02:38:42PM +0000, Andrey Konovalov wrote: > >> > Does having a tagged address here makes any difference? I couldn't hit a > >> > failure with my simple tests (LD_PRELOAD a library that randomly adds > >> > tags to pointers returned by malloc). > >> > >> I think you're right, follow_page_mask is only called from > >> __get_user_pages, which already untagged the address. I'll remove > >> untagging here. > > > > It also called from follow_page(). Have you covered all its callers? > > Oh, missed that, will take a look. > > Thinking about that, would it make sense to add untagging to find_vma > (and others) instead of trying to cover all find_vma callers? I don't think adding the untagging to find_vma() is sufficient. In many cases the caller does a subsequent check like 'start < vma->vm_start' (see sys_msync() as an example, there are a few others as well). What I did in my tests was a WARN_ON_ONCE() in find_vma() if the address is tagged. -- Catalin -- To unsubscribe from this list: send the line "unsubscribe linux-doc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html