mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-26 00:06:02 +00:00
fix(proot): a call the filesystem does not implement no longer switches the fast path off (#2509)
Android's FUSE daemon has no symlink or link, so those calls on a storage card return ENOSYS. The fast path read any ENOSYS from its trampoline as a seccomp trap and stopped for the whole process. It now asks again with the same call number and invalid arguments: a trap answers ENOSYS again, anything else means the call reached the kernel and only that call is repeated. Folders opened for a refused call are still closed.
This commit is contained in:
1 parent
b303423001
commit
cd05c96d10
3 files changed
+51
-3
No files matched your search
@@ -59,10 +59,10 @@ static int optional_syscall(long nr) {
|
||||
nr == SYS_openat2 || nr == SYS_renameat2;
|
||||
}
|
||||
static long sc(long nr, long a, long b, long c, long d, long e) {
|
||||
if (fp_refused) return -ENOSYS;
|
||||
if (fp_refused && nr != SYS_close) return -ENOSYS;
|
||||
long r = fp_sys(nr, a, b, c, d, e, 0);
|
||||
if (r == -ENOSYS && !optional_syscall(nr)) {
|
||||
__atomic_store_n(&fp_on, 0, __ATOMIC_RELAXED);
|
||||
if (fp_sys(nr, -1, -1, -1, -1, -1, 0) == -ENOSYS) __atomic_store_n(&fp_on, 0, __ATOMIC_RELAXED);
|
||||
fp_refused = 1;
|
||||
}
|
||||
return r;
|
||||
|
||||
Reference in new issue
Block a user