From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A42CD69D2B; Mon, 16 Jun 2025 20:01:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750104062; cv=none; b=OAFKhK2dwusAsaI9I92YGmgUbfBMYO8ToH6mSxLnpGw85SZ4ISzuOyG9odnflyU60nDL+mHI9o2hq3HnmMiWJQoPnvV/iQf68xJapFUgZu5IzV2pvdKGd5sJ7WUlLeK6n1i3OdvDMcJS0ix3LCQ5LIQSnKmNBROQlBojoHwM3qA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750104062; c=relaxed/simple; bh=63g4BFyDRQ9zPpgQi+aKRKc8QZqr403zshqDeyAnLYU=; h=Date:From:To:CC:Subject:In-Reply-To:References:Message-ID: MIME-Version:Content-Type; b=jIc2r6LRBQWcnqoBcRYMje1JBF1wpMfBaJ9IJDGtv5E3BNw6b1fQMYrYTPc0Ki/OJUQI4q+W+mVf98FcrbXSdnoD8LwLXfSjO4uopwW1NE1Az3erIrSgTPcfbUj2oeXqZu7rkJNpmGY1Ah6kR1307S3uP4u7Apa/GQXYTflahFk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=MIbLmxFk; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="MIbLmxFk" Received: by smtp.kernel.org (Postfix) with ESMTPSA id DC77AC4CEEA; Mon, 16 Jun 2025 20:01:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1750104061; bh=63g4BFyDRQ9zPpgQi+aKRKc8QZqr403zshqDeyAnLYU=; h=Date:From:To:CC:Subject:In-Reply-To:References:From; b=MIbLmxFkQvDlWahGwOzhitZt0cSzoXdhWUHu8g8OkqZLAupve4SlpvOS2uS1ZEWmj UwQ2s8yA8tAesX44zSYXdwSfJqH8TXAO82zH05g97Z/1UOjr1700+pmtNnzQBgsvl8 4ex7UC260hPMrrevOuoNx+ItcoPEWmxAHO8kKS0LskJGXsmB+Lw+lBdLI7AmEbxTyi Xaylvf43oG7bbuZKo2MFBbk3fvcCNc7E3lsmsbzOnTEhXlMNNdjS9szSMRmncYZuuz cV+XE+08Pnq5bgJ/0F99pB6Ea9gbVg9z6nnYTpH3+D1YHFBxVujigA5wdVTvZ/xroj anLaWnk5pcMew== Date: Mon, 16 Jun 2025 13:01:00 -0700 From: Kees Cook To: Lorenzo Stoakes , Andrew Morton CC: "Liam R . Howlett" , Jens Axboe , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin , David Airlie , Simona Vetter , Eric Van Hensbergen , Latchesar Ionkov , Dominique Martinet , Christian Schoenebeck , David Sterba , David Howells , Marc Dionne , Alexander Viro , Christian Brauner , Jan Kara , Benjamin LaHaise , Miklos Szeredi , Amir Goldstein , Kent Overstreet , "Tigran A . Aivazian" , Chris Mason , Josef Bacik , Xiubo Li , Ilya Dryomov , Jan Harkes , coda@cs.cmu.edu, Tyler Hicks , Gao Xiang , Chao Yu , Yue Hu , Jeffle Xu , Sandeep Dhavale , Hongbo Li , Namjae Jeon , Sungjong Seo , Yuezhang Mo , Theodore Ts'o , Andreas Dilger , Jaegeuk Kim , OGAWA Hirofumi , Viacheslav Dubeyko , John Paul Adrian Glaubitz , Yangtao Li , Richard Weinberger , Anton Ivanov , Johannes Berg , Mikulas Patocka , David Woodhouse , Dave Kleikamp , Trond Myklebust , Anna Schumaker , Ryusuke Konishi , Konstantin Komarov , Mark Fasheh , Joel Becker , Joseph Qi , Bob Copeland , Mike Marshall , Martin Brandenburg , Steve French , Paulo Alcantara , Ronnie Sahlberg , Shyam Prasad N , Tom Talpey , Bharath SM , Zhihao Cheng , Hans de Goede , Carlos Maiolino , Damien Le Moal , Naohiro Aota , Johannes Thumshirn , Dan Williams , Matthew Wilcox , Vlastimil Babka , Jann Horn , Pedro Falcato , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, v9fs@lists.linux.dev, linux-fsdevel@vger.kernel.org, linux-afs@lists.infradead.org, linux-aio@kvack.org, linux-unionfs@vger.kernel.org, linux-bcachefs@vger.kernel.org, linux-mm@kvack.org, linux-btrfs@vger.kernel.org, ceph-devel@vger.kernel.org, codalist@coda.cs.cmu.edu, ecryptfs@vger.kernel.org, linux-erofs@lists.ozlabs.org, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-um@lists.infradead.org, linux-mtd@lists.infradead.org, jfs-discussion@lists.sourceforge.net, linux-nfs@vger.kernel.org, linux-nilfs@vger.kernel.org, ntfs3@lists.linux.dev, ocfs2-devel@lists.linux.dev, linux-karma-devel@lists.sourceforge.net, devel@lists.orangefs.org, linux-cifs@vger.kernel.org, samba-technical@lists.samba.org, linux-xfs@vger.kernel.org, nvdimm@lists.linux.dev Subject: =?US-ASCII?Q?Re=3A_=5BPATCH_03/10=5D_fs=3A_consistently_u?= =?US-ASCII?Q?se_file=5Fhas=5Fvalid=5Fmmap=5Fhooks=28=29_helper?= User-Agent: K-9 Mail for Android In-Reply-To: References: Message-ID: Precedence: bulk X-Mailing-List: linux-ext4@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On June 16, 2025 12:33:22 PM PDT, Lorenzo Stoakes wrote: >Since commit c84bf6dd2b83 ("mm: introduce new =2Emmap_prepare() file >callback"), the f_op->mmap() hook has been deprecated in favour of >f_op->mmap_prepare()=2E > >Additionally, commit bb666b7c2707 ("mm: add mmap_prepare() compatibility >layer for nested file systems") permits the use of the =2Emmap_prepare() = hook >even in nested filesystems like overlayfs=2E > >There are a number of places where we check only for f_op->mmap - this is >incorrect now mmap_prepare exists, so update all of these to use the >general helper file_has_valid_mmap_hooks()=2E > >Most notably, this updates the elf logic to allow for the ability to >execute binaries on filesystems which have the =2Emmap_prepare hook, but >additionally we update nested filesystems=2E > >Signed-off-by: Lorenzo Stoakes >--- > fs/backing-file=2Ec | 2 +- > fs/binfmt_elf=2Ec | 4 ++-- > fs/binfmt_elf_fdpic=2Ec | 2 +- Thanks for the refactoring! Acked-by: Kees Cook --=20 Kees Cook