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=-6.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, 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 B56F4C43457 for ; Fri, 16 Oct 2020 16:13:16 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 396732084C for ; Fri, 16 Oct 2020 16:13:15 +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="Jw6H43NW" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 396732084C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 5C953940009; Fri, 16 Oct 2020 12:13:15 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 57ABC940007; Fri, 16 Oct 2020 12:13:15 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 41AAF940009; Fri, 16 Oct 2020 12:13:15 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0057.hostedemail.com [216.40.44.57]) by kanga.kvack.org (Postfix) with ESMTP id A9A9B940007 for ; Fri, 16 Oct 2020 12:13:14 -0400 (EDT) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id BD8678249980 for ; Fri, 16 Oct 2020 16:13:13 +0000 (UTC) X-FDA: 77378283066.22.front03_0e0f8982721e Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin22.hostedemail.com (Postfix) with ESMTP id 9631518038E68 for ; Fri, 16 Oct 2020 16:13:13 +0000 (UTC) X-HE-Tag: front03_0e0f8982721e X-Filterd-Recvd-Size: 4227 Received: from mail-io1-f66.google.com (mail-io1-f66.google.com [209.85.166.66]) by imf14.hostedemail.com (Postfix) with ESMTP for ; Fri, 16 Oct 2020 16:13:13 +0000 (UTC) Received: by mail-io1-f66.google.com with SMTP id n6so4422663ioc.12 for ; Fri, 16 Oct 2020 09:13:13 -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:content-transfer-encoding:in-reply-to; bh=HoVWWsnJtF4ldfrPYdqvQFOpOJVhRuHffI82nRexcX8=; b=Jw6H43NWctaQWddG+pghAvq2p766POaPQK67OavH9mxQ2H9IpE074eMaq6fsdxm87u mYXexOncu0xIlG+cKVY1W4nYVRMtHcVLbnVI5ef52KknoCtpuRXs939C9jhj3B3QVAGP qfiE26X3OtR2LAb7NWdzedtO/V/g077FEU04FmbuSzrCBv/v9wW90J90qpihp8tcjaeB BMuwiJgKQny9OK6blmSzlTLIH1p+HFlRKXb7bO+x9vFGa38q/jaxdoIGKFnEIX4rMxBV Cp6qNmIpW8jf9j8J/TJSpcYFlWo65G2qZjzlvU/KYrv8Fq4w4DyRvZP1UTYbZ2JkzHfN 983Q== 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:content-transfer-encoding :in-reply-to; bh=HoVWWsnJtF4ldfrPYdqvQFOpOJVhRuHffI82nRexcX8=; b=c7KNO2n3d9PIitg6/YQhNcU3bgKda1HPmn/sjjMRb/DiDnVj5xhlSVlNTr9aP9/zUx HvIXF7TQArM2PTW+Aw0saS2ON7hbvOik2JUB1DoJ7v/219OmwyQZJujgij80Lh7Jt/x2 NIXvfMWvk0VJErdqTDCTGHksX71/I4oOArnRXjz7nX+wMeO0+LlomvsOHOLK3tb10TCg chvWpi6Y1MR0DPchDk3xA+7+zlurHpjBknz4cX0EPwdSdG8BYDBs3Y8oGJMkh6jogHak gdTJhprBtCs4iWNjO5ON0BJxpkIvFBwbK9R9SNkwAi+t5e1HpiiZ9sATfylUoDgMz+rR LFUQ== X-Gm-Message-State: AOAM532LofQ6LVQiDAGMkRP+FDrPWOPPOYYQFUvXiaTNZEjd+S9vyMnH +eueOUETL/KDf+OeOmgfr15GyQ== X-Google-Smtp-Source: ABdhPJwNXo7iyWJ77FT+/0CMo9tudCck82Xc2qlsaYhuPEdloUxNeSLOdR9y5ZI15zE7xNsqmPrhXQ== X-Received: by 2002:a6b:b413:: with SMTP id d19mr3054559iof.10.1602864792525; Fri, 16 Oct 2020 09:13:12 -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 m66sm2702327ill.69.2020.10.16.09.13.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Oct 2020 09:13:11 -0700 (PDT) Received: from jgg by mlx with local (Exim 4.94) (envelope-from ) id 1kTSLu-000ecw-Lj; Fri, 16 Oct 2020 13:13:10 -0300 Date: Fri, 16 Oct 2020 13:13:10 -0300 From: Jason Gunthorpe To: Christian =?utf-8?B?S8O2bmln?= Cc: akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, linaro-mm-sig@lists.linaro.org, dri-devel@lists.freedesktop.org, linux-media@vger.kernel.org, chris@chris-wilson.co.uk, airlied@redhat.com, daniel@ffwll.ch, sumit.semwal@linaro.org, willy@infradead.org, jhubbard@nvidia.com, linmiaohe@huawei.com Subject: Re: [PATCH 1/2] mm: mmap: fix fput in error path v2 Message-ID: <20201016161310.GE36674@ziepe.ca> References: <20201012085203.56119-1-christian.koenig@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20201012085203.56119-1-christian.koenig@amd.com> Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon, Oct 12, 2020 at 10:52:02AM +0200, Christian K=C3=B6nig wrote: > Patch "495c10cc1c0c CHROMIUM: dma-buf: restore args..." > adds a workaround for a bug in mmap_region. >=20 > As the comment states ->mmap() callback can change > vma->vm_file and so we might call fput() on the wrong file. >=20 > Revert the workaround and proper fix this in mmap_region. >=20 > v2: drop the extra if in dma_buf_mmap as well >=20 > Signed-off-by: Christian K=C3=B6nig > Reviewed-by: Jason Gunthorpe > --- > drivers/dma-buf/dma-buf.c | 20 +++----------------- > mm/mmap.c | 2 +- > 2 files changed, 4 insertions(+), 18 deletions(-) Reviewed-by: Jason Gunthorpe Probably should Fixes that other patch Andrew pointed at Jason