Raito Bezarius
7bd82718e2
libstore/platform/linux: destroy cgroup before we release user locks
...
User locks are taken to avoid another build grabbing the same UID.
Under build user contention, it is possible to recycle the same UID from
another build which did not run the Goal destructor yet.
Prior to this change, cgroups were destroyed at Goal destruction time,
but user locks were released at `buildDone()` time.
Therefore, it was possible to have 2 builds fights for the same cgroup
and mess with it, resulting in confusion.
To avoid this, we override `cleanupHookFinally` in charge to release the
user locks and we destroy the cgroup before releasing the locks.
Statistics are kept in the `cgroup` object a bit longer and can be
obtained at `killSandbox(true)` time.
`AutoDestroyCgroup::kill` now ignore if the cgroup path has already been
destroyed, as kill is idempotent.
Reported-by: Ramses <@rvdp:infosec.exchange>
Reported-by: Frederico Schonborn <@fredericoschonborn:matrix.org>
Change-Id: Idfbf9aaf010c5f718f2c1c38548383d912d8ee95
Signed-off-by: Raito Bezarius <raito@lix.systems >
2025-06-11 13:47:38 +02:00
..
2025-06-10 23:29:10 +02:00
2024-11-19 22:55:32 +00:00
2025-03-15 16:17:25 +01:00
2025-06-11 13:47:38 +02:00
2025-06-10 20:50:00 +02:00
2025-06-10 15:22:22 +00:00
2025-05-20 17:43:46 +00:00
2024-11-19 22:55:32 +00:00
2024-11-19 22:55:32 +00:00
2024-11-19 22:55:32 +00:00
2025-06-06 18:09:46 +02:00
2025-06-06 18:09:46 +02:00
2025-06-06 18:09:46 +02:00
2024-11-19 22:55:32 +00:00
2024-11-19 22:55:32 +00:00
2024-11-19 22:55:32 +00:00
2024-11-19 22:55:32 +00:00
2025-06-06 18:09:46 +02:00
2025-04-25 17:09:01 +02:00
2025-06-06 18:09:46 +02:00
2025-06-06 18:09:46 +02:00
2025-05-20 17:43:46 +00:00
2025-05-12 13:37:54 +02:00
2025-05-20 17:43:46 +00:00
2024-11-19 22:55:32 +00:00
2024-11-19 22:55:32 +00:00
2025-06-06 18:09:46 +02:00
2025-04-24 16:33:48 +00:00
2024-11-19 22:55:32 +00:00
2025-03-05 18:49:45 +01:00
2025-03-11 14:10:32 +01:00
2025-06-02 20:05:32 +02:00
2025-03-23 20:42:39 +00:00
2025-03-23 20:42:39 +00:00
2025-03-05 16:42:11 +01:00
2024-11-19 22:55:32 +00:00
2024-11-19 22:55:32 +00:00
2025-03-05 16:42:11 +01:00
2025-06-06 18:09:46 +02:00
2024-11-19 22:55:32 +00:00
2025-02-22 20:37:45 +01:00
2025-06-06 18:09:46 +02:00
2025-01-16 00:12:57 -08:00
2025-03-05 18:49:45 +01:00
2024-11-19 22:55:32 +00:00
2024-11-19 22:55:32 +00:00
2025-04-05 21:57:45 +02:00
2025-03-05 18:49:45 +01:00
2025-05-20 17:43:46 +00:00
2025-05-20 17:43:46 +00:00
2024-11-19 22:55:32 +00:00
2025-02-03 21:56:26 +01:00
2024-11-19 22:55:32 +00:00
2025-02-24 15:09:02 +00:00
2025-02-24 15:09:02 +00:00
2025-02-08 12:45:15 +00:00
2025-02-08 12:45:15 +00:00
2025-03-05 18:49:45 +01:00
2025-02-08 13:50:33 +00:00
2025-06-10 20:50:00 +02:00
2025-05-20 17:43:46 +00:00
2025-04-24 13:48:15 +00:00
2024-11-19 22:55:32 +00:00
2025-03-27 08:56:14 +00:00
2025-03-23 20:42:39 +00:00
2025-05-20 17:43:46 +00:00
2025-05-20 17:43:46 +00:00
2025-01-23 11:21:24 +00:00
2025-01-23 11:21:24 +00:00
2025-03-05 18:49:45 +01:00
2025-04-24 13:48:15 +00:00
2025-03-23 22:29:58 +00:00
2025-05-20 17:43:46 +00:00
2025-03-23 20:42:39 +00:00
2024-11-19 22:55:32 +00:00
2025-06-06 18:09:46 +02:00
2024-11-19 22:55:32 +00:00
2024-11-19 22:55:32 +00:00
2024-11-19 22:55:32 +00:00
2025-05-12 13:37:54 +02:00
2024-11-19 22:55:32 +00:00
2025-04-12 16:31:28 +02:00
2024-11-19 22:55:32 +00:00
2025-02-16 14:59:32 +00:00
2025-02-16 14:59:32 +00:00
2025-04-05 21:57:45 +02:00
2025-05-11 01:07:18 +02:00
2025-02-16 14:59:32 +00:00
2025-05-20 17:43:46 +00:00
2025-05-20 17:43:46 +00:00
2025-03-23 20:42:39 +00:00
2025-03-05 18:49:45 +01:00
2025-06-06 18:09:46 +02:00
2025-06-06 18:09:46 +02:00
2025-06-02 22:43:24 +00:00
2025-03-05 18:49:45 +01:00
2024-11-20 14:59:40 +01:00
2024-11-19 22:55:32 +00:00
2024-11-19 22:55:32 +00:00
2024-11-19 22:55:32 +00:00
2025-06-06 18:09:46 +02:00
2025-06-06 18:09:46 +02:00
2025-06-06 18:09:46 +02:00
2025-03-05 17:34:25 +01:00
2025-02-22 17:59:54 +00:00
2025-04-21 13:43:44 +00:00
2025-02-22 20:37:45 +01:00
2025-02-22 20:37:45 +01:00
2025-05-18 18:45:26 +02:00
2025-04-21 13:43:44 +00:00
2025-05-20 17:43:46 +00:00
2025-05-20 17:43:46 +00:00
2024-11-19 22:55:32 +00:00
2024-11-19 22:55:32 +00:00
2024-11-19 22:55:32 +00:00
2025-03-26 10:40:50 -07:00
2025-03-05 23:07:20 +01:00
2025-03-05 18:49:45 +01:00
2024-11-19 22:55:32 +00:00
2025-06-06 18:09:46 +02:00
2025-06-06 18:09:46 +02:00
2025-06-06 18:09:46 +02:00