1 // SPDX-License-Identifier: GPL-2.0-or-later
6 struct static_key_false disable_kuap_key;
7 EXPORT_SYMBOL(disable_kuap_key);
9 void kuap_lock_all_ool(void)
13 EXPORT_SYMBOL(kuap_lock_all_ool);
15 void kuap_unlock_all_ool(void)
19 EXPORT_SYMBOL(kuap_unlock_all_ool);
21 void setup_kuap(bool disabled)
25 init_mm.context.sr0 |= SR_KS;
26 current->thread.sr0 |= SR_KS;
29 if (smp_processor_id() != boot_cpuid)
33 static_branch_enable(&disable_kuap_key);
35 pr_info("Activating Kernel Userspace Access Protection\n");