core: dlopen() libcryptsetup in extensions refreshing
Follow-up for a08f2ea02d
This fixes extensions refreshing + verity-protected DDIs.
TEST-50-DISSECT previously passed because confext refreshing
is tested after live mount, the latter of which used to
load libcryptsetup in pid1.
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
#include "base-filesystem.h"
|
||||
#include "bitfield.h"
|
||||
#include "chase.h"
|
||||
#include "cryptsetup-util.h"
|
||||
#include "dev-setup.h"
|
||||
#include "devnum-util.h"
|
||||
#include "dissect-image.h"
|
||||
@@ -3852,6 +3853,8 @@ int refresh_extensions_in_namespace(
|
||||
if (r > 0)
|
||||
return log_debug_errno(SYNTHETIC_ERRNO(EINVAL), "Target namespace is not separate, cannot reload extensions");
|
||||
|
||||
(void) dlopen_cryptsetup();
|
||||
|
||||
extension_dir = path_join(p->private_namespace_dir, "unit-extensions");
|
||||
if (!extension_dir)
|
||||
return log_oom_debug();
|
||||
|
||||
+3
-1
@@ -2881,7 +2881,9 @@ static void service_enter_refresh_extensions(Service *s) {
|
||||
|
||||
/* Given we are running from PID1, avoid doing potentially heavy I/O operations like opening images
|
||||
* directly, and instead fork a worker process. */
|
||||
r = unit_fork_helper_process(UNIT(s), "(sd-refresh-extensions)", /* into_cgroup= */ false, &worker);
|
||||
r = unit_fork_helper_process_full(UNIT(s), "(sd-refresh-extensions)", /* into_cgroup= */ false,
|
||||
FORK_ALLOW_DLOPEN, /* permit dlopen() to avoid load of libcryptsetup in pid1 */
|
||||
&worker);
|
||||
if (r < 0) {
|
||||
log_unit_error_errno(UNIT(s), r, "Failed to fork process to refresh extensions in unit's namespace: %m");
|
||||
goto fail;
|
||||
|
||||
Reference in New Issue
Block a user