File tree Expand file tree Collapse file tree 2 files changed +12
-5
lines changed Expand file tree Collapse file tree 2 files changed +12
-5
lines changed Original file line number Diff line number Diff line change 7
7
8
8
#ifndef __ASSEMBLY__
9
9
10
+ #include <linux/jump_label.h>
11
+
12
+ extern struct static_key_false disable_kuep_key ;
13
+
10
14
static __always_inline bool kuap_is_disabled (void )
11
15
{
12
16
return !IS_ENABLED (CONFIG_PPC_KUAP );
13
17
}
14
18
15
19
static __always_inline bool kuep_is_disabled (void )
16
20
{
17
- return !IS_ENABLED (CONFIG_PPC_KUEP );
21
+ return !IS_ENABLED (CONFIG_PPC_KUEP ) || static_branch_unlikely ( & disable_kuep_key ) ;
18
22
}
19
23
20
24
static inline void kuep_lock (void )
Original file line number Diff line number Diff line change 3
3
#include <asm/kup.h>
4
4
#include <asm/smp.h>
5
5
6
+ struct static_key_false disable_kuep_key ;
7
+
6
8
void __init setup_kuep (bool disabled )
7
9
{
8
- kuep_lock ();
10
+ if (!disabled )
11
+ kuep_lock ();
9
12
10
13
if (smp_processor_id () != boot_cpuid )
11
14
return ;
12
15
13
- pr_info ("Activating Kernel Userspace Execution Prevention\n" );
14
-
15
16
if (disabled )
16
- pr_warn ("KUEP cannot be disabled yet on 6xx when compiled in\n" );
17
+ static_branch_enable (& disable_kuep_key );
18
+ else
19
+ pr_info ("Activating Kernel Userspace Execution Prevention\n" );
17
20
}
You can’t perform that action at this time.
0 commit comments