From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: ARC-Seal: i=1; a=rsa-sha256; t=1525356597; cv=none; d=google.com; s=arc-20160816; b=W/Kq2q3l+1T5KLxWtOUTliBbGN0aWDu1CBnISpJVOzKhaJ+h72FSj/j6i60dryx11i ELxnJHfD9nYNXK15LVCaYeLy9miQfiO+TzalK5Ilzu54ipcZBKEuBWSNbCJxwih7DcKu XXIm2ssAAZtfk/Iv4N6VgYpmaOpYdSgIkAKX+0+B78QONFMlw9hPta1Vk5ZjW3VQ8EoT XwGN183wnvQ2RgmOX38s97Huxq2dgby0ffDJzBbAqfjkVk7w8Uj7Xpn+5dI2K8ZWe5AQ GruyH+/ncscsgPZhVsqy3DSqfy4wg3x0s2i4r2vsuaDtAfWU6QsnwtrpUPiys5XVz/0J BHmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:dkim-signature:arc-authentication-results; bh=yqJ71wV2HjeeJu2Y3Q1e4lnjLxv8/IV3XsUOimBvs3I=; b=egUVYDtTPQF2Kcg21kJ76Us8xYSvmJ7uZv8cyofUzNDb+AZ4S8f6AGhnT3hBb/Xw/v 14rOGt2bTBTIz7MGL1Hff31Gkirp+qY/CuHkzvRK5MM5LbXd1l2A8PMhV+Jjz/gP/sl0 0JX0WuB62BanyWabJ8OyXWq1UWLHE3KWtI/j9VJ1AdNdapdEC6mDsXLrKl1UzMgxJN9/ QNoc7k09ZbifUFozTvNhA3xM6DTFk+2PfKt72A+84mj2MFm4sfcyj+9UuC68RI60UODD S0kSazWNPYiJ1qSmikQZde1yxpeywho8XKCSXsJw4ug7e7jxGEl6UeYilCxGfC3Fq4aj gWQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=aC48c8mj; spf=pass (google.com: domain of andreyknvl@google.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=andreyknvl@google.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=aC48c8mj; spf=pass (google.com: domain of andreyknvl@google.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=andreyknvl@google.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com X-Google-Smtp-Source: AB8JxZrpXFcmnDxs5FR8h9tg3MlqFgfh2qRVgql1o/VHeZh8BNhiPXnnp6J8IflQaBSMIlh3jjeIEtI7ICUR4PFjbTY= MIME-Version: 1.0 In-Reply-To: References: <0db34d04fa16be162336106e3b4a94f3dacc0af4.1524077494.git.andreyknvl@google.com> <20180426174714.4jtb72q56w3xonsa@armageddon.cambridge.arm.com> <20180502153645.fui4ju3scsze3zkq@black.fi.intel.com> From: Andrey Konovalov Date: Thu, 3 May 2018 16:09:56 +0200 Message-ID: Subject: Re: [PATCH 4/6] mm, arm64: untag user addresses in mm/gup.c To: "Kirill A. Shutemov" Cc: Catalin Marinas , Will Deacon , Jonathan Corbet , Mark Rutland , Robin Murphy , Al Viro , James Morse , Kees Cook , Bart Van Assche , Kate Stewart , Greg Kroah-Hartman , Thomas Gleixner , Philippe Ombredanne , Andrew Morton , Ingo Molnar , Dan Williams , "Aneesh Kumar K . V" , Zi Yan , Linux ARM , linux-doc@vger.kernel.org, LKML , Linux Memory Management List , Jacob Bramley , Ruben Ayrapetyan , Lee Smith , Kostya Serebryany , Dmitry Vyukov , Ramana Radhakrishnan , Evgeniy Stepanov Content-Type: text/plain; charset="UTF-8" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: =?utf-8?q?1598111199483906995?= X-GMAIL-MSGID: =?utf-8?q?1599452319675721732?= X-Mailing-List: linux-kernel@vger.kernel.org List-ID: On Wed, May 2, 2018 at 7:25 PM, 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. I wasn't able to find anything that calls follow_page with pointers passed from userspace except for the memory subsystem syscalls, and we deliberately don't add untagging in those. 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.6 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, T_DKIM_INVALID 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 943657DE78 for ; Thu, 3 May 2018 14:09:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751007AbeECOJ6 (ORCPT ); Thu, 3 May 2018 10:09:58 -0400 Received: from mail-it0-f50.google.com ([209.85.214.50]:53897 "EHLO mail-it0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750922AbeECOJ5 (ORCPT ); Thu, 3 May 2018 10:09:57 -0400 Received: by mail-it0-f50.google.com with SMTP id f65-v6so17980763itd.3 for ; Thu, 03 May 2018 07:09:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=yqJ71wV2HjeeJu2Y3Q1e4lnjLxv8/IV3XsUOimBvs3I=; b=aC48c8mjNjL8DiPALClyIjlHJ7HGqkn8Itefzf+FPn+DefNDfaG88Xm6PmM7QehJS6 Uqz1TFpxqL0my7pv3K+a9xwCMMvqsp2ho8mEI21uG5K5aXj1WZXUoPzCsB85QVu+TQ3u WKxx/NHI/GdnuTsVphI/rxy3hS+eTQ9/NxKfqtdS081Wb/ALTbKFarbxHViQXoavMu4Q TcIvnKCh1Kx4UeZWuxUHWAYATd5XZbnkcyRl4+ZZw5tdFIZ9MFHrkUxorXEM8Qp6IBZy q1eds6Rsk/u9q8VKVOe/lSP2OGx2PIpEEwczp69/OPzIEWquL7Ihc0zgoNYZYbqOIiXg 78oQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=yqJ71wV2HjeeJu2Y3Q1e4lnjLxv8/IV3XsUOimBvs3I=; b=YFbo/qvt4UXjhsgmC+xAqxO09MGqAwnGe50Xrp+pjHZeEQalju52IY/m1vme0eFJyK Cc9YBb9RN0U2uIs5DtdEPXFSa20LNr37GLcZ0RE7eXzMFBYfbDFlYc7nduDnwYmZH6A5 tq/Ah9/Pm5qVzRGm8Scd8wYUj70c/InBAuocXZmzjErMcWYgJ2vBlCN+vvPyYZOuOQ8o 3lQLdjlW1YskgLFx6VYqNMzB3Qo8QqJue9FYTGuPmTl0ZbZACNEYlwxZGqKLGlEuKmkX oCHCic5z7Z1fDltqBJUKFTeuladOBc2sZZD/bXh0BQV82FwH/Nl9GprYt0d65SoiRXVR v5Bg== X-Gm-Message-State: ALQs6tCM+aGi57vYJ1uiutYQ9MsCTTPsTSmOyHCvR5OqAjQb/GZPT92Z 61+3ntGSsLwGyzKXkvOBYyWhevcG7Rsfj1MiSp3cTQ== X-Google-Smtp-Source: AB8JxZrpXFcmnDxs5FR8h9tg3MlqFgfh2qRVgql1o/VHeZh8BNhiPXnnp6J8IflQaBSMIlh3jjeIEtI7ICUR4PFjbTY= X-Received: by 2002:a24:1acc:: with SMTP id 195-v6mr25163035iti.48.1525356596887; Thu, 03 May 2018 07:09:56 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a02:6658:0:0:0:0:0 with HTTP; Thu, 3 May 2018 07:09:56 -0700 (PDT) In-Reply-To: References: <0db34d04fa16be162336106e3b4a94f3dacc0af4.1524077494.git.andreyknvl@google.com> <20180426174714.4jtb72q56w3xonsa@armageddon.cambridge.arm.com> <20180502153645.fui4ju3scsze3zkq@black.fi.intel.com> From: Andrey Konovalov Date: Thu, 3 May 2018 16:09:56 +0200 Message-ID: Subject: Re: [PATCH 4/6] mm, arm64: untag user addresses in mm/gup.c To: "Kirill A. Shutemov" Cc: Catalin Marinas , Will Deacon , Jonathan Corbet , Mark Rutland , Robin Murphy , Al Viro , James Morse , Kees Cook , Bart Van Assche , Kate Stewart , Greg Kroah-Hartman , Thomas Gleixner , Philippe Ombredanne , Andrew Morton , Ingo Molnar , Dan Williams , "Aneesh Kumar K . V" , Zi Yan , Linux ARM , linux-doc@vger.kernel.org, LKML , Linux Memory Management List , Jacob Bramley , Ruben Ayrapetyan , Lee Smith , Kostya Serebryany , Dmitry Vyukov , Ramana Radhakrishnan , Evgeniy Stepanov Content-Type: text/plain; charset="UTF-8" Sender: linux-doc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-doc@vger.kernel.org On Wed, May 2, 2018 at 7:25 PM, 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. I wasn't able to find anything that calls follow_page with pointers passed from userspace except for the memory subsystem syscalls, and we deliberately don't add untagging in those. -- 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 From mboxrd@z Thu Jan 1 00:00:00 1970 From: andreyknvl@google.com (Andrey Konovalov) Date: Thu, 3 May 2018 16:09:56 +0200 Subject: [PATCH 4/6] mm, arm64: untag user addresses in mm/gup.c In-Reply-To: References: <0db34d04fa16be162336106e3b4a94f3dacc0af4.1524077494.git.andreyknvl@google.com> <20180426174714.4jtb72q56w3xonsa@armageddon.cambridge.arm.com> <20180502153645.fui4ju3scsze3zkq@black.fi.intel.com> Message-ID: To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Wed, May 2, 2018 at 7:25 PM, 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. I wasn't able to find anything that calls follow_page with pointers passed from userspace except for the memory subsystem syscalls, and we deliberately don't add untagging in those.