mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-01-23 02:14:37 +00:00
This patch adds support for checkpoint and restore of two linux security modules (apparmor and selinux). The actual checkpoint or restore code isn't that interesting, other than that we have to do the LSM restore in the restorer blob since it may block any number of things that we want to do as part of the restore process. I tried originally to get this to work using libraries in the restorer blob, but I could _not_ get things to work correctly (I assume I was doing something wrong with all the static linking, you can see my draft attempts here: https://github.com/tych0/criu/commits/apparmor-using-libraries ). I can try to resurrect this if it makes more sense, to do it that way, though. v2: lsm_profile lives in creds.proto instead of the task core, look in a more canonical place for selinuxfs and don't try to special case any selinux profile names. v3: only allow unconfined selinux profiles Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com> Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
48 lines
1.3 KiB
Text
48 lines
1.3 KiB
Text
include scripts/utilities.mak
|
|
include scripts/feature-tests.mak
|
|
|
|
CONFIG := include/config.h
|
|
|
|
ifeq ($(call try-cc,$(LIBBSD_DEV_TEST),-lbsd),y)
|
|
LIBS += -lbsd
|
|
DEFINES += -DCONFIG_HAS_LIBBSD
|
|
endif
|
|
|
|
ifeq ($(call pkg-config-check,libselinux),y)
|
|
LIBS := -lselinux $(LIBS)
|
|
DEFINES += -DCONFIG_HAS_SELINUX
|
|
endif
|
|
|
|
$(CONFIG): scripts/utilities.mak scripts/feature-tests.mak include/config-base.h
|
|
$(E) " GEN " $@
|
|
$(Q) @echo '#ifndef __CR_CONFIG_H__' > $@
|
|
$(Q) @echo '#define __CR_CONFIG_H__' >> $@
|
|
$(Q) @echo '' >> $@
|
|
$(Q) @echo '#include "config-base.h"' >> $@
|
|
$(Q) @echo '' >> $@
|
|
ifeq ($(call try-cc,$(TCP_REPAIR_TEST),),y)
|
|
$(Q) @echo '#define CONFIG_HAS_TCP_REPAIR' >> $@
|
|
endif
|
|
ifeq ($(call try-cc,$(PRLIMIT_TEST),),y)
|
|
$(Q) @echo '#define CONFIG_HAS_PRLIMIT' >> $@
|
|
endif
|
|
ifeq ($(call try-cc,$(STRLCPY_TEST),$(LIBS)),y)
|
|
$(Q) @echo '#define CONFIG_HAS_STRLCPY' >> $@
|
|
endif
|
|
ifeq ($(call try-cc,$(STRLCAT_TEST),$(LIBS)),y)
|
|
$(Q) @echo '#define CONFIG_HAS_STRLCAT' >> $@
|
|
endif
|
|
ifeq ($(call try-cc,$(PTRACE_PEEKSIGINFO_TEST),),y)
|
|
$(Q) @echo '#define CONFIG_HAS_PEEKSIGINFO_ARGS' >> $@
|
|
endif
|
|
ifeq ($(VDSO),y)
|
|
$(Q) @echo '#define CONFIG_VDSO' >> $@
|
|
endif
|
|
ifeq ($(call try-cc,$(SETPROCTITLE_INIT_TEST),-lbsd),y)
|
|
$(Q) @echo '#define CONFIG_HAS_SETPROCTITLE_INIT' >> $@
|
|
endif
|
|
$(Q) @echo '#endif /* __CR_CONFIG_H__ */' >> $@
|
|
|
|
config: $(CONFIG)
|
|
|
|
.PHONY: config
|