We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1ee7796 commit f3a7b62Copy full SHA for f3a7b62
kernel/core_hook.c
@@ -137,17 +137,18 @@ void escape_to_root(void)
137
{
138
struct cred *cred;
139
140
- if (current_euid().val == 0) {
141
- pr_warn("Already root, don't escape!\n");
142
- return;
143
- }
144
-
145
cred = prepare_creds();
146
if (!cred) {
147
pr_warn("prepare_creds failed!\n");
148
return;
149
}
150
+ if (cred->euid.val == 0) {
+ pr_warn("Already root, don't escape!\n");
+ abort_creds(cred);
+ return;
+ }
151
+
152
struct root_profile *profile = ksu_get_root_profile(cred->uid.val);
153
154
cred->uid.val = profile->uid;
0 commit comments