platform_system_core/libziparchive
Łukasz Szymczyk e1d5a6aa5c Reserve space on disk using fallocate
There were crashes when android failed to extract
zip archives due to out of free space on disk, with stacks like:

  #00 pc 00000000000156b0 /system/lib64/libc.so (memcpy+176)
  #01 pc 000000000002e5b8 /system/lib64/libandroidfw.so
  #02 pc 000000000002f488 /system/lib64/libandroidfw.so (ExtractToMemory+328)
  #03 pc 000000000002f5c8 /system/lib64/libandroidfw.so (ExtractEntryToFile+268)
  #04 pc 00000000000287d8 /system/lib64/libandroidfw.so (android::ZipFileRO::\
  uncompressEntry(void*, int) const+12)

Space for the file is now allocated using fallocate rather than
ftruncate, since ftruncate dont actually reserve space on disk. When writes
to the mmaped pointer fails to be realized due to out of space SIGBUS
is the result. With this change we make sure that there is space available
before mmaping the pointer.

Change-Id: Ic5e8c33dbe729edb57919dacff73811b34cc2dc2
2015-04-20 09:49:26 +00:00
..
testdata libziparchive: fix issue with a directory with one file 2015-03-19 09:28:41 +00:00
Android.mk Prevent unaligned read in libziparchive. 2015-04-09 17:00:14 -07:00
entry_name_utils-inl.h Reject zip archives whose entry names are not valid UTF-8. 2014-12-08 12:25:05 +00:00
entry_name_utils_test.cc Reject zip archives whose entry names are not valid UTF-8. 2014-12-08 12:25:05 +00:00
zip_archive.cc Reserve space on disk using fallocate 2015-04-20 09:49:26 +00:00
zip_archive_test.cc libziparchive: fix issue with a directory with one file 2015-03-19 09:28:41 +00:00