Michal Privoznik
438b50dda8
virSetUIDGIDWithCaps: Don't drop CAP_SETPCAP right away
...
There are few cases where we execute a virCommand with all caps
cleared (virCommandClearCaps()). For instance
dnsmasqCapsRefreshInternal() does just that. This means, that
after fork() and before exec() the virSetUIDGIDWithCaps() is
called. But since the caller did not want to change anything,
just drop capabilities, these are the values of arguments:
virSetUIDGIDWithCaps (uid=-1, gid=-1, groups=0x0, ngroups=0,
capBits=0, clearExistingCaps=true)
This means that indeed all capabilities will be dropped,
including CAP_SETPCAP. But this capability controls whether
capabilities can be set, IOW whether capng_apply() succeeds.
There are two calls of capng_apply() in the function. The
CAP_SETPCAP is dropped after the first call and thus the other
call (capng_apply(CAPNG_SELECT_BOUNDS);) fails.
The solution is to keep the capability for as long as needed
(just like CAP_SETGID and CAP_SETUID) and drop it only at the
very end (just like CAP_SETGID and CAP_SETUID).
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1949388
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2021-06-29 08:52:12 +02:00
..
2021-03-17 09:16:05 +00:00
2021-03-17 09:16:05 +00:00
2021-03-02 09:50:19 +01:00
2021-03-05 20:05:54 +04:00
2021-03-22 12:44:18 +01:00
2021-03-22 12:44:18 +01:00
2020-11-20 12:09:51 +00:00
2021-04-13 17:00:38 +02:00
2021-04-13 17:00:38 +02:00
2021-04-13 17:00:38 +02:00
2021-04-13 17:00:38 +02:00
2021-04-13 17:00:38 +02:00
2021-04-13 17:00:38 +02:00
2021-04-13 17:00:38 +02:00
2021-04-13 17:00:38 +02:00
2021-04-13 17:00:38 +02:00
2021-04-13 17:00:38 +02:00
2020-09-02 10:28:10 +02:00
2020-09-02 10:28:10 +02:00
2021-04-13 17:00:38 +02:00
2021-04-13 17:00:38 +02:00
2021-04-21 10:02:09 +02:00
2021-04-13 17:00:38 +02:00
2021-04-19 11:21:40 +02:00
2021-04-19 11:21:40 +02:00
2021-04-19 11:21:40 +02:00
2021-04-19 11:21:40 +02:00
2021-04-19 11:21:40 +02:00
2021-04-14 12:06:16 +02:00
2021-04-14 12:06:16 +02:00
2021-06-15 16:27:35 +02:00
2021-06-15 16:27:35 +02:00
2021-04-13 17:00:38 +02:00
2021-05-24 20:26:20 +02:00
2021-04-13 17:00:38 +02:00
2021-02-03 13:07:13 +01:00
2021-03-04 20:52:23 +01:00
2021-03-08 12:16:13 +01:00
2020-06-15 14:50:46 +02:00
2021-04-21 14:18:31 +02:00
2021-04-21 14:18:31 +02:00
2021-02-05 00:20:43 -05:00
2021-06-04 10:56:06 +01:00
2021-03-05 15:01:29 +01:00
2020-09-23 13:26:34 +02:00
2021-03-17 09:16:05 +00:00
2020-08-07 12:43:56 +01:00
2020-08-07 12:43:56 +01:00
2020-09-23 17:06:36 +02:00
2021-03-02 09:50:19 +01:00
2021-04-13 17:00:38 +02:00
2021-06-15 21:14:03 +02:00
2021-06-15 12:42:02 +02:00
2021-04-13 17:00:38 +02:00
2021-04-13 17:00:38 +02:00
2021-04-21 14:18:39 +02:00
2021-04-13 17:00:38 +02:00
2020-10-06 12:31:34 +02:00
2021-04-13 17:00:38 +02:00
2021-04-13 17:00:38 +02:00
2020-11-09 23:42:33 +01:00
2020-09-23 12:53:31 +02:00
2020-09-02 10:28:10 +02:00
2021-04-13 17:00:38 +02:00
2021-02-11 17:05:32 +01:00
2021-02-11 17:05:32 +01:00
2021-04-15 15:42:21 +02:00
2021-04-13 17:00:38 +02:00
2020-09-01 21:58:46 +02:00
2020-09-01 21:58:46 +02:00
2021-03-02 09:50:19 +01:00
2021-04-13 17:00:38 +02:00
2021-04-13 17:00:38 +02:00
2020-05-25 16:09:41 +02:00
2021-05-24 20:26:20 +02:00
2021-02-02 15:00:55 +01:00
2021-05-17 21:06:15 +02:00
2021-05-13 11:07:40 +01:00
2021-05-13 11:07:16 +01:00
2021-04-13 17:00:38 +02:00
2021-04-13 17:00:38 +02:00
2021-04-13 17:00:38 +02:00
2021-04-13 17:00:38 +02:00
2020-08-25 19:03:11 +02:00
2020-06-26 15:39:33 +01:00
2020-06-26 15:39:33 +01:00
2021-04-13 17:00:38 +02:00
2021-04-13 17:00:38 +02:00
2021-04-13 17:00:38 +02:00
2021-04-13 17:00:38 +02:00
2021-06-15 12:42:02 +02:00
2021-04-13 17:00:38 +02:00
2021-04-13 17:00:38 +02:00
2021-04-13 17:00:38 +02:00
2021-04-13 17:00:38 +02:00
2021-04-13 17:00:38 +02:00
2021-04-15 08:51:37 -05:00
2021-04-13 17:00:38 +02:00
2020-09-02 10:28:10 +02:00
2021-05-24 20:26:20 +02:00
2021-04-21 14:19:34 +02:00
2021-04-21 14:19:34 +02:00
2021-04-21 14:19:34 +02:00
2021-06-01 14:30:39 +02:00
2021-04-13 17:00:38 +02:00
2021-04-13 17:00:38 +02:00
2021-04-13 17:00:38 +02:00
2020-12-15 13:35:33 -05:00
2021-04-13 17:00:38 +02:00
2021-06-10 01:23:47 -04:00
2021-05-20 11:30:01 +02:00
2021-04-13 17:00:38 +02:00
2021-04-13 17:00:38 +02:00
2020-12-16 14:43:18 -05:00
2021-04-13 17:00:38 +02:00
2021-04-13 17:00:38 +02:00
2021-04-13 17:00:38 +02:00
2021-04-13 17:00:38 +02:00
2021-04-13 17:00:38 +02:00
2021-04-13 17:00:38 +02:00
2021-04-13 17:00:38 +02:00
2021-04-19 11:39:13 +02:00
2021-05-17 15:54:13 +02:00
2021-04-13 17:00:38 +02:00
2021-04-13 17:00:38 +02:00
2021-05-24 20:26:20 +02:00
2021-04-13 17:00:38 +02:00
2021-04-15 15:42:21 +02:00
2021-04-16 09:48:42 +02:00
2021-04-13 17:00:38 +02:00
2021-04-13 17:00:38 +02:00
2021-03-04 20:52:23 +01:00
2021-04-13 17:00:38 +02:00
2021-04-13 17:00:38 +02:00
2021-04-13 17:00:38 +02:00
2021-04-13 17:00:38 +02:00
2021-05-24 20:26:20 +02:00
2021-04-13 17:00:38 +02:00
2021-04-13 17:00:38 +02:00
2021-04-13 17:00:38 +02:00
2021-05-13 11:07:13 +01:00
2021-05-13 11:07:13 +01:00
2021-06-21 13:17:18 +02:00
2021-04-13 17:00:38 +02:00
2021-04-13 17:00:38 +02:00
2021-04-13 17:00:38 +02:00
2021-04-13 17:00:38 +02:00
2021-04-13 17:00:38 +02:00
2021-04-13 17:00:38 +02:00
2020-11-06 15:03:39 +01:00
2021-04-13 17:00:38 +02:00
2021-04-13 17:00:38 +02:00
2021-04-13 17:00:38 +02:00
2021-04-13 17:00:38 +02:00
2021-05-13 11:07:47 +01:00
2021-04-13 17:00:38 +02:00
2021-02-03 13:07:13 +01:00
2021-02-03 13:07:13 +01:00
2021-02-17 10:15:33 +00:00
2021-04-13 17:00:38 +02:00
2021-04-13 17:00:38 +02:00
2021-04-12 15:55:09 +02:00
2021-04-12 15:55:09 +02:00
2021-04-12 15:55:10 +02:00
2021-04-12 15:55:10 +02:00
2021-04-13 17:00:38 +02:00
2021-04-13 17:00:38 +02:00
2021-04-13 17:00:38 +02:00
2021-04-13 17:00:38 +02:00
2021-04-13 17:00:38 +02:00
2021-05-07 12:33:58 +02:00
2021-04-13 17:00:38 +02:00
2021-04-13 17:00:38 +02:00
2021-04-13 17:00:38 +02:00
2020-10-06 12:31:34 +02:00
2021-04-13 17:00:38 +02:00
2021-03-22 12:44:18 +01:00
2021-04-13 17:00:38 +02:00
2021-04-13 17:00:38 +02:00
2021-04-13 17:00:38 +02:00
2021-04-13 17:00:38 +02:00
2021-04-13 17:00:38 +02:00
2021-04-13 17:00:38 +02:00
2021-06-29 08:52:12 +02:00
2021-03-05 15:33:34 +01:00
2020-12-04 16:24:19 +01:00
2020-12-04 16:24:19 +01:00
2020-11-02 22:01:36 -05:00
2020-09-02 10:28:10 +02:00
2021-05-25 13:17:22 +02:00
2021-05-25 13:17:22 +02:00