ANDROID: 16K: Only check basename of linker context
Depending on the platform binary being executed, the linker
(interpreter) requested can be one of:
1) /system/bin/bootstrap/linker64
2) /system/bin/linker64
3) /apex/com.android.runtime/bin/linker64
Relax the check to the basename (linker64), instead of the path.
Bug: 383389169
Bug: 330767927
Bug: 335584973
Change-Id: I4a1f95b7cecd126f85ad8cefd9ff10d272947f9e
Signed-off-by: Kalesh Singh <kaleshsingh@google.com>
This commit is contained in:
committed by
Carlos Llamas
parent
6050c4b129
commit
4199eaf23e
+10
-1
@@ -18,6 +18,7 @@
|
|||||||
#include <linux/kstrtox.h>
|
#include <linux/kstrtox.h>
|
||||||
#include <linux/sched/task_stack.h>
|
#include <linux/sched/task_stack.h>
|
||||||
#include <linux/slab.h>
|
#include <linux/slab.h>
|
||||||
|
#include <linux/string.h>
|
||||||
#include <linux/sysfs.h>
|
#include <linux/sysfs.h>
|
||||||
|
|
||||||
typedef void (*show_pad_maps_fn) (struct seq_file *m, struct vm_area_struct *vma);
|
typedef void (*show_pad_maps_fn) (struct seq_file *m, struct vm_area_struct *vma);
|
||||||
@@ -196,7 +197,15 @@ static inline bool linker_ctx(void)
|
|||||||
memset(buf, 0, bufsize);
|
memset(buf, 0, bufsize);
|
||||||
path = d_path(&file->f_path, buf, bufsize);
|
path = d_path(&file->f_path, buf, bufsize);
|
||||||
|
|
||||||
if (!strcmp(path, "/system/bin/linker64"))
|
/*
|
||||||
|
* Depending on interpreter requested, valid paths could be any of:
|
||||||
|
* 1. /system/bin/bootstrap/linker64
|
||||||
|
* 2. /system/bin/linker64
|
||||||
|
* 3. /apex/com.android.runtime/bin/linker64
|
||||||
|
*
|
||||||
|
* Check the base name (linker64).
|
||||||
|
*/
|
||||||
|
if (!strcmp(kbasename(path), "linker64"))
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user