Magisk/native/jni/utils
topjohnwu 528601d25a Fix integer overflow and workaround seccomp
- Use ftruncate64 instead of ftruncate to workaround seccomp
- Cast uint32_t to off64_t before making it negative

Note: Using ftruncate with a modern NDK libc should actually be
fine as the syscall wrapper in bionic will use ftruncate64 internally.
However, since we are using the libc.a from r10e built for Gingerbread,
seccomp wasn't a thing back then, and also the ftruncate64 symbol is
missing; we have to create our own wrapper and call it instead on
32-bit ABIs.

Props to @jnotuo for discovering the overflow bug and seccomp issue

Fix #3703, close #4915
2021-11-10 03:07:20 -08:00
..
include Cleanup magiskboot cpio code 2021-08-13 04:53:11 -07:00
Android.mk Build on API 21 headers 2021-10-20 03:17:42 -07:00
files.cpp Update denylist config implementation 2021-09-16 05:27:34 -07:00
files.hpp Update denylist config implementation 2021-09-16 05:27:34 -07:00
logging.cpp Proper incremental builds 2021-09-07 19:35:28 -07:00
logging.hpp Revise logging code 2021-08-12 03:26:54 -07:00
misc.cpp Make zygiskd ABI aware 2021-10-23 14:38:30 -07:00
misc.hpp Make zygiskd ABI aware 2021-10-23 14:38:30 -07:00
missing.cpp Fix integer overflow and workaround seccomp 2021-11-10 03:07:20 -08:00
missing.hpp Build on API 21 headers 2021-10-20 03:17:42 -07:00
new.cpp Bump to C++17 2019-01-20 00:07:58 -05:00
selinux.cpp Build on API 21 headers 2021-10-20 03:17:42 -07:00
stream.cpp Build on API 21 headers 2021-10-20 03:17:42 -07:00
xwrap.cpp Build on API 21 headers 2021-10-20 03:17:42 -07:00
xwrap.hpp Fix random return value of faccessat() in x86 2021-04-04 03:04:09 -07:00