File tree Expand file tree Collapse file tree
layers/meta-dstack/recipes-kernel/linux/files Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -49,10 +49,18 @@ CONFIG_CRYPTO_SHA256=y
4949CONFIG_CRYPTO_SHA512 =y
5050
5151# Production kernel self-protection baseline.
52+ #
53+ # CONFIG_INIT_ON_FREE_DEFAULT_ON is deliberately NOT set: with init_on_free=1
54+ # a GCP TDX guest is silently killed by the host during mem_encrypt_init()
55+ # (the 1 GiB SWIOTLB private->shared conversion) and reboot-loops before
56+ # reaching /init. Confirmed on c3-standard-4 by booting the same image with
57+ # init_on_alloc=0/init_on_free=0 cmdline overrides: only init_on_free=1
58+ # reproduces the reset; init_on_alloc=1 alone boots fine (and is kept below).
59+ # The same kernel with init_on_free=1 boots fine on AWS EC2 and QEMU TDX,
60+ # so this is a GCP host-side interaction, not a generic kernel bug.
5261CONFIG_SECURITY_DMESG_RESTRICT =y
5362CONFIG_IO_STRICT_DEVMEM =y
5463CONFIG_INIT_ON_ALLOC_DEFAULT_ON =y
55- CONFIG_INIT_ON_FREE_DEFAULT_ON =y
5664CONFIG_SLAB_FREELIST_RANDOM =y
5765CONFIG_SLAB_FREELIST_HARDENED =y
5866CONFIG_HARDENED_USERCOPY =y
Original file line number Diff line number Diff line change @@ -150,7 +150,9 @@ echo "== Kernel hardening recommendations =="
150150recommend_config CONFIG_SECURITY_DMESG_RESTRICT y
151151recommend_config CONFIG_IO_STRICT_DEVMEM y
152152recommend_config CONFIG_INIT_ON_ALLOC_DEFAULT_ON y
153- recommend_config CONFIG_INIT_ON_FREE_DEFAULT_ON y
153+ # CONFIG_INIT_ON_FREE_DEFAULT_ON is intentionally not recommended: the unified
154+ # image also boots on GCP TDX, where init_on_free=1 makes the host kill the
155+ # guest during the SWIOTLB private->shared conversion (see dstack.cfg).
154156recommend_config CONFIG_SLAB_FREELIST_RANDOM y
155157recommend_config CONFIG_SLAB_FREELIST_HARDENED y
156158recommend_config CONFIG_HARDENED_USERCOPY y
You can’t perform that action at this time.
0 commit comments