Miklos Szeredi
42fea1c352
ovl: fail on invalid uid/gid mapping at copy up
...
commit 4f11ada10d0ad3fd53e2bd67806351de63a4f9c3 upstream.
If st_uid/st_gid doesn't have a mapping in the mounter's user_ns, then
copy-up should fail, just like it would fail if the mounter task was doing
the copy using "cp -a".
There's a corner case where the "cp -a" would succeed but copy up fail: if
there's a mapping of the invalid uid/gid (65534 by default) in the user
namespace. This is because stat(2) will return this value if the mapping
doesn't exist in the current user_ns and "cp -a" will in turn be able to
create a file with this uid/gid.
This behavior would be inconsistent with POSIX ACL's, which return -1 for
invalid uid/gid which result in a failed copy.
For consistency and simplicity fail the copy of the st_uid/st_gid are
invalid.
Fixes: 459c7c565ac3 ("ovl: unprivieged mounts")
Cc: <stable@vger.kernel.org> # v5.11
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Reviewed-by: Christian Brauner <brauner@kernel.org>
Reviewed-by: Seth Forshee <sforshee@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-02-01 08:34:38 +01:00
..
2022-07-02 18:52:21 +09:00
2022-05-09 16:21:44 -04:00
2023-02-01 08:34:08 +01:00
2022-12-31 13:33:08 +01:00
2022-07-17 17:31:42 -07:00
2022-08-02 12:34:03 -04:00
2022-05-09 16:21:44 -04:00
2023-02-01 08:34:34 +01:00
2022-09-24 07:00:00 +02:00
2023-01-12 12:02:23 +01:00
2023-02-01 08:34:37 +01:00
2022-08-02 12:34:03 -04:00
2022-12-31 13:32:22 +01:00
2022-08-02 12:34:02 -04:00
2022-10-19 20:54:43 -07:00
2022-12-31 13:31:58 +01:00
2023-01-07 11:11:44 +01:00
2022-10-06 17:31:02 -07:00
2022-10-21 11:09:40 +02:00
2022-05-09 16:21:45 -04:00
2023-02-01 08:34:07 +01:00
2022-10-11 17:42:58 -06:00
2022-08-17 17:25:04 -04:00
2023-01-07 11:11:40 +01:00
2023-01-07 11:12:02 +01:00
2023-01-24 07:24:32 +01:00
2022-10-11 17:42:58 -06:00
2022-08-02 12:34:03 -04:00
2022-12-07 11:49:18 -08:00
2022-11-23 09:10:42 +01:00
2022-12-31 13:32:45 +01:00
2023-01-12 12:02:35 +01:00
2023-01-04 11:28:59 +01:00
2022-09-19 22:46:25 +02:00
2022-05-09 16:21:45 -04:00
2022-12-31 13:33:05 +01:00
2022-10-02 11:42:19 -07:00
2022-10-12 11:00:22 -07:00
2022-10-10 17:53:04 -07:00
2022-09-21 10:38:07 +02:00
2022-12-31 13:32:57 +01:00
2022-11-10 19:03:42 +01:00
2023-02-01 08:34:38 +01:00
2022-12-31 13:32:00 +01:00
2022-09-24 07:00:00 +02:00
2022-11-15 16:56:07 +00:00
2023-01-24 07:24:30 +01:00
2023-02-01 08:34:36 +01:00
2023-01-24 07:24:33 +01:00
2022-10-07 08:28:50 -07:00
2022-10-12 11:00:22 -07:00
2023-01-24 07:24:41 +01:00
2022-12-31 13:31:58 +01:00
2022-05-09 16:21:44 -04:00
2022-03-22 15:57:03 -07:00
2022-12-31 13:33:06 +01:00
2023-02-01 08:34:38 +01:00
2022-11-22 18:50:44 -08:00
2023-01-04 11:28:59 +01:00
2022-05-09 16:21:44 -04:00
2022-09-11 21:55:07 -07:00
2023-01-07 11:11:59 +01:00
2022-10-10 19:45:17 -07:00
2022-12-31 13:33:10 +01:00
2022-05-09 16:21:46 -04:00
2022-10-05 01:55:27 -05:00
2022-10-28 13:37:21 -07:00
2022-04-05 15:39:19 +02:00
2022-12-31 13:32:00 +01:00
2022-09-08 17:10:54 -04:00
2022-10-16 15:27:07 -07:00
2023-01-12 12:02:34 +01:00
2022-09-11 20:26:07 -07:00
2022-02-14 10:37:32 +09:00
2022-05-09 16:21:46 -04:00
2022-10-06 17:36:48 -07:00
2022-10-31 08:58:22 -07:00
2023-01-24 07:24:33 +01:00
2022-09-11 21:55:08 -07:00
2022-08-20 11:34:04 -04:00
2022-08-08 10:39:29 -07:00
2022-09-24 07:00:00 +02:00
2023-01-18 11:58:12 +01:00
2022-03-03 20:38:56 -08:00
2023-01-18 11:58:12 +01:00
2022-04-22 10:57:18 -07:00
2022-12-31 13:32:57 +01:00
2022-10-12 11:00:22 -07:00
2022-12-31 13:32:41 +01:00
2022-03-03 20:38:56 -08:00
2022-10-10 17:53:04 -07:00
2022-08-20 11:34:33 -04:00
2022-09-24 18:14:12 -07:00
2022-10-10 19:45:17 -07:00
2022-09-20 08:24:38 -06:00
2023-01-04 11:28:48 +01:00
2023-01-04 11:28:47 +01:00
2022-10-29 17:49:33 -07:00
2022-06-10 16:10:23 -04:00
2022-09-01 17:36:39 -04:00
2022-08-16 10:59:54 -04:00
2022-10-31 15:30:11 -04:00
2023-01-07 11:11:59 +01:00
2022-11-22 17:00:00 -05:00
2022-05-19 23:25:10 -04:00
2022-10-06 16:49:00 -07:00
2022-10-06 17:31:02 -07:00
2022-04-01 19:35:56 -07:00
2022-09-11 20:26:10 -07:00
2022-10-10 14:21:11 -07:00
2022-06-16 19:58:21 -07:00
2022-12-31 13:31:58 +01:00
2023-01-12 12:02:22 +01:00
2022-09-27 07:11:02 -07:00
2023-01-07 11:12:02 +01:00
2022-07-05 16:18:21 -04:00
2022-08-03 10:35:43 -07:00
2022-11-19 02:22:11 -05:00
2022-08-17 11:27:11 +02:00
2022-08-20 11:34:04 -04:00
2022-10-06 17:13:18 -07:00
2022-08-20 11:34:04 -04:00
2023-01-04 11:29:01 +01:00
2022-10-10 17:53:04 -07:00
2022-06-28 13:58:05 -04:00
2022-11-25 00:52:28 -05:00
2022-08-17 17:25:04 -04:00
2022-08-05 16:32:45 -07:00
2022-05-22 21:03:01 +01:00
2022-08-08 22:37:23 -04:00
2022-09-11 19:47:12 -05:00
2022-10-19 20:54:43 -07:00
2022-04-26 13:36:25 -07:00
2023-01-24 07:24:36 +01:00
2022-12-31 13:31:55 +01:00