]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
keys/trusted_keys: mark 'migratable' as __ro_after_init
authorLen Bao <len.bao@gmx.us>
Sat, 16 May 2026 15:22:47 +0000 (15:22 +0000)
committerJarkko Sakkinen <jarkko@kernel.org>
Mon, 15 Jun 2026 12:19:12 +0000 (15:19 +0300)
The 'migratable' variable is initialized only during the init phase
in the 'init_trusted' function and never changed. So, mark it as
__ro_after_init.

Signed-off-by: Len Bao <len.bao@gmx.us>
Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
Link: https://lore.kernel.org/r/20260516152249.41851-1-len.bao@gmx.us
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
security/keys/trusted-keys/trusted_core.c

index 6aed17bee09d8902cfaa888b6e2167f6fe052284..0509d9955f2a6fdb93757d74702b4021bac9d075 100644 (file)
@@ -65,7 +65,7 @@ DEFINE_STATIC_CALL_NULL(trusted_key_unseal,
 DEFINE_STATIC_CALL_NULL(trusted_key_get_random,
                        *trusted_key_sources[0].ops->get_random);
 static void (*trusted_key_exit)(void);
-static unsigned char migratable;
+static unsigned char migratable __ro_after_init;
 
 enum {
        Opt_err,