Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp1622366pxb; Fri, 6 Nov 2020 14:50:15 -0800 (PST) X-Google-Smtp-Source: ABdhPJxQy4DzCbgXNpc0VJlIXbLHemreE7D2yr6DhoKIhFKxkG5Ca9cWv9N2nidAtNSpNZhuU9FL X-Received: by 2002:aa7:d64b:: with SMTP id v11mr4390904edr.253.1604703014838; Fri, 06 Nov 2020 14:50:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604703014; cv=none; d=google.com; s=arc-20160816; b=neAY2pwVV8mg9lc1pZYfmTSBnsz3qJ0zHMfU3D1EZUHZnrzYga+ii3hrkYXnwlU6kh nesmqVqSaldgmYWnqTUSrwhUU6iMvecgGt/9yuR/HJf+MQjISSe2n+c8Jt5dWub0dbYD fIY+A2FXM7AoVNcuLpWM38voNBcdXwq/BIaG5C88ibS3FjnOB5n7gMhwR92DlpXVd7ul 9yFeZeFcZ8FfVyZqBY6tEu+kGtm/Ixe2LBFjeTMmO6OSCFCnQAiY8c911DTzdILALLk/ RthIrhiz40hX+eV0Dve5wcY0LhAvID3jM1kGnjfTiD50/m0oSTc+t5sq7Jk1+Nh9GKo5 KrHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=soTtYNFlceAjgOaZMHj0Ytx6ULMu5byS0w32gfdeLv0=; b=aDxqnS8BiOSZQmGPLYAf1Pm4Wff9LaYsLxs7kWR6KVmjXa0wG1c7YYIoh01rSqQgOr fbl8Q2FSInIfD8zLW4XXKQTktXs0KTZRyQaX0yBmYrQfxFNVWx4G0aQeE1x8DfnfhzRq EXu3llUvzg3ybW7pajFZ/IfInG6XGEtroyI68rlE2uPJoaY3r/GCNefbtklSRVrkbxWm y5ziZHmMi0rjVGWAHeFzS21VwZH0FEVeyav4OXYLw280I5ITZyz9J2PldvlsrnnDZ+YY Z2E8u1Pw+qdCi9NaLv+3OTwpvHRGFOkzZaHzoNKTgh8Eia8uDZ3XFQ8rp6tXnvQWC9G8 RKpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@kernel.org header.s=default header.b=GgJzvJbY; 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 i18si1977277edy.422.2020.11.06.14.49.52; Fri, 06 Nov 2020 14:50:14 -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=fail header.i=@kernel.org header.s=default header.b=GgJzvJbY; 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 S1728685AbgKFWsX (ORCPT + 99 others); Fri, 6 Nov 2020 17:48:23 -0500 Received: from mail.kernel.org ([198.145.29.99]:48734 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728358AbgKFWsN (ORCPT ); Fri, 6 Nov 2020 17:48:13 -0500 Received: from localhost.localdomain (c-73-231-172-41.hsd1.ca.comcast.net [73.231.172.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9578E2087E; Fri, 6 Nov 2020 22:48:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604702893; bh=Oj1ydksyNqQ3ZwyWkWH+O74qkDDreoYI/9+2rwNutow=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=GgJzvJbYnUHZVh/KVjPbUkpsfTIS+ixIdR5hDbc8e6O11e3cdgusrJ+SXHU1mNK02 T1pf6Ysk+sGbT7IeHtbS79IjEOVb10BsqWj7Z/BpfjH8Hjsl5L51bZ3setY8WJNtnr JcdIhGHQmomXcxD8lLvJYy+d8B/elDLs+I2TO9iQ= Date: Fri, 6 Nov 2020 14:48:11 -0800 From: Andrew Morton To: =?ISO-8859-1?Q? "Christian_K=F6nig" ?= Cc: 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 Subject: Re: [PATCH 1/2] mm: mmap: fix fput in error path v2 Message-Id: <20201106144811.cf228ca9278ec78887d42960@linux-foundation.org> In-Reply-To: <20201106114806.46015-2-christian.koenig@amd.com> References: <20201106114806.46015-1-christian.koenig@amd.com> <20201106114806.46015-2-christian.koenig@amd.com> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 6 Nov 2020 12:48:05 +0100 "Christian K=F6nig" 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 Seems correct, best I can tell. Presumably all ->mmap() instances will correctly fput() to original file* if they're rewriting vma->vm_file.