Michal Privoznik
8b1660e530
security: Don't remember owner for shared resources
...
This effectively reverts d7420430ce6 and adds new code.
Here is the problem: Imagine a file X that is to be shared
between two domains as a disk. Let the first domain (vm1) have
seclabel remembering turned on and the other (vm2) has it turned
off. Assume that both domains will run under the same user, but
the original owner of X is different (i.e. trying to access X
without relabelling leads to EPERM).
Let's start vm1 first. This will cause X to be relabelled and to
gain new attributes:
trusted.libvirt.security.ref_dac="1"
trusted.libvirt.security.dac="$originalOwner"
When vm2 is started, X will again be relabelled, but since the
new label is the same as X already has (because of vm1) nothing
changes and vm1 and vm2 can access X just fine. Note that no
XATTR is changed (especially the refcounter keeps its value of 1)
because the vm2 domain has the feature turned off.
Now, vm1 is shut off and vm2 continues running. In seclabel
restore process we would get to X and since its refcounter is 1
we would restore the $originalOwner on it. But this is unsafe to
do because vm2 is still using X (remember the assumption that
$originalOwner and vm2's seclabel are distinct?).
The problem is that refcounter stored in XATTRs doesn't reflect
the actual times a resource is in use. Since I don't see any easy
way around it let's just not store original owner on shared
resources. Shared resource in world of domain disks is:
- whole backing chain but the top layer,
- read only disk (we don't require CDROM to be explicitly
marked as shareable),
- disk marked as shareable.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2019-07-03 08:36:04 +02:00
..
2019-02-24 13:20:51 +04:00
2019-02-24 13:20:51 +04:00
2018-12-03 14:31:41 +01:00
2018-12-17 15:02:11 +00:00
2019-06-20 14:02:36 +02:00
2019-06-20 14:02:36 +02:00
2019-06-20 17:08:53 +02:00
2019-06-20 17:08:53 +02:00
2019-04-16 13:46:17 +02:00
2019-04-16 13:46:17 +02:00
2019-03-13 12:06:52 -06:00
2019-03-06 15:53:53 +01:00
2019-02-21 13:06:16 -05:00
2019-05-23 16:29:48 +01:00
2019-02-01 12:57:13 -05:00
2019-02-01 12:57:13 -05:00
2019-03-22 12:59:56 +03:00
2018-07-10 13:37:51 +02:00
2019-06-20 09:13:37 +02:00
2019-02-05 17:15:05 +01:00
2019-03-12 15:29:44 +01:00
2019-04-18 17:08:33 +02:00
2019-04-18 17:08:33 +02:00
2018-08-13 15:50:01 +02:00
2019-06-25 16:42:28 +02:00
2019-06-26 12:28:31 +02:00
2019-06-26 12:28:31 +02:00
2019-03-13 12:06:52 -06:00
2019-03-07 12:01:09 +01:00
2019-01-29 19:16:19 -05:00
2019-06-25 17:11:56 +02:00
2019-06-25 17:11:56 +02:00
2018-12-17 14:43:33 +00:00
2018-12-17 14:43:33 +00:00
2019-03-06 11:12:48 -05:00
2019-06-03 17:59:38 +02:00
2018-09-20 13:06:02 -04:00
2018-10-05 15:53:29 +02:00
2019-06-21 12:59:42 +01:00
2019-02-26 11:41:18 +01:00
2018-08-14 15:52:35 +02:00
2019-04-03 14:44:32 +02:00
2018-08-13 15:50:01 +02:00
2019-06-21 12:59:42 +01:00
2019-06-17 15:19:54 +01:00
2018-06-26 11:22:07 +01:00
2018-08-13 14:19:41 -04:00
2019-04-15 20:03:55 -04:00
2019-04-16 13:11:08 -04:00
2019-04-16 13:11:08 -04:00
2019-04-16 13:11:08 -04:00
2019-04-15 20:03:55 -04:00
2019-02-24 13:20:51 +04:00
2019-02-24 13:20:51 +04:00
2018-08-15 10:15:29 +02:00
2018-09-20 10:16:39 +02:00
2019-05-17 16:01:11 +02:00
2019-06-20 00:22:39 +02:00
2019-02-11 17:40:44 -05:00
2019-06-20 00:22:38 +02:00
2018-12-13 16:08:38 +00:00
2019-06-20 17:08:53 +02:00
2018-09-20 10:16:39 +02:00
2019-04-10 12:26:32 +02:00
2018-12-13 16:08:38 +00:00
2018-08-15 10:15:29 +02:00
2019-04-16 13:46:17 +02:00
2019-04-11 12:47:23 -04:00
2018-09-20 10:16:39 +02:00
2018-07-27 15:44:38 +02:00
2019-02-11 17:40:44 -05:00
2019-03-14 10:05:25 +01:00
2018-12-11 15:03:08 -05:00
2018-09-20 10:16:39 +02:00
2019-06-20 12:15:05 +02:00
2019-03-08 14:59:20 +01:00
2019-01-31 17:45:41 +01:00
2019-05-23 16:29:48 +01:00
2019-01-31 17:45:41 +01:00
2018-09-20 10:16:39 +02:00
2018-09-20 10:16:39 +02:00
2018-12-13 16:08:38 +00:00
2018-12-13 16:08:38 +00:00
2018-12-13 16:08:38 +00:00
2018-12-14 10:47:13 +00:00
2019-03-14 10:05:25 +01:00
2018-09-20 10:16:39 +02:00
2019-04-10 12:26:32 +02:00
2018-12-17 17:52:46 +01:00
2018-09-20 10:16:39 +02:00
2018-08-13 15:50:01 +02:00
2019-05-06 18:05:17 -05:00
2019-06-07 16:18:45 +02:00
2018-12-13 16:08:38 +00:00
2019-04-20 07:48:42 +02:00
2018-06-19 14:01:14 +02:00
2018-12-14 10:47:13 +00:00
2018-12-13 16:08:38 +00:00
2018-08-13 15:50:01 +02:00
2019-06-03 18:07:16 +02:00
2019-04-10 13:58:30 +02:00
2019-06-20 13:47:41 +02:00
2019-03-14 10:05:25 +01:00
2018-12-14 10:47:13 +00:00
2019-06-20 00:22:39 +02:00
2019-06-20 13:47:41 +02:00
2019-06-19 17:12:34 +02:00
2019-07-03 08:36:04 +02:00
2019-07-03 08:36:04 +02:00
2019-07-03 08:36:04 +02:00
2019-01-24 18:59:38 -05:00
2019-06-26 10:37:51 +02:00
2019-06-26 10:37:54 +02:00
2019-04-10 12:26:32 +02:00
2018-11-16 13:42:39 +01:00
2018-09-20 10:16:39 +02:00
2018-09-20 10:16:39 +02:00
2018-12-05 10:39:54 +01:00
2018-11-16 13:42:39 +01:00
2018-09-20 10:16:39 +02:00
2018-09-20 10:16:39 +02:00
2018-09-20 10:16:39 +02:00
2018-09-20 10:16:39 +02:00
2018-12-13 16:08:38 +00:00
2019-02-12 08:51:23 -05:00
2019-03-07 12:12:11 +01:00
2019-05-14 15:58:37 +02:00
2019-06-25 17:11:56 +02:00
2019-02-12 08:51:23 -05:00
2019-02-12 08:51:23 -05:00
2019-06-03 17:51:12 +02:00
2019-04-04 09:35:40 -05:00
2019-03-14 10:05:21 +01:00
2019-06-19 17:12:34 +02:00
2019-06-19 17:12:34 +02:00
2018-09-20 10:16:39 +02:00
2019-06-19 17:12:34 +02:00
2019-06-04 20:56:58 +02:00
2019-06-19 17:12:34 +02:00
2019-04-17 08:30:55 +02:00
2019-06-19 17:12:34 +02:00
2018-11-26 16:38:26 -07:00
2019-06-19 17:12:34 +02:00
2018-09-20 10:16:39 +02:00
2019-04-10 12:26:32 +02:00
2018-12-13 16:08:38 +00:00
2019-06-04 09:29:35 +02:00
2019-05-04 23:39:35 +02:00
2018-12-13 16:08:38 +00:00
2018-09-20 10:16:39 +02:00
2019-04-10 09:12:04 +02:00
2018-12-14 10:47:13 +00:00
2018-09-20 10:16:39 +02:00
2018-12-13 16:08:38 +00:00
2018-12-14 10:47:13 +00:00
2018-12-13 16:08:38 +00:00
2018-12-17 17:52:46 +01:00
2018-12-18 10:12:09 -05:00
2019-02-03 17:46:29 -05:00
2019-05-07 09:56:17 +02:00
2019-04-10 12:26:32 +02:00
2019-04-10 12:26:32 +02:00
2019-06-19 17:12:34 +02:00
2019-02-01 12:08:37 -05:00
2019-06-19 17:12:34 +02:00
2018-12-05 10:39:54 +01:00
2018-12-14 10:47:13 +00:00
2019-05-04 23:39:35 +02:00
2018-12-13 16:08:38 +00:00
2018-12-14 10:47:13 +00:00
2019-04-03 14:44:32 +02:00
2019-04-11 12:47:23 -04:00
2018-12-13 16:08:38 +00:00
2019-02-14 18:03:10 +01:00
2019-04-10 12:26:32 +02:00
2018-12-13 16:08:38 +00:00
2019-06-19 17:12:34 +02:00
2019-04-03 11:31:38 +01:00
2018-12-13 16:08:38 +00:00
2019-06-21 12:59:42 +01:00
2018-12-13 16:08:38 +00:00
2019-06-17 15:19:54 +01:00
2018-12-13 16:08:38 +00:00
2018-12-13 16:08:38 +00:00
2018-12-13 16:08:38 +00:00
2018-12-13 16:08:38 +00:00
2018-12-13 16:08:38 +00:00
2019-04-10 12:26:32 +02:00
2019-04-10 12:26:32 +02:00
2019-04-10 12:26:32 +02:00
2019-06-19 17:12:34 +02:00
2019-04-10 12:26:32 +02:00
2019-06-17 15:19:54 +01:00
2018-09-20 10:16:39 +02:00
2019-06-17 17:47:18 +02:00
2018-12-13 16:08:38 +00:00
2019-04-15 12:47:44 -04:00
2018-12-13 16:08:38 +00:00
2018-12-13 16:08:38 +00:00
2018-12-13 16:08:38 +00:00
2018-12-14 10:47:13 +00:00
2018-12-13 16:08:38 +00:00
2019-06-20 12:15:05 +02:00
2019-04-10 12:26:32 +02:00
2019-04-04 09:35:40 -05:00
2018-10-12 09:30:56 -05:00
2019-04-04 09:35:40 -05:00
2019-03-25 09:01:53 -05:00
2019-05-06 18:05:17 -05:00
2019-02-12 08:51:23 -05:00
2018-12-13 16:08:38 +00:00
2018-12-14 10:47:13 +00:00
2019-01-23 07:54:58 +01:00
2019-05-07 11:01:14 +02:00
2018-12-13 16:08:38 +00:00
2018-09-20 10:16:38 +02:00
2019-06-12 09:26:25 +02:00
2018-12-13 16:08:38 +00:00
2018-12-13 16:08:38 +00:00
2018-09-20 10:16:39 +02:00
2019-04-15 20:03:55 -04:00
2019-02-12 10:14:53 +01:00
2019-04-16 13:11:08 -04:00
2019-04-16 13:11:08 -04:00
2019-04-16 13:11:08 -04:00
2019-04-15 20:03:55 -04:00