Files
SukiSU-Ultra/kernel
backslashxx bf06b92850 kernel: sucompat: increase reliability of execve_sucompat
On plain ARMv8.0 devices (A53,A57,A73), strncpy_from_user_nofault() sometimes
fails to copy `filename_user` string correctly. This breaks su ofc, breaking
some apps like Termux (Play Store ver), ZArchiver and Root Explorer.

This does NOT seem to affect newer ARMv8.2+ CPUs (A75/A76 and newer)

My speculation? ARMv8.0 has weak speculation :)

here we replace `strncpy_from_user_nofault()` with another routine:
 - access_ok() to validate the pointer
 - strncpy_from_user() to copy and validate string
 - manual null-termination just in case, as strncpy_from_user_nofault also does it
 - remove that memset, seems useless as it is an strncpy, not strncat

Kind of mimicking _nofault, but yes with this one we allow pagefaults.

Tested on:
- ARMv8.0 A73.a53, A57.a53, A53.a53
- ARMv8.2 A76.a55

Tested-by: iDead XD <rafifirdaus12bb@gmail.com>
Signed-off-by: backslashxx <118538522+backslashxx@users.noreply.github.com>
2025-05-24 14:26:31 +08:00
..
2024-04-27 09:55:24 +08:00
2023-04-13 10:41:49 +08:00
2023-06-16 19:53:15 +08:00
2024-04-27 09:55:24 +08:00
2024-04-27 09:55:24 +08:00
2024-04-27 09:55:24 +08:00
2023-06-16 19:53:15 +08:00
2025-05-17 18:45:01 +08:00
2023-06-16 19:53:15 +08:00
2025-02-16 19:29:58 +08:00
2023-02-02 09:04:07 +08:00
2025-05-12 19:29:25 +08:00
2024-04-27 09:55:24 +08:00