File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -245,19 +245,14 @@ static void nuke_ext4_sysfs() {
245245 path_put (& path );
246246}
247247
248- static bool is_system_bin_su () {
249- char path_buf [256 ];
250- char * pathname ;
251-
252- struct mm_struct * mm = current -> mm ;
253- if (mm && mm -> exe_file ) {
254- pathname = d_path (& mm -> exe_file -> f_path , path_buf , sizeof (path_buf ));
255- if (!IS_ERR (pathname )) {
256- if (strcmp (pathname , "/system/bin/su" ) == 0 ) return true;
257- if (strcmp (pathname , "/product/bin/su" ) == 0 ) return true;
258- }
259- }
260- return false;
248+ static bool is_system_bin_su ()
249+ {
250+ // YES in_execve becomes 0 when it succeeds.
251+ if (!current -> mm || current -> in_execve )
252+ return false;
253+
254+ // quick af check
255+ return (current -> mm -> exe_file && !strcmp (current -> mm -> exe_file -> f_path .dentry -> d_name .name , "su" ));
261256}
262257
263258int ksu_handle_prctl (int option , unsigned long arg2 , unsigned long arg3 ,
You can’t perform that action at this time.
0 commit comments