Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp1473920pxu; Fri, 16 Oct 2020 12:56:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwNdzsg34Ntd5T9dvYGzaZm7ek8YdU7XwQcqd96skBNt9QN8tAYp1m8DU325zmSs5Nsc770 X-Received: by 2002:a17:906:8293:: with SMTP id h19mr5222481ejx.130.1602878216446; Fri, 16 Oct 2020 12:56:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602878216; cv=none; d=google.com; s=arc-20160816; b=GiIzMpgFmgSZZYFVcQ+wScbt9rbzWyrIQ4vEGxNRYwHitX7wFpPawLav/vLzhssawq GVl1azQoomV+/PfYcQzo+D71Hxahq/TsSNChCNzaLsaYVXRCt2QWk8QDfiFpDYy5tUSn MLa8y3DMPJxrQFWUtGJ+YDb8WVLx78qCTLQpswcRUMejAnEWrHA6nGAbynWoM+eFeeAJ KItX9eLCzOL6xO+su7bNgoNX0MiuynbExNW3jcTFC3vEztuluVbMHhXTurQRivXA4Ro0 ECCijjGidAhwQP4Qpe4W3RxV+Ui57UMkif2iEruG+0o/l511fqogCZgiNKneIa8K4pw+ CDXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=HoVWWsnJtF4ldfrPYdqvQFOpOJVhRuHffI82nRexcX8=; b=Om1/iiBR5Fjyq4Urc50fKLwgIDpyJ+Kvw6trqjTNqSFJ6MN2sugCvFzJ8+47143jkt wh9NF94G/OXh7OLMiv4xdheSfEx0f+jAJoqRfWaiHZCeyRGk+ZqBQWKkcMOYDb4vvsbu 7ic6yQCd4CzI8jsTpS6OAa6Zdv0xj4FT8m/0gG+NJAUALrME+FyBIm8DSpDrQ6J5wHVk IhAg1lj6UAgJOm5ya9K72apfs7yXh1dAocI9h4dFspVE7aj7uOzEBhq39NJ9iHNZzd6f PpJcsAHjIsy1Ak036YKuNPfh5x+libSHT2uG8WOVagzgcGeXaEHNfNILDhoPe0AjN3L1 Ua/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=Jw6H43NW; 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 o13si2827808ejb.631.2020.10.16.12.56.33; Fri, 16 Oct 2020 12:56:56 -0700 (PDT) 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=@ziepe.ca header.s=google header.b=Jw6H43NW; 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 S2409666AbgJPQNN (ORCPT + 99 others); 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-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