Files
linux/include/linux
Lorenzo Stoakes 55933e9538 mm: update memfd seal write check to include F_SEAL_WRITE
[ Upstream commit 28464bbb2d ]

The seal_check_future_write() function is called by shmem_mmap() or
hugetlbfs_file_mmap() to disallow any future writable mappings of an memfd
sealed this way.

The F_SEAL_WRITE flag is not checked here, as that is handled via the
mapping->i_mmap_writable mechanism and so any attempt at a mapping would
fail before this could be run.

However we intend to change this, meaning this check can be performed for
F_SEAL_WRITE mappings also.

The logic here is equally applicable to both flags, so update this
function to accommodate both and rename it accordingly.

Link: https://lkml.kernel.org/r/913628168ce6cce77df7d13a63970bae06a526e0.1697116581.git.lstoakes@gmail.com
Signed-off-by: Lorenzo Stoakes <lstoakes@gmail.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Christian Brauner <brauner@kernel.org>
Cc: Hugh Dickins <hughd@google.com>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Mike Kravetz <mike.kravetz@oracle.com>
Cc: Muchun Song <muchun.song@linux.dev>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Cc: stable@vger.kernel.org
Signed-off-by: Isaac J. Manjarres <isaacmanjarres@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-08-28 16:21:36 +02:00
..
2019-08-09 09:15:05 +02:00
2019-09-17 10:27:46 -07:00
2020-02-19 19:53:09 +01:00
2019-08-20 22:09:52 +02:00
2022-10-26 13:22:39 +02:00
2019-08-28 21:17:12 -06:00
2024-07-05 09:08:31 +02:00
2023-08-08 19:56:33 +02:00
2023-12-20 15:41:18 +01:00
2020-03-25 08:25:58 +01:00
2019-09-05 11:40:54 +02:00
2019-10-02 06:36:50 -07:00
2019-07-05 21:34:50 +02:00
2023-10-25 11:53:22 +02:00
2022-10-26 13:22:46 +02:00
2022-04-15 14:18:32 +02:00
2019-12-13 08:42:53 +01:00
2021-03-04 10:26:29 +01:00
2022-08-25 11:18:04 +02:00
2021-02-07 15:35:49 +01:00
2019-12-13 08:43:18 +01:00
2019-08-14 15:30:35 +02:00
2023-09-23 10:59:40 +02:00
2025-03-13 12:43:17 +01:00
2023-06-21 15:44:10 +02:00
2025-07-17 18:24:52 +02:00
2019-07-16 19:23:25 -07:00
2020-03-18 07:17:46 +01:00
2025-06-04 14:32:36 +02:00
2025-08-28 16:21:18 +02:00
2023-11-28 16:50:16 +00:00
2023-10-25 11:53:18 +02:00
2023-10-25 11:53:18 +02:00
2020-04-02 15:11:00 +02:00
2021-03-07 12:20:49 +01:00
2024-07-05 09:08:31 +02:00
2019-07-31 19:03:35 +02:00
2024-02-23 08:24:47 +01:00
2020-04-02 15:11:00 +02:00
2021-06-10 13:37:14 +02:00