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.9 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 3E904C4363D for ; Wed, 7 Oct 2020 13:06:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CBB93206F4 for ; Wed, 7 Oct 2020 13:06:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b="gaxle5XV" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728362AbgJGNGQ (ORCPT ); Wed, 7 Oct 2020 09:06:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46952 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728271AbgJGNGO (ORCPT ); Wed, 7 Oct 2020 09:06:14 -0400 Received: from mail-qt1-x844.google.com (mail-qt1-x844.google.com [IPv6:2607:f8b0:4864:20::844]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A2EEAC0613D2 for ; Wed, 7 Oct 2020 06:06:12 -0700 (PDT) Received: by mail-qt1-x844.google.com with SMTP id h12so139014qtu.1 for ; Wed, 07 Oct 2020 06:06:12 -0700 (PDT) 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=4HblAtS9AKrNcXdrIqeiy/kTpr6U/GTX51Mfam+LA6U=; b=gaxle5XVgPiB2J0+XM9zX2irfLEeu+2lzv07I3+3U3SMukmTi39ED8XpWUwdoBcdzg sq4EXuxHEnLK8EARG7U4otO1hCCHLRTqMxs1/NAPPc5nyn85tvWrubmlDncTe23EKOaB jE9OLIPsLyZnVnoyWAxZ4tlHkPbS9aVO8FiyQjpuMA02++qPCVMiDzO5QLl8lWlJbMD3 4VK5mAfkVwdhlyMZrArW6rVvJKOeuBU228bcPTy37fSP1ncOhV7pl1K6TD9+VWj6isag XGFgvwC3r0uqNL2CEDLuYG1PhamsDOLiaI3s/SgFk61PX6WsySN+n5YF0I2fOeQwZAjk 4vxQ== 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=4HblAtS9AKrNcXdrIqeiy/kTpr6U/GTX51Mfam+LA6U=; b=p78s8Wyz7yByFsmu6L/h9lIgBEdHC3/yxYyPhp35YbQrLcyfyow5WxcQTj5E8UIkkK Tgrlv4DO4KXDFsqoOpUdli2T0Q58m5XO20B5OLz3BPyGzUiN/lfGzL+y2mCcTPCVkx1u o6/z6Lom8ZxW56Z2/BRgmH/vlwCZSro2Rya4jFV6UWvkXftMk7ksBJp/PYYtdN4vEefK 3xQvM/ZoX1/uZVpU0YZ7QH/+Q1FokjlMxxF9PiNAg71qrZkexPzqlq82Uv5ktJ6iqkrv domcRH8DUpSyCkB37xtgzSpvVwF6ubq9C6kaDoeJt2dOW5188U5TlSLOEJUKxQI6vAyL SwDQ== X-Gm-Message-State: AOAM531rqz1oIfx5sRQGbsVgwHMIuV4jWqYXaPdzsmbm4Y5mqSTOAHQh dAAE/MUSdTlRI1bxx3p99YvvOg== X-Google-Smtp-Source: ABdhPJz13fEMZDLnus1GsnlhL3kh+zUp6oNCWrGj1oRDvFmd97g/P2fkBStxQRO5aVdvng5Hk9Rc3A== X-Received: by 2002:ac8:4807:: with SMTP id g7mr3141587qtq.54.1602075971639; Wed, 07 Oct 2020 06:06:11 -0700 (PDT) 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 d14sm1449111qtr.62.2020.10.07.06.06.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Oct 2020 06:06:10 -0700 (PDT) Received: from jgg by mlx with local (Exim 4.94) (envelope-from ) id 1kQ990-000tst-7Q; Wed, 07 Oct 2020 10:06:10 -0300 Date: Wed, 7 Oct 2020 10:06:10 -0300 From: Jason Gunthorpe To: Daniel Vetter Cc: Tomasz Figa , Marek Szyprowski , DRI Development , LKML , Daniel Vetter , Andrew Morton , John Hubbard , =?utf-8?B?SsOpcsO0bWU=?= Glisse , Jan Kara , Dan Williams , Linux MM , Linux ARM , Pawel Osciak , Kyungmin Park , Inki Dae , Joonyoung Shim , Seung-Woo Kim , linux-samsung-soc , "open list:DMA BUFFER SHARING FRAMEWORK" , Oded Gabbay Subject: Re: [PATCH 2/2] mm/frame-vec: use FOLL_LONGTERM Message-ID: <20201007130610.GP5177@ziepe.ca> References: <20201002233118.GM9916@ziepe.ca> <725819e9-4f07-3f04-08f8-b6180406b339@samsung.com> <20201007124409.GN5177@ziepe.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 07, 2020 at 02:58:33PM +0200, Daniel Vetter wrote: > On Wed, Oct 7, 2020 at 2:48 PM Tomasz Figa wrote: > > > > On Wed, Oct 7, 2020 at 2:44 PM Jason Gunthorpe wrote: > > > > > > On Wed, Oct 07, 2020 at 02:33:56PM +0200, Marek Szyprowski wrote: > > > > Well, it was in vb2_get_vma() function, but now I see that it has been > > > > lost in fb639eb39154 and 6690c8c78c74 some time ago... > > > > > > There is no guarentee that holding a get on the file says anthing > > > about the VMA. This needed to check that the file was some special > > > kind of file that promised the VMA layout and file lifetime are > > > connected. > > > > > > Also, cloning a VMA outside the mm world is just really bad. That > > > would screw up many assumptions the drivers make. > > > > > > If it is all obsolete I say we hide it behind a default n config > > > symbol and taint the kernel if anything uses it. > > > > > > Add a big comment above the follow_pfn to warn others away from this > > > code. > > > > Sadly it's just verbally declared as deprecated and not formally noted > > anyway. There are a lot of userspace applications relying on user > > pointer support. > > userptr can stay, it's the userptr abuse for zerocpy buffer sharing > which doesn't work anymore. At least without major surgery (you'd need > an mmu notifier to zap mappings and recreate them, and that pretty > much breaks the v4l model of preallocating all buffers to make sure we > never underflow the buffer queue). And static mappings are not coming > back I think, we'll go ever more into the direction of dynamic > mappings and moving stuff around as needed. Right, and to be clear, the last time I saw a security flaw of this magnitude from a subsystem badly mis-designing itself, Linus's knee-jerk reaction was to propose to remove the whole subsystem. Please don't take status-quo as acceptable, V4L community has to work to resolve this, uABI breakage or not. The follow_pfn related code must be compiled out of normal distro kernel builds. Jason 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=-4.5 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,URIBL_BLOCKED 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 2901FC4363D for ; Wed, 7 Oct 2020 13:07:46 +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 638BA206F4 for ; Wed, 7 Oct 2020 13:07:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ZHIsgv1Z"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b="gaxle5XV" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 638BA206F4 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=T3odfoXuI6Fry9oGrUZnmcHOWkB7IO36cNaxPu+QTDQ=; b=ZHIsgv1Z10OluW3APipCiy546 uISuLuXWuHHof/k2Qv7rx/Bgk5zmBsmlzPAR/DsxEwCWyTzGttZpLOXngfr3+EJdRraJ6p1L9wDWb Lu0uBe7fgNif4xAEEfPMB9KzyPYNZZkTq1qJ/Mvo/dwimWvYI58Y/tc/Ug5hhwB6jFUspTkRkPh5H 4W7Z+Bokt3HGwHENqg6HwE7ukmUPcjkov8WpetybMi2up+ZRJlZUKXN5L6tyqDvknuMjW9bkEiR/d irvDTNJ2cTF3Jj3SsPUgX4ccYMdgO0fp8Ov2GeZxRo/VUGH0IZYrq8dfy54l12I9IR7inXXsYazqr M7CK1aDoQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kQ997-0007do-EJ; Wed, 07 Oct 2020 13:06:17 +0000 Received: from mail-qt1-x844.google.com ([2607:f8b0:4864:20::844]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kQ994-0007cX-Oh for linux-arm-kernel@lists.infradead.org; Wed, 07 Oct 2020 13:06:15 +0000 Received: by mail-qt1-x844.google.com with SMTP id h12so139056qtu.1 for ; Wed, 07 Oct 2020 06:06:14 -0700 (PDT) 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=4HblAtS9AKrNcXdrIqeiy/kTpr6U/GTX51Mfam+LA6U=; b=gaxle5XVgPiB2J0+XM9zX2irfLEeu+2lzv07I3+3U3SMukmTi39ED8XpWUwdoBcdzg sq4EXuxHEnLK8EARG7U4otO1hCCHLRTqMxs1/NAPPc5nyn85tvWrubmlDncTe23EKOaB jE9OLIPsLyZnVnoyWAxZ4tlHkPbS9aVO8FiyQjpuMA02++qPCVMiDzO5QLl8lWlJbMD3 4VK5mAfkVwdhlyMZrArW6rVvJKOeuBU228bcPTy37fSP1ncOhV7pl1K6TD9+VWj6isag XGFgvwC3r0uqNL2CEDLuYG1PhamsDOLiaI3s/SgFk61PX6WsySN+n5YF0I2fOeQwZAjk 4vxQ== 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=4HblAtS9AKrNcXdrIqeiy/kTpr6U/GTX51Mfam+LA6U=; b=eR6Beaq51kbN7eDMoaqnNid5krxN+QyYVQTvOhguPFu9TJY3y10cMmAV7KL13uLFuQ NvePHOzffJmASRgAJRcPcZ7MYf7zcKlY84d8laifvy69ly3wfK9PlPxD3d6/pSChNejc fGCX8MCAZ2irQknfnastglwBp/uh99CfuYSMZGYwXWig/EHcDCll5Wv8Cvf1Kfh3QZuW qE52SqBqJwPtx1BMw1MNGrCIodvpaJoTUp3EzuwMoK+4VyRRVCtR1THX2GakXaJtyCAW CYaeNQHL0A9sF4dL3H/Vg9dUQMenRRc8wwMq05oKT15JPQwiaxe4ZletTFdorN6C7jZv spWg== X-Gm-Message-State: AOAM531dde7c01AXxi+DSaBqbaHV1tjotPO7acGAbPncpUDoSl5hwXAR uXKqGg1gClcmoOV6LpvTaSqCwg== X-Google-Smtp-Source: ABdhPJz13fEMZDLnus1GsnlhL3kh+zUp6oNCWrGj1oRDvFmd97g/P2fkBStxQRO5aVdvng5Hk9Rc3A== X-Received: by 2002:ac8:4807:: with SMTP id g7mr3141587qtq.54.1602075971639; Wed, 07 Oct 2020 06:06:11 -0700 (PDT) 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 d14sm1449111qtr.62.2020.10.07.06.06.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Oct 2020 06:06:10 -0700 (PDT) Received: from jgg by mlx with local (Exim 4.94) (envelope-from ) id 1kQ990-000tst-7Q; Wed, 07 Oct 2020 10:06:10 -0300 Date: Wed, 7 Oct 2020 10:06:10 -0300 From: Jason Gunthorpe To: Daniel Vetter Subject: Re: [PATCH 2/2] mm/frame-vec: use FOLL_LONGTERM Message-ID: <20201007130610.GP5177@ziepe.ca> References: <20201002233118.GM9916@ziepe.ca> <725819e9-4f07-3f04-08f8-b6180406b339@samsung.com> <20201007124409.GN5177@ziepe.ca> 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-20201007_090614_827257_33543BDF X-CRM114-Status: GOOD ( 26.02 ) 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: Oded Gabbay , Inki Dae , linux-samsung-soc , Jan Kara , Joonyoung Shim , Pawel Osciak , John Hubbard , Seung-Woo Kim , LKML , DRI Development , Tomasz Figa , Kyungmin Park , Linux MM , =?utf-8?B?SsOpcsO0bWU=?= Glisse , Daniel Vetter , Andrew Morton , "open list:DMA BUFFER SHARING FRAMEWORK" , Dan Williams , Linux ARM , Marek Szyprowski 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 Wed, Oct 07, 2020 at 02:58:33PM +0200, Daniel Vetter wrote: > On Wed, Oct 7, 2020 at 2:48 PM Tomasz Figa wrote: > > > > On Wed, Oct 7, 2020 at 2:44 PM Jason Gunthorpe wrote: > > > > > > On Wed, Oct 07, 2020 at 02:33:56PM +0200, Marek Szyprowski wrote: > > > > Well, it was in vb2_get_vma() function, but now I see that it has been > > > > lost in fb639eb39154 and 6690c8c78c74 some time ago... > > > > > > There is no guarentee that holding a get on the file says anthing > > > about the VMA. This needed to check that the file was some special > > > kind of file that promised the VMA layout and file lifetime are > > > connected. > > > > > > Also, cloning a VMA outside the mm world is just really bad. That > > > would screw up many assumptions the drivers make. > > > > > > If it is all obsolete I say we hide it behind a default n config > > > symbol and taint the kernel if anything uses it. > > > > > > Add a big comment above the follow_pfn to warn others away from this > > > code. > > > > Sadly it's just verbally declared as deprecated and not formally noted > > anyway. There are a lot of userspace applications relying on user > > pointer support. > > userptr can stay, it's the userptr abuse for zerocpy buffer sharing > which doesn't work anymore. At least without major surgery (you'd need > an mmu notifier to zap mappings and recreate them, and that pretty > much breaks the v4l model of preallocating all buffers to make sure we > never underflow the buffer queue). And static mappings are not coming > back I think, we'll go ever more into the direction of dynamic > mappings and moving stuff around as needed. Right, and to be clear, the last time I saw a security flaw of this magnitude from a subsystem badly mis-designing itself, Linus's knee-jerk reaction was to propose to remove the whole subsystem. Please don't take status-quo as acceptable, V4L community has to work to resolve this, uABI breakage or not. The follow_pfn related code must be compiled out of normal distro kernel builds. Jason _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel 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.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED 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 033CFC41604 for ; Wed, 7 Oct 2020 15:39:58 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 A1BB721707 for ; Wed, 7 Oct 2020 15:39:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b="gaxle5XV" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A1BB721707 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5CF846E923; Wed, 7 Oct 2020 15:39:43 +0000 (UTC) Received: from mail-qt1-x841.google.com (mail-qt1-x841.google.com [IPv6:2607:f8b0:4864:20::841]) by gabe.freedesktop.org (Postfix) with ESMTPS id A78F56E8DB for ; Wed, 7 Oct 2020 13:06:12 +0000 (UTC) Received: by mail-qt1-x841.google.com with SMTP id o21so1706115qtp.2 for ; Wed, 07 Oct 2020 06:06:12 -0700 (PDT) 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=4HblAtS9AKrNcXdrIqeiy/kTpr6U/GTX51Mfam+LA6U=; b=gaxle5XVgPiB2J0+XM9zX2irfLEeu+2lzv07I3+3U3SMukmTi39ED8XpWUwdoBcdzg sq4EXuxHEnLK8EARG7U4otO1hCCHLRTqMxs1/NAPPc5nyn85tvWrubmlDncTe23EKOaB jE9OLIPsLyZnVnoyWAxZ4tlHkPbS9aVO8FiyQjpuMA02++qPCVMiDzO5QLl8lWlJbMD3 4VK5mAfkVwdhlyMZrArW6rVvJKOeuBU228bcPTy37fSP1ncOhV7pl1K6TD9+VWj6isag XGFgvwC3r0uqNL2CEDLuYG1PhamsDOLiaI3s/SgFk61PX6WsySN+n5YF0I2fOeQwZAjk 4vxQ== 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=4HblAtS9AKrNcXdrIqeiy/kTpr6U/GTX51Mfam+LA6U=; b=fsHhxyiTEa+U/GfpxiK7V5KDXHt2EnvZKdJi+9hoPnHmhz+QG7ZSF75DL7EvnqFB+b ZRVwSJ+5sNntGMGt30BG6sxd7s/3KMJn5hH6AjuLjdYSH7SSlpzOtXJN0yDwCPJ81Uex nxIkt2/FUM/IZdnXfni4oliwExLSoErtZ+ODtQKBDsI28OT0lt1UKCuUFYLUg+RbHblR yfSa/TQ/WTxF1ZBq/aywSffTl42WNorcZ6YXEl2P2wTIUwoUYyaOeCNrrzBHEgChuKD/ i1qhTloZRxNewJJshkhlvYfqPP2YVH6T1iNy2ZnAT1XhDmxGDwyZzScfPJcUOz2dNDst 2ifw== X-Gm-Message-State: AOAM531bHeNAnLuhWjnhMG1G6DvTUrHVejGgSqASvZRiHSlyLmUvEkKx g5VxsqLryTakLOJnEFo9zJph5g== X-Google-Smtp-Source: ABdhPJz13fEMZDLnus1GsnlhL3kh+zUp6oNCWrGj1oRDvFmd97g/P2fkBStxQRO5aVdvng5Hk9Rc3A== X-Received: by 2002:ac8:4807:: with SMTP id g7mr3141587qtq.54.1602075971639; Wed, 07 Oct 2020 06:06:11 -0700 (PDT) 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 d14sm1449111qtr.62.2020.10.07.06.06.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Oct 2020 06:06:10 -0700 (PDT) Received: from jgg by mlx with local (Exim 4.94) (envelope-from ) id 1kQ990-000tst-7Q; Wed, 07 Oct 2020 10:06:10 -0300 Date: Wed, 7 Oct 2020 10:06:10 -0300 From: Jason Gunthorpe To: Daniel Vetter Subject: Re: [PATCH 2/2] mm/frame-vec: use FOLL_LONGTERM Message-ID: <20201007130610.GP5177@ziepe.ca> References: <20201002233118.GM9916@ziepe.ca> <725819e9-4f07-3f04-08f8-b6180406b339@samsung.com> <20201007124409.GN5177@ziepe.ca> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Mailman-Approved-At: Wed, 07 Oct 2020 15:39:39 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-samsung-soc , Jan Kara , Joonyoung Shim , Pawel Osciak , John Hubbard , Seung-Woo Kim , LKML , DRI Development , Tomasz Figa , Kyungmin Park , Linux MM , =?utf-8?B?SsOpcsO0bWU=?= Glisse , Daniel Vetter , Andrew Morton , "open list:DMA BUFFER SHARING FRAMEWORK" , Dan Williams , Linux ARM , Marek Szyprowski Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Wed, Oct 07, 2020 at 02:58:33PM +0200, Daniel Vetter wrote: > On Wed, Oct 7, 2020 at 2:48 PM Tomasz Figa wrote: > > > > On Wed, Oct 7, 2020 at 2:44 PM Jason Gunthorpe wrote: > > > > > > On Wed, Oct 07, 2020 at 02:33:56PM +0200, Marek Szyprowski wrote: > > > > Well, it was in vb2_get_vma() function, but now I see that it has been > > > > lost in fb639eb39154 and 6690c8c78c74 some time ago... > > > > > > There is no guarentee that holding a get on the file says anthing > > > about the VMA. This needed to check that the file was some special > > > kind of file that promised the VMA layout and file lifetime are > > > connected. > > > > > > Also, cloning a VMA outside the mm world is just really bad. That > > > would screw up many assumptions the drivers make. > > > > > > If it is all obsolete I say we hide it behind a default n config > > > symbol and taint the kernel if anything uses it. > > > > > > Add a big comment above the follow_pfn to warn others away from this > > > code. > > > > Sadly it's just verbally declared as deprecated and not formally noted > > anyway. There are a lot of userspace applications relying on user > > pointer support. > > userptr can stay, it's the userptr abuse for zerocpy buffer sharing > which doesn't work anymore. At least without major surgery (you'd need > an mmu notifier to zap mappings and recreate them, and that pretty > much breaks the v4l model of preallocating all buffers to make sure we > never underflow the buffer queue). And static mappings are not coming > back I think, we'll go ever more into the direction of dynamic > mappings and moving stuff around as needed. Right, and to be clear, the last time I saw a security flaw of this magnitude from a subsystem badly mis-designing itself, Linus's knee-jerk reaction was to propose to remove the whole subsystem. Please don't take status-quo as acceptable, V4L community has to work to resolve this, uABI breakage or not. The follow_pfn related code must be compiled out of normal distro kernel builds. Jason _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel