Jann Horn
805d5a2b79
namespace: restrict OPEN_TREE_NAMESPACE/FSMOUNT_NAMESPACE to directories
...
open_tree(..., OPEN_TREE_NAMESPACE) and
fsmount(..., FSMOUNT_NAMESPACE, ...) currently work on non-directories,
like regular files. That's bad for two reasons:
- It ends up mounting a regular file over the inherited namespace root,
which is a directory; mounting a non-directory over a directory is
normally explicitly forbidden, see for example do_move_mount()
- It causes setns() on the new namespace to set the cwd to a regular
file, which the rest of VFS does not expect
Fix it by restricting create_new_namespace() (which is used by both of
these flags) to directories.
Leave the behavior for OPEN_TREE_CLONE as-is, that seems unproblematic.
Fixes: 9b8a0ba682 ("mount: add OPEN_TREE_NAMESPACE")
Cc: Al Viro <[email protected] >
Cc: Christian Brauner <[email protected] >
Cc: Jan Kara <[email protected] >
Cc: [email protected]
Signed-off-by: Jann Horn <[email protected] >
Signed-off-by: Linus Torvalds <[email protected] >
2026-06-10 07:09:20 -07:00
..
2026-05-12 14:42:30 +02:00
2026-04-25 07:44:26 -07:00
2026-04-21 07:30:44 -07:00
2026-05-12 14:42:33 +02:00
2026-04-13 14:20:11 -07:00
2026-03-06 14:31:28 +01:00
2026-04-13 12:46:42 -07:00
2026-05-23 16:54:48 -07:00
2026-05-15 15:32:43 +02:00
2026-05-11 10:39:22 +02:00
2026-04-21 14:03:10 -07:00
2026-02-21 17:09:51 -08:00
2026-03-06 14:31:28 +01:00
2026-04-13 17:29:12 -07:00
2026-04-02 16:15:23 +02:00
2026-02-21 17:09:51 -08:00
2026-03-29 11:21:22 -07:00
2026-04-20 10:54:17 -07:00
2026-04-28 12:30:59 +02:00
2026-03-06 14:31:28 +01:00
2026-06-02 01:52:58 +08:00
2026-04-13 16:57:31 -07:00
2026-04-21 07:30:44 -07:00
2026-04-15 19:22:16 -07:00
2026-04-17 17:08:31 -07:00
2026-04-21 14:50:04 -07:00
2026-04-13 12:46:42 -07:00
2026-03-06 14:31:28 +01:00
2026-05-22 15:19:26 +02:00
2026-04-15 19:12:04 -07:00
2026-04-13 14:20:11 -07:00
2026-04-13 16:50:38 -07:00
2026-02-21 17:09:51 -08:00
2026-05-25 14:48:58 +02:00
2026-05-21 19:06:11 -07:00
2026-06-06 07:28:59 -07:00
2026-04-20 17:27:28 +02:00
2026-04-17 17:08:31 -07:00
2026-03-06 14:31:28 +01:00
2026-05-11 14:19:01 +02:00
2026-04-13 19:03:11 -07:00
2026-05-26 13:49:13 -07:00
2026-04-13 12:46:42 -07:00
2026-05-12 14:42:32 +02:00
2026-06-02 10:27:45 +02:00
2026-01-02 13:43:41 -05:00
2026-05-26 13:49:13 -07:00
2026-04-15 12:59:16 -07:00
2026-04-27 16:40:24 -07:00
2026-05-11 23:30:48 +09:00
2026-04-20 10:59:47 -07:00
2026-04-21 07:30:44 -07:00
2026-04-13 14:20:11 -07:00
2026-05-11 14:19:01 +02:00
2026-05-18 14:56:15 +02:00
2026-04-16 20:11:56 -07:00
2026-04-15 12:59:16 -07:00
2026-04-13 12:46:42 -07:00
2026-05-28 14:16:33 +02:00
2026-03-25 13:15:36 +01:00
2026-04-05 13:53:07 -07:00
2026-04-15 12:59:16 -07:00
2026-02-18 20:50:32 -08:00
2026-05-31 19:13:48 -05:00
2026-02-24 11:13:27 -08:00
2026-05-20 17:13:20 +02:00
2026-03-18 11:41:53 -07:00
2026-04-22 15:09:01 -07:00
2026-04-16 20:11:56 -07:00
2026-04-22 17:14:48 +02:00
2026-04-13 12:46:42 -07:00
2026-02-21 17:09:51 -08:00
2026-02-21 17:09:51 -08:00
2026-04-13 12:19:01 -07:00
2026-05-30 08:26:18 +02:00
2026-05-12 07:53:20 +09:00
2026-04-24 00:34:59 +02:00
2026-04-07 11:26:11 +02:00
2026-04-03 16:53:50 -04:00
2026-01-12 14:01:32 +01:00
2026-04-13 12:19:01 -07:00
2026-04-05 13:53:39 -07:00
2026-02-21 17:09:51 -08:00
2026-01-02 12:04:28 -08:00
2026-04-23 17:08:04 -07:00
2026-02-21 17:09:51 -08:00
2026-04-13 14:20:11 -07:00
2026-04-07 12:32:22 +02:00
2026-04-21 14:12:01 -07:00
2026-04-21 07:30:44 -07:00
2026-02-21 17:09:51 -08:00
2026-04-24 00:37:01 +02:00
2026-04-01 12:26:07 -07:00
2026-02-21 17:09:51 -08:00
2026-06-04 09:39:50 +02:00
2026-02-25 10:34:23 -08:00
2026-04-13 15:17:28 -07:00
2026-04-13 14:20:11 -07:00
2026-01-16 12:52:04 -05:00
2026-04-13 14:20:11 -07:00
2026-02-19 14:34:26 +01:00
2026-01-14 16:50:37 +01:00
2026-04-23 17:08:04 -07:00
2026-03-06 14:31:28 +01:00
2026-02-21 17:09:51 -08:00
2026-02-09 16:58:28 -08:00
2026-05-11 15:32:12 +02:00
2026-04-13 15:17:28 -07:00
2026-02-19 21:51:00 +09:00
2026-04-13 12:46:42 -07:00
2026-04-20 10:44:02 -07:00
2026-02-19 21:51:00 +09:00
2026-04-13 14:20:11 -07:00
2026-05-11 14:19:01 +02:00
2026-06-04 09:39:50 +02:00
2026-04-15 12:59:16 -07:00
2026-05-28 14:14:04 +02:00
2026-06-10 07:09:20 -07:00
2026-05-11 15:59:14 +02:00
2026-01-12 16:52:09 +01:00
2026-03-23 12:41:58 +01:00
2026-04-13 13:27:11 -07:00
2026-03-06 14:31:28 +01:00
2026-02-21 01:02:28 -08:00
2026-01-12 10:55:45 +01:00
2026-03-24 14:44:02 +01:00
2026-05-12 14:41:40 +02:00
2026-02-21 01:02:28 -08:00
2026-02-21 17:09:51 -08:00
2026-02-21 17:09:51 -08:00
2026-01-16 12:52:04 -05:00
2026-01-16 12:52:04 -05:00
2026-02-21 17:09:51 -08:00
2026-02-21 01:02:28 -08:00
2026-02-21 17:09:51 -08:00
2026-04-18 00:10:56 -07:00
2026-01-16 12:52:03 -05:00
2026-03-02 11:06:42 +01:00