Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp3276329pxx; Mon, 2 Nov 2020 04:58:36 -0800 (PST) X-Google-Smtp-Source: ABdhPJwFueFJXwoUGvJJOKLPSx13NGEytQocBqd80sobAKSy5f7mUOEmT347gOFM4FTazMeC6Umy X-Received: by 2002:aa7:df89:: with SMTP id b9mr16503783edy.335.1604321916563; Mon, 02 Nov 2020 04:58:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604321916; cv=none; d=google.com; s=arc-20160816; b=eZTopNAy10AkZYAZ/PYABAz1YLH0I7nrKcsmlENVGRGAndMCL7nuvKGVp3/+YHTa1v 2K6qF35eiVy0A3Nricdj141noMfbujarpRDaMeeNEQLcI3MAj2yu08tDhlEzvIFdxU9i 42I1kTWRZVGjqkf0KUF7KB5c2SA0rW1yGvxmGCJ5rjl3Rwx/Sc7GIP2QWoA0fDRq75rz PGX/CKZSjgALsSz5FRYCw/3tomt1s37fw/IlWYp8o4d1RJrM/zn3YTmC3mBs/k5GNQnX YnY9MPZh6lC6nKEnVfwrAUrVWKGKRUkgyEr7Ws3Ke2Z3N5bSjGWLEN0EVGrJc/wXa0Nq JDrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=U5ses3L4S0EGFIO147NO/jaN4EloOqduj8AeaQfFuV8=; b=B4DAEMsE0KiuM1xQST8Unf3K5SUd5qXufmuJwcAjlYT19ZGW7ER7pSsGAdFW3yISdP X3cdjqRPXIH0cQiRUCPqnjBFt4HJLfVAkFVvdB51LFTkE2p/ELI731McUq8xhxeyfDPr TYQKyDy0x3mF3sy4Pe9oNVdMG2JMFgFTmFaXZ9Rx4FKhV+0sZwoR06frskoYm1JfeItr EN8/IDNIk+pRIZac9ylT0/m057Gvhwv2pKVqK2NYN2WBt/O05HLFPzlhVbthzD053RLW 7VXVAfTC3LLud77/2cCpftUqHcw4yucQLckNff1B0cfjQka0pkgEsConrd+0+F8vojhl hpAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=T3p+MSLR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 4si9865153ejy.644.2020.11.02.04.58.11; Mon, 02 Nov 2020 04:58:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=T3p+MSLR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728854AbgKBM42 (ORCPT + 99 others); Mon, 2 Nov 2020 07:56:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34246 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728702AbgKBM4Y (ORCPT ); Mon, 2 Nov 2020 07:56:24 -0500 Received: from mail-ot1-x343.google.com (mail-ot1-x343.google.com [IPv6:2607:f8b0:4864:20::343]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 96CCAC061A04 for ; Mon, 2 Nov 2020 04:56:22 -0800 (PST) Received: by mail-ot1-x343.google.com with SMTP id b2so12463545ots.5 for ; Mon, 02 Nov 2020 04:56:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=U5ses3L4S0EGFIO147NO/jaN4EloOqduj8AeaQfFuV8=; b=T3p+MSLRVTQeTCxHlv2KtbWAgQXYXjF/NQ5vZEZ56cGWMPWmhzeFc9ZhAf24TyMNJy X8ZVYO+h7DmQjzrCGnwO7PCiNeRaaOGSFYoXqqakqdoymjMzjnu9kMLe6DLLbyq0pqc5 IQ0xty7dRJBPKhniovuUncjzErvz8QtDqXg1c= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=U5ses3L4S0EGFIO147NO/jaN4EloOqduj8AeaQfFuV8=; b=MQ3vkDx0acfkSjOCcybPhkMjEzdoMiMuJhS7QfU8gCq387rc9NECbicH2VRJPz/JR+ 3T+oapzq0kpGZv0y5+EvGKsN82FYlvj+6iCo7TUTLmp30yEYA5ibpQAuYxljaBC+YfTD exGzamZZQc3MAOiBFz61g32hE3G0WMomBU1y1CEXC1NBkSzfiPtuF9Wps0oc1ZTGzK5v 07l4nvsL/zOwWBIJLsezxoRVhmUQGwCgtqFbvzA0roJyH+fGPfJ/gVMjNejpb9D5+ies mjZA4VmL8sE9WC1KCWHuzsSWhBQhEd5TFZimMSw2oZ4g1GW966UnF0PrZ/j/AHaPQq8P wKYw== X-Gm-Message-State: AOAM531S/izP0qQDmIV1uGJBCMHN33o+j725TNFaPw8vcuZxaAew4ogw Cj2ngxJRiMasekub6SZaYG2DTd9qktwul+L2SblukQ== X-Received: by 2002:a05:6830:1647:: with SMTP id h7mr12585840otr.281.1604321781980; Mon, 02 Nov 2020 04:56:21 -0800 (PST) MIME-Version: 1.0 References: <20201030100815.2269-1-daniel.vetter@ffwll.ch> <20201030100815.2269-9-daniel.vetter@ffwll.ch> <20201102072931.GA16419@infradead.org> In-Reply-To: <20201102072931.GA16419@infradead.org> From: Daniel Vetter Date: Mon, 2 Nov 2020 13:56:10 +0100 Message-ID: Subject: Re: [PATCH v5 08/15] mm: Add unsafe_follow_pfn To: Christoph Hellwig Cc: DRI Development , LKML , KVM list , Linux MM , Linux ARM , linux-samsung-soc , "open list:DMA BUFFER SHARING FRAMEWORK" , Daniel Vetter , Jason Gunthorpe , Kees Cook , Dan Williams , Andrew Morton , John Hubbard , "J??r??me Glisse" , Jan Kara Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch