bf06b92850f74ec9f8ffdd9a3b26c07103856ff4
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>
Description
Languages
Kotlin
67.1%
C
20%
Rust
11.1%
Shell
0.9%
Makefile
0.4%
Other
0.4%