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 X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9C91FC388F2 for ; Mon, 2 Nov 2020 13:01:58 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2BAF3223B0 for ; Mon, 2 Nov 2020 13:01:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="BN17ba/s"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b="ir3GR39Y" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2BAF3223B0 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=FJG7y8vssrTlnLoztec80+pmtNyVtKz/54/F/xV5HkU=; b=BN17ba/sFpAxRk5xE6JhI/qgN 809r6Y9XhH6nLCFNZRrE0B4z2vdubCbbza8XmqYM5HsvIrdY4KRqSq/ESvmGfdE7lqSo9wIXn+n0s PMsyBVxTLuwUHGvECPmRGkC114uHsKni3ijP2wJHyvnsv6hj9QJQ6YZigk3FkDKFJFzm0Jbm/j/yW eN3rujB6JRFX+u95QoJZHTc5NDL7OwmFC+CqAI1uwaEzpPAuT09HeGQPVmd75Zs9rz5T+6lrPT97J sEbNYUrq03iCApf1ksQYt1cEdjxekjdShyZlPy0pHgD2oqHmIMxJuJ1z3EPmnQvW6eDUtfydI1lFD byAFHocTg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kZZSd-0005Mh-6R; Mon, 02 Nov 2020 13:01:23 +0000 Received: from mail-qk1-x742.google.com ([2607:f8b0:4864:20::742]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kZZSa-0005LD-8s for linux-arm-kernel@lists.infradead.org; Mon, 02 Nov 2020 13:01:21 +0000 Received: by mail-qk1-x742.google.com with SMTP id o205so4531212qke.10 for ; Mon, 02 Nov 2020 05:01:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=ywfiDbg6XCEWmoBx9eC29OtR/MyEWOW93XTelnAXaBk=; b=ir3GR39YhTRDVVIubqbd2b6fYJQqoYzGlGzQhJGPgx/IpIwERjn3x6j0FKgwPju8tJ K346RwtLd1HrF6IYofhsCSTJj3QK+10oMg2YllJh/KpA3n62CbFQnKL6ivWZ5KZSOniq QwLvLlA6x1j/aJc2hKzXChvGjpbbw6GWq/KNk/8R9NhESFTt0yrJ0KQKjkdmTuloLwW/ Zwps2gbtqPniuVum2Pfu8S68SKxWxd0HMyfFBAbv4qCeVCCuOZxQnUab9RNI4DYrsJao v2N/I2zDZif6Md4+OJsi4IvpXjI5tOvsKPLa0IKjhrcIMk4ZoUB68GDdMIbIvaBwF1NM /xmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=ywfiDbg6XCEWmoBx9eC29OtR/MyEWOW93XTelnAXaBk=; b=OoNqoGmUnL7HelsZqejnbFB3yEH4J37RYQUmboQ5bAr6kka5Sz0g5I8If7B6Ag/wUw K/NgHxvpuxlgtA9LfGSvdKWWG4zIYL5t3XYeGQZC4n1jqjn61VAzG6pDLtJ/y6wDuPJG WybfkeYVMFnSqwc5q7CZNZn0z64wffy+9NlBS+a2Vr0dwpPrniX0iVo/SG9o3QioZifk KaJ7ngdJNtcIOe7QocvkrWvwGk/1zXZp7jvlokp+BkDfO6c68uxawF/IMuHv61W9Mcc/ 78vSSq8op6m4/QCZLZjICfAGM3oPv3BixnlHkS8617DBbdExuHsTXr3tWGHgnnS4dbLX eZyA== X-Gm-Message-State: AOAM532nrL4YwTeNE0+TcUfuIbarlyK6u7AdkcUvH3vj4WIJga6b/gxv RsWe4VooEenCSOjyJchmKZsuEQ== X-Google-Smtp-Source: ABdhPJzRrsH3Zfgny2Ycg3bBy2Q+SuhdpwI09cYL0ZnBVzwrgv7GmXDFxfx3kiLU2YMRfbo6u8i3PQ== X-Received: by 2002:a37:8c41:: with SMTP id o62mr13561782qkd.240.1604322076971; Mon, 02 Nov 2020 05:01:16 -0800 (PST) Received: from ziepe.ca (hlfxns017vw-156-34-48-30.dhcp-dynamic.fibreop.ns.bellaliant.net. [156.34.48.30]) by smtp.gmail.com with ESMTPSA id b8sm7742829qkn.133.2020.11.02.05.01.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Nov 2020 05:01:16 -0800 (PST) Received: from jgg by mlx with local (Exim 4.94) (envelope-from ) id 1kZZSV-00EvRo-QJ; Mon, 02 Nov 2020 09:01:15 -0400 Date: Mon, 2 Nov 2020 09:01:15 -0400 From: Jason Gunthorpe To: Daniel Vetter Subject: Re: [PATCH v5 08/15] mm: Add unsafe_follow_pfn Message-ID: <20201102130115.GC36674@ziepe.ca> References: <20201030100815.2269-1-daniel.vetter@ffwll.ch> <20201030100815.2269-9-daniel.vetter@ffwll.ch> <20201102072931.GA16419@infradead.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201102_080120_341052_778BE5B1 X-CRM114-Status: GOOD ( 19.70 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-samsung-soc , Jan Kara , Kees Cook , KVM list , John Hubbard , LKML , DRI Development , Christoph Hellwig , Linux MM , J??r??me Glisse , Daniel Vetter , Dan Williams , Andrew Morton , Linux ARM , "open list:DMA BUFFER SHARING FRAMEWORK" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Nov 02, 2020 at 01:56:10PM +0100, Daniel Vetter wrote: > On Mon, Nov 2, 2020 at 8:29 AM Christoph Hellwig wrote: > > > > On Fri, Oct 30, 2020 at 11:08:08AM +0100, Daniel Vetter wrote: > > > Also mark up follow_pfn as EXPORT_SYMBOL_GPL. The only safe way to use > > > that by drivers/modules is together with an mmu_notifier, and that's > > > all _GPL stuff. > > > > I also think it also needs to be renamed to explicitly break any existing > > users out of tree or int the submission queue. > > Ok I looked at the mmu notifier locking again and noticed that > mm->subscriptions has its own spinlock. Since there usually shouldn't > be a huge pile of these I think it's feasible to check for the mmu > notifier in follow_pfn. And that would stuff this gap for good. I'll > throw that on top as a final patch and see what people think. Probably the simplest is to just check mm_has_notifiers() when in lockdep or something very simple like that Jason _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel