Serge Hallyn
ed9b25d197
[SECURITY] fix namespaced fscaps when !CONFIG_SECURITY
...
Namespaced file capabilities were introduced in 8db6c34f1d .
When userspace reads an xattr for a namespaced capability, a
virtualized representation of it is returned if the caller is
in a user namespace owned by the capability's owning rootid.
The function which performs this virtualization was not hooked
up if CONFIG_SECURITY=n. Therefore in that case the original
xattr was shown instead of the virtualized one.
To test this using libcap-bin (*1),
$ v=$(mktemp)
$ unshare -Ur setcap cap_sys_admin-eip $v
$ unshare -Ur setcap -v cap_sys_admin-eip $v
/tmp/tmp.lSiIFRvt8Y: OK
"setcap -v" verifies the values instead of setting them, and
will check whether the rootid value is set. Therefore, with
this bug un-fixed, and with CONFIG_SECURITY=n, setcap -v will
fail:
$ v=$(mktemp)
$ unshare -Ur setcap cap_sys_admin=eip $v
$ unshare -Ur setcap -v cap_sys_admin=eip $v
nsowner[got=1000, want=0],/tmp/tmp.HHDiOOl9fY differs in []
Fix this bug by calling cap_inode_getsecurity() in
security_inode_getsecurity() instead of returning
-EOPNOTSUPP, when CONFIG_SECURITY=n.
*1 - note, if libcap is too old for getcap to have the '-n'
option, then use verify-caps instead.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=209689
Cc: Hervé Guillemet <herve@guillemet.org >
Acked-by: Casey Schaufler <casey@schaufler-ca.com >
Signed-off-by: Serge Hallyn <shallyn@cisco.com >
Signed-off-by: Andrew G. Morgan <morgan@kernel.org >
Signed-off-by: James Morris <jamorris@linux.microsoft.com >
2020-12-04 16:24:11 -08:00
..
2020-09-30 16:37:39 +02:00
2020-08-24 10:33:08 +02:00
2020-08-03 11:05:26 +02:00
2020-07-31 11:49:08 +02:00
2020-08-12 10:57:59 -07:00
2020-08-03 18:19:23 -07:00
2020-08-05 11:43:47 -07:00
2020-08-05 20:13:21 -07:00
2020-08-04 01:22:02 +02:00
2020-08-12 10:57:59 -07:00
2020-08-07 12:58:11 -07:00
2020-08-15 08:09:38 -07:00
2020-10-02 10:59:55 -07:00
2020-08-05 20:13:21 -07:00
2020-08-07 08:54:16 +02:00
2020-08-28 20:11:58 +02:00
2020-09-24 14:04:53 +03:00
2020-07-29 22:33:10 +02:00
2020-09-09 14:28:18 -07:00
2020-07-28 17:11:02 -07:00
2020-08-17 09:39:18 -07:00
2020-08-16 22:00:22 +01:00
2020-07-27 14:55:22 +01:00
2020-08-15 08:26:55 -07:00
2020-08-05 20:13:21 -07:00
2020-07-28 15:51:31 +01:00
2020-09-30 22:27:51 +01:00
2020-08-03 19:30:59 -07:00
2020-08-12 10:57:59 -07:00
2020-08-10 12:16:51 -07:00
2020-09-25 07:54:50 -06:00
2020-07-28 10:22:19 -06:00
2020-09-15 20:08:14 -04:00
2020-08-06 16:39:14 -07:00
2020-08-12 10:57:59 -07:00
2020-09-02 20:59:40 -06:00
2020-08-03 15:07:18 -07:00
2020-08-12 10:57:56 -07:00
2020-08-23 17:36:59 -05:00
2020-08-27 09:53:06 +02:00
2020-08-29 09:29:32 +02:00
2020-08-12 10:57:59 -07:00
2020-08-04 13:49:43 -07:00
2020-08-03 14:25:40 -07:00
2020-08-27 12:51:25 +02:00
2020-09-17 18:12:18 +01:00
2020-09-16 19:36:26 +02:00
2020-08-12 10:58:01 -07:00
2020-09-21 06:53:09 -07:00
2020-07-29 16:14:27 +02:00
2020-08-12 10:57:59 -07:00
2020-07-30 19:26:10 +02:00
2020-07-30 17:22:57 +09:00
2020-08-03 11:57:03 -07:00
2020-09-10 19:19:42 +02:00
2020-08-14 15:22:43 -07:00
2020-08-14 16:27:00 +02:00
2020-08-14 16:27:00 +02:00
2020-07-29 16:14:25 +02:00
2020-08-07 12:41:36 -07:00
2020-09-04 17:21:56 +02:00
2020-08-06 16:13:13 +02:00
2020-09-10 18:19:16 +02:00
2020-08-07 11:33:28 -07:00
2020-07-27 14:29:22 -04:00
2020-07-27 14:29:23 -04:00
2020-09-04 15:50:14 +02:00
2020-08-12 10:57:59 -07:00
2020-07-27 23:24:00 +02:00
2020-08-04 07:37:23 +02:00
2020-08-23 17:36:59 -05:00
2020-09-25 10:28:51 +02:00
2020-08-12 10:57:57 -07:00
2020-09-16 19:12:27 -04:00
2020-07-29 16:14:27 +02:00
2020-08-28 10:57:14 -07:00
2020-07-27 23:25:50 +02:00
2020-07-27 23:24:00 +02:00
2020-09-19 13:13:39 -07:00
2020-08-12 10:57:59 -07:00
2020-09-01 12:06:41 +02:00
2020-08-12 10:57:57 -07:00
2020-08-06 16:13:13 +02:00
2020-08-14 19:56:56 -07:00
2020-08-12 10:58:02 -07:00
2020-08-06 17:54:04 +02:00
2020-09-09 10:22:40 +02:00
2020-08-13 18:41:00 -07:00
2020-08-03 10:54:54 +02:00
2020-08-04 21:02:38 -04:00
2020-07-30 08:22:33 +02:00
2020-07-27 14:17:36 +02:00
2020-07-30 11:16:01 -07:00
2020-08-14 19:56:57 -07:00
2020-08-14 19:56:57 -07:00
2020-07-29 14:42:00 +02:00
2020-07-27 16:20:40 +02:00
2020-08-26 12:41:56 +02:00
2020-08-21 11:03:38 -07:00
2020-08-23 17:36:59 -05:00
2020-08-07 11:33:28 -07:00
2020-08-28 11:21:20 -07:00
2020-07-29 23:47:53 +10:00
2020-10-11 10:31:11 -07:00
2020-09-18 14:27:24 -04:00
2020-09-04 09:25:20 -07:00
2020-08-06 16:13:13 +02:00
2020-08-21 14:04:14 +01:00
2020-07-29 16:14:29 +02:00
2020-08-12 10:57:59 -07:00
2020-09-02 11:31:23 -06:00
2020-07-28 19:29:22 -06:00
2020-08-02 20:39:44 -07:00
2020-07-28 10:45:46 +02:00
2020-08-26 12:41:53 +02:00
2020-09-05 12:14:30 -07:00
2020-08-11 14:30:36 -07:00
2020-08-11 14:30:36 -07:00
2020-08-07 21:27:37 -07:00
2020-08-14 19:56:57 -07:00
2020-08-12 10:57:56 -07:00
2020-09-04 09:59:59 +02:00
2020-09-28 12:16:13 +02:00
2020-08-12 10:58:02 -07:00
2020-08-14 19:56:56 -07:00
2020-09-27 11:21:35 -07:00
2020-09-27 11:21:35 -07:00
2020-08-07 11:33:26 -07:00
2020-08-26 12:41:53 +02:00
2020-08-07 11:33:21 -07:00
2020-09-26 10:33:57 -07:00
2020-08-05 10:31:28 +02:00
2020-07-31 18:08:59 +10:00
2020-08-06 16:13:13 +02:00
2020-10-02 15:27:08 -07:00
2020-09-10 13:30:22 -07:00
2020-10-02 15:15:56 -07:00
2020-08-13 04:16:15 +02:00
2020-08-15 08:26:55 -07:00
2020-09-18 09:25:33 -04:00
2020-09-26 10:33:57 -07:00
2020-07-29 07:45:20 +02:00
2020-07-29 07:45:21 +02:00
2020-07-29 17:12:08 +02:00
2020-07-29 17:12:08 +02:00
2020-07-28 22:49:52 +02:00
2020-07-28 15:51:32 +01:00
2020-07-28 15:51:32 +01:00
2020-07-28 15:51:32 +01:00
2020-08-03 19:30:59 -07:00
2020-08-12 10:57:56 -07:00
2020-08-07 11:33:29 -07:00
2020-10-11 10:31:10 -07:00
2020-08-12 12:09:36 -07:00
2020-08-07 18:48:15 -07:00
2020-08-07 11:33:26 -07:00
2020-09-16 16:26:56 +02:00
2020-08-05 20:13:21 -07:00
2020-09-26 10:33:57 -07:00
2020-08-03 15:01:02 -07:00
2020-08-17 11:46:22 -07:00
2020-10-01 19:14:36 -07:00
2020-07-28 17:07:06 -07:00
2020-08-04 12:44:53 +02:00
2020-08-04 12:39:28 +02:00
2020-07-27 13:52:36 +02:00
2020-08-12 10:57:59 -07:00
2020-08-06 16:50:59 +02:00
2020-07-31 14:33:56 +02:00
2020-09-10 19:27:59 +02:00
2020-08-03 23:24:26 -07:00
2020-08-03 23:24:26 -07:00
2020-08-03 14:39:35 -07:00
2020-07-27 14:31:13 -04:00
2020-08-04 20:16:37 -07:00
2020-07-28 17:09:49 -07:00
2020-08-26 12:41:51 +02:00
2020-08-04 21:00:11 -07:00
2020-12-04 16:24:11 -08:00
2020-08-06 16:13:13 +02:00
2020-07-29 17:14:38 +02:00
2020-09-16 13:22:44 +02:00
2020-08-07 11:33:24 -07:00
2020-08-23 17:36:59 -05:00
2020-09-09 11:04:39 -07:00
2020-08-07 11:33:25 -07:00
2020-08-07 11:33:25 -07:00
2020-08-07 11:33:25 -07:00
2020-08-10 12:06:44 -07:00
2020-09-19 13:13:39 -07:00
2020-07-28 19:28:32 -06:00
2020-08-12 10:57:56 -07:00
2020-08-14 19:56:56 -07:00
2020-08-14 19:56:56 -07:00
2020-07-27 14:11:22 +02:00
2020-07-31 17:00:44 -07:00
2020-08-06 16:13:13 +02:00
2020-08-07 17:05:01 -04:00
2020-08-03 13:34:37 -04:00
2020-07-29 16:14:18 +02:00
2020-08-12 10:57:59 -07:00
2020-08-05 19:00:23 -04:00
2020-08-01 11:28:17 +02:00
2020-08-06 16:13:13 +02:00
2020-08-05 11:08:41 -04:00
2020-08-05 19:56:03 -04:00
2020-08-05 09:30:19 -04:00
2020-09-04 09:31:54 -07:00
2020-10-02 09:13:41 -07:00
2020-09-17 10:26:41 -07:00
2020-10-01 09:40:35 -04:00
2020-08-05 18:43:02 +02:00
2020-08-12 10:57:59 -07:00
2020-08-06 16:13:13 +02:00
2020-08-09 13:58:04 -07:00
2020-08-12 10:57:59 -07:00
2020-08-12 10:57:59 -07:00
2020-08-12 10:57:59 -07:00