From: James Morris <james.l.morris@xxxxxxxxxx> This is a patch against the SELinux namespace work. Mark the initial SELinux namespace pointer as __ro_after_init, to harden against malicious overwrite by an attacker. Signed-off-by: James Morris <james.l.morris@xxxxxxxxxx> [sds@xxxxxxxxxxxxx: ported to v5.4-rc1] Signed-off-by: Stephen Smalley <sds@xxxxxxxxxxxxx> --- security/selinux/hooks.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c index 7a4ed553cec0..dc0b143ffa55 100644 --- a/security/selinux/hooks.c +++ b/security/selinux/hooks.c @@ -7096,7 +7096,7 @@ void __put_selinux_ns(struct selinux_ns *ns) schedule_work(&ns->work); } -static struct selinux_ns *init_selinux_ns; +static struct selinux_ns *init_selinux_ns __ro_after_init; static __init int selinux_init(void) { -- 2.21.0