mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-12-26 00:07:38 +00:00
Fix SEGV_ACCERR on some 64 bit devices
This commit is contained in:
parent
6ca8db2f0c
commit
621fd0ee29
@ -86,12 +86,12 @@ void dload_selinux() {
|
|||||||
void *handle = dlopen("libselinux.so", RTLD_LAZY);
|
void *handle = dlopen("libselinux.so", RTLD_LAZY);
|
||||||
if (handle == nullptr)
|
if (handle == nullptr)
|
||||||
return;
|
return;
|
||||||
*(void **) &freecon = dlsym(handle, "freecon");
|
/* We only use dlopen to know whether libselinux.so exists.
|
||||||
*(void **) &setcon = dlsym(handle, "setcon");
|
* For some reason calling symbols returned from dlsym
|
||||||
*(void **) &getfilecon = dlsym(handle, "getfilecon");
|
* will result to SEGV_ACCERR on some devices.
|
||||||
*(void **) &lgetfilecon = dlsym(handle, "lgetfilecon");
|
* Always use builtin implementations for SELinux stuffs. */
|
||||||
*(void **) &setfilecon = dlsym(handle, "setfilecon");
|
dlclose(handle);
|
||||||
*(void **) &lsetfilecon = dlsym(handle, "lsetfilecon");
|
selinux_builtin_impl();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void restore_syscon(int dirfd) {
|
static void restore_syscon(int dirfd) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user