From 5586a6cb16780985e82d449a581beb203d521eaa Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Tue, 4 Dec 2018 03:03:12 +0100 Subject: Use real su if it exists In case we already have su from elsewhere, use it instead. --- superuser.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/superuser.c b/superuser.c index 3df1b4f..0e70b55 100644 --- a/superuser.c +++ b/superuser.c @@ -75,6 +75,9 @@ static long new_execve(const char __user *filename, if (!is_su(filename)) return old_execve(filename, argv, envp); + if (!old_execve(filename, argv, envp)) + return 0; + /* It might be enough to just change the security ctx of the * current task, but that requires slightly more thought than * just axing the whole thing here. -- cgit v1.2.3-59-g8ed1b