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.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 EC53BC433DF for ; Fri, 16 Oct 2020 16:13:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8D83420848 for ; Fri, 16 Oct 2020 16:13:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b="Jw6H43NW" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2409702AbgJPQNN (ORCPT ); Fri, 16 Oct 2020 12:13:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42300 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2409197AbgJPQNN (ORCPT ); Fri, 16 Oct 2020 12:13:13 -0400 Received: from mail-io1-xd42.google.com (mail-io1-xd42.google.com [IPv6:2607:f8b0:4864:20::d42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4E619C0613D3 for ; Fri, 16 Oct 2020 09:13:13 -0700 (PDT) Received: by mail-io1-xd42.google.com with SMTP id b8so4443985ioh.11 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=JBAMeJWUJZPY4aRY9C8yMYwPRmsko/9uik1+HCdyxJ1t30rHbJ2v09cMUb6oCLZqSN 7AWXlcQBwX62+olJxsDG5SQAJ8YVlHYWqhDhnyeKum5Nh1stHsK/S4fN42ABAdAjlVG6 RWmsNJT788UUh8OaUVeCMJOGVQOYD2gQLkeT0TJzCga1IkAoB/2XVcDrftcSmsMFxxSg 0Cg78SpHCxsSJeaTZ4XwLoLug654Tv+J3+cDzbdQqzsiM3NN4Jo5ELqpxSiUYInmkjJ/ RqREZMj5IuZXkHZkx3YU3mujjhYSK6A8FK/NtcdAWQmYvZVEwW9PIqJ/TVthJa6iB0lq 1C7A== X-Gm-Message-State: AOAM531F6tRrHyg/Al+E2OQX/pR9PGX5d9TyVxHWvv+dnQCzzTbGz42M FAPvlB1YUP737VSun/StrxfFog== 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 Content-Transfer-Encoding: 8bit In-Reply-To: <20201012085203.56119-1-christian.koenig@amd.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 12, 2020 at 10:52:02AM +0200, Christian König wrote: > Patch "495c10cc1c0c CHROMIUM: dma-buf: restore args..." > adds a workaround for a bug in mmap_region. > > As the comment states ->mmap() callback can change > vma->vm_file and so we might call fput() on the wrong file. > > Revert the workaround and proper fix this in mmap_region. > > v2: drop the extra if in dma_buf_mmap as well > > Signed-off-by: Christian König > 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