Magisk/native/jni/magiskboot
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
..
bootimg.cpp Fix integer overflow and workaround seccomp 2021-11-10 03:07:20 -08:00
bootimg.hpp Tidy up bootimg.h 2021-10-31 10:52:12 -07:00
compress.cpp Speed up zopfli compression 2021-11-03 22:22:29 -07:00
compress.hpp Small native code reorganization 2020-03-09 01:50:30 -07:00
cpio.cpp Cleanup magiskboot cpio code 2021-08-13 04:53:11 -07:00
cpio.hpp Cleanup magiskboot cpio code 2021-08-13 04:53:11 -07:00
dtb.cpp Fix UB on dtb 2021-11-03 22:21:48 -07:00
dtb.hpp Patch AVB structures 2021-03-02 20:37:37 -08:00
format.cpp Zopfli is not always smaller 2021-08-28 17:16:20 -07:00
format.hpp Zopfli is not always smaller 2021-08-28 17:16:20 -07:00
hexpatch.cpp Prevent undefined behavior in magiskboot 2021-05-10 18:38:30 -07:00
magiskboot.hpp Refactor magiskboot 2021-02-28 14:37:12 -08:00
main.cpp Support custom legacy Sony devices with init.real setup 2021-10-30 18:59:20 -07:00
pattern.cpp Prevent undefined behavior in magiskboot 2021-05-10 18:38:30 -07:00
ramdisk.cpp Support custom legacy Sony devices with init.real setup 2021-10-30 18:59:20 -07:00