Commit Graph

10298 Commits

Author SHA1 Message Date
Sami Tolvanen 4cafe2ff89 Fix verity on system partitions larger than 2G
If the system partition is larger than 2G, the device fails to read
verity metadata, because fseek accepts only a 32-bit signed offset.
Switch from fseek to lseek64 to allow seeking using a 64-bit offset,
which solves the problem. At the same time, move away from stdio in
the function.

Bug: 17705619
Change-Id: I226320498dcb750ec6cde84411c7fe0774c9cab7
2014-10-29 11:06:47 -07:00
Calin Juravle 47a919c6fb Merge "Add code cache tests to libnativebridge." into lmp-mr1-dev 2014-10-28 17:16:33 +00:00
Calin Juravle 9c094da831 Merge "Handle code_cache dir creation in libnativebridge" into lmp-mr1-dev 2014-10-28 17:16:24 +00:00
Calin Juravle 9ef4fa4c2c Add code cache tests to libnativebridge.
Bug: 18027433

(cherry picked from commit 59a719c466)

Change-Id: I32bcf3ae0d4569d4d8b88168e6c36ddff70b8f7d
2014-10-28 16:06:43 +00:00
Paul Lawrence 3dbcc8b933 Merge "adb warns on remount when verity is enabled" into lmp-mr1-dev 2014-10-27 19:31:51 +00:00
Iliyan Malchev 5b244cd414 toolbox: add prlimit command
adb shell prlimit <pid> <cur> <max>

prlimit uses prlimit internally to allow you to set the limits on an arbitrary
process, if you have the privileges to.

Change-Id: Ie9a5dc510c7c695debd8f948361d4c51befa5604
Signed-off-by: Iliyan Malchev <malchev@google.com>
2014-10-27 12:25:41 -07:00
Paul Lawrence f643beced1 adb warns on remount when verity is enabled
Bug: 18119147
Change-Id: I75e5edf83fa01dbf2495e24df4597dce41f13654
2014-10-27 10:56:31 -07:00
Calin Juravle 1402fbb135 Handle code_cache dir creation in libnativebridge
Also:

- add kPreInitiliazed state to native bridge with check transition:
kOpened->kPreInitialized->kInitialized
- made sure we free the memory for the code_cache_path
- tidy up some error messages
- tidy up tests
- add a dummy native bridge to test with

Bug: 18027433
Bug: 18097480

(cherry picked from commit f9d9e2a2d9)

Change-Id: I9ce578949dbe522d5033465df7ca49fdd3aa3cbf
2014-10-27 15:37:32 +00:00
Narayan Kamath 6e93b246d4 am 80f227c1: am 66f0d93c: Don\'t allow SUPPORTED_ABIs to be set by the native bridge.
* commit '80f227c1f75d753396a6efd6fccfc0c76c93bae4':
  Don't allow SUPPORTED_ABIs to be set by the native bridge.
2014-10-22 20:44:58 +00:00
Narayan Kamath 80f227c1f7 am 66f0d93c: Don\'t allow SUPPORTED_ABIs to be set by the native bridge.
* commit '66f0d93c265657e17c7a1ddd74beb61070a8df69':
  Don't allow SUPPORTED_ABIs to be set by the native bridge.
2014-10-21 21:42:58 +00:00
Narayan Kamath 66f0d93c26 Don't allow SUPPORTED_ABIs to be set by the native bridge.
SUPPORTED_ABIs is a prioritized list of all ABIs a device
support, and must not vary depending on whether or not an app
is emulated.

bug: 18061712
Change-Id: I3ec3897d23e37c645b4d9d9e6e32aae9afff952c
2014-10-21 18:33:27 +01:00
Arve Hjønnevåg b50d0cd53f Merge "rootdir: Make trusty version readable by dumpstate" into lmp-mr1-dev 2014-10-20 21:53:59 +00:00
Adam Lesinski a0a7ac037d am fe963bfd: am a1ac84cd: MingW doesn\'t handle __attribute__((weak)) for Windows PE
* commit 'fe963bfd8cf3a240785892f8194debb4e0ebb92d':
  MingW doesn't handle __attribute__((weak)) for Windows PE
2014-10-20 21:20:40 +00:00
Adam Lesinski fe963bfd8c am a1ac84cd: MingW doesn\'t handle __attribute__((weak)) for Windows PE
* commit 'a1ac84cd8d7357f38a9fc60ab9d42e81d1790fd2':
  MingW doesn't handle __attribute__((weak)) for Windows PE
2014-10-20 21:14:50 +00:00
Adam Lesinski a1ac84cd8d MingW doesn't handle __attribute__((weak)) for Windows PE
Windows PE format doesn't have the same support for weak symbols
as ELF does.

The symbol android_log_id_to_name was strangely omitted from the
resulting Windows executable and the callsite where it was supposed
to be called was relaced with a different symbol, which caused a crash
in AAPT on Windows.

This change works due to a careful set of #ifdefs that ensure only one
definition of android_log_id_to_name is defined, but there are other
uses of __attribute__((weak)) which should be inspected.

Change-Id: I3b58076e31d9b28c5143773a170e9ffda9fa3815
2014-10-20 12:33:59 -07:00
Dmitriy Ivanov 37ef356a8e Merge "Remove libsigchain from LD_PRELOADs" into lmp-mr1-dev 2014-10-20 16:39:57 +00:00
Arve Hjønnevåg 7770252a84 rootdir: Make trusty version readable by dumpstate
Change-Id: I761650d286b454f1fe01a585e7cd6ec769bfc527
2014-10-16 16:11:37 -07:00
Xavier Ducrohet 81080625a2 am 88b463a1: am 1c77bf4c: Merge "Fix windows specific behavior of FileMap" into lmp-dev
* commit '88b463a1c12cccc6738baa51642bf639bd9a6e53':
  Fix windows specific behavior of FileMap
2014-10-16 19:19:16 +00:00
Xavier Ducrohet 88b463a1c1 am 1c77bf4c: Merge "Fix windows specific behavior of FileMap" into lmp-dev
* commit '1c77bf4ce5059f3a770418cfa8afed39ee41ab24':
  Fix windows specific behavior of FileMap
2014-10-16 19:13:46 +00:00
Xavier Ducrohet 1c77bf4ce5 Merge "Fix windows specific behavior of FileMap" into lmp-dev 2014-10-16 19:09:40 +00:00
Xavier Ducrohet 1a55aa5e34 Fix windows specific behavior of FileMap
The implementation of the FileMap destructor would
close the file, only on Windows, which did not match
the behavior on mac/linux.

This is because calling munmap does not close the file
descriptor. It must be closed separately, before or after
munmap.

On Windows, the file must also be closed manually,
before or after closing the mappingFile.

The change basically removes the closing file from
the windows-specific part of the destructor, to
make behavior more consistent on all platforms
where the caller to FileMap is responsible for closing
its own file (since FileMap receives an opened file).

Change-Id: I5e3cfffbb870d5f3595802ccac57dbc1dbf1ce6e
2014-10-16 12:09:06 -07:00
Xavier Ducrohet 66fa33a7ad am dc7957d9: am cd1da4e0: Fix toolchain issue for windows build of libziparchive.
* commit 'dc7957d9b782a759a4eaa75832dd18c9943c7d0c':
  Fix toolchain issue for windows build of libziparchive.
2014-10-16 18:59:54 +00:00
Dmitriy Ivanov 976e1b6431 Remove libsigchain from LD_PRELOADs
Bug: 15345057
Bug: 15426766

(cherry picked from commit c9f9f35efa)

Change-Id: If54e1aeaa1e2abe061ac19666af4f4e058b81df2
2014-10-16 11:45:16 -07:00
Xavier Ducrohet dc7957d9b7 am cd1da4e0: Fix toolchain issue for windows build of libziparchive.
* commit 'cd1da4e04f0eb71a92a586c66acd0e34115608e1':
  Fix toolchain issue for windows build of libziparchive.
2014-10-16 16:55:07 +00:00
Xavier Ducrohet cd1da4e04f Fix toolchain issue for windows build of libziparchive.
With mingw 4.8, the new default packed behavior is broken and makes
zip archive fails due to unexpected misalignment in
CentralDirectoryRecord.

This patch uses -mno-ms-bitfields to revert to the old packed
behavior.

Change-Id: Ic977c841e330e19451db1d31ddb22e570a525062
2014-10-16 07:49:16 +00:00
Dianne Hackborn 1a27d6ab32 am 6d343432: am 67f46cb0: Fix issue #18000467: processgroup truncates buffer
* commit '6d34343263d890114410fafc85885501eca8d3d6':
  Fix issue #18000467: processgroup truncates buffer
2014-10-15 23:25:11 +00:00
Dianne Hackborn 6d34343263 am 67f46cb0: Fix issue #18000467: processgroup truncates buffer
* commit '67f46cb0e137edbf4a6f7014ca8a3a58484016d1':
  Fix issue #18000467: processgroup truncates buffer
2014-10-15 23:15:11 +00:00
Dianne Hackborn 67f46cb0e1 Fix issue #18000467: processgroup truncates buffer
Change-Id: I3d98a4da9c47d83d25a11ff0ef94cfcab1feabea
2014-10-15 11:36:28 -07:00
Dianne Hackborn 00ffc22cbf am e09bfb12: am 2c5e7e10: Maybe fix issue #17969789: Shamu FR: Runtime restart while scrolling Instagram
* commit 'e09bfb1213b9174d4c3d6536b755d924772ce881':
  Maybe fix issue #17969789: Shamu FR: Runtime restart while scrolling Instagram
2014-10-14 19:33:06 +00:00
Dianne Hackborn e09bfb1213 am 2c5e7e10: Maybe fix issue #17969789: Shamu FR: Runtime restart while scrolling Instagram
* commit '2c5e7e102bc2059d22f8457db68c567b64cec963':
  Maybe fix issue #17969789: Shamu FR: Runtime restart while scrolling Instagram
2014-10-14 01:19:29 +00:00
Dianne Hackborn 2c5e7e102b Maybe fix issue #17969789: Shamu FR: Runtime restart while scrolling Instagram
It looks like there were a couple problems in the code:

- It would not 0-terminate the string it read, to make sure we didn't
  see garbage at the end.
- It didn't reduce buf_len as it processes data in the buffer, so if
  we need to read more we will increase the buffer length to be longer
  than the actual available data.

Also put in some logs about every thing we kill, so we can see what
is going on when debugging.  And add a special check for us trying
to kill pid 0 for any reason, since doing so seem to be terminal to
the caller.

Change-Id: I2fe29bfef08938b8a2eb182475c0705c14d8d84f
2014-10-13 17:52:32 -07:00
Daniel Rosenberg 86b4dba9c4 am b63aab58: am 8218b6aa: newfs_msdos: Set sectors per fat once
* commit 'b63aab58065f5fb2a04c5d7c49f1d61bf7e17179':
  newfs_msdos: Set sectors per fat once
2014-10-11 02:49:40 +00:00
Daniel Rosenberg b63aab5806 am 8218b6aa: newfs_msdos: Set sectors per fat once
* commit '8218b6aae9cd4a19fa074a8a8203fe9275b35447':
  newfs_msdos: Set sectors per fat once
2014-10-11 00:23:52 +00:00
Daniel Rosenberg 8218b6aae9 newfs_msdos: Set sectors per fat once
There was an issue causing the fat size to shrink too small, causing
a fsck check to fail.

Bug: 17949028
Bug: 17761281
Change-Id: Id0207f2ab44e57ff81f5a53494b45344822a6495
Signed-off-by: Daniel Rosenberg <drosen@google.com>
2014-10-10 14:40:48 -07:00
Paul Lawrence 97e487311b Fix Nick's nits
Change-Id: Ide7925e7ad328f0343d444d63ff72f1a26206d4c
2014-10-09 09:37:00 -07:00
Paul Lawrence bbb3631911 Revert "Revert "Enable verity on userdebug, and add disable-verity to adb""
This reverts commit 152d2d4234.

Fixed build error, and also fixed memory leak spotted from warning.

Bug: 17691572
Change-Id: I23b5ba537f7b557432041d4338b38b9be434e981
2014-10-09 09:05:36 -07:00
Nick Kralevich a49bfc0d26 Merge "Revert "Enable verity on userdebug, and add disable-verity to adb"" into lmp-mr1-dev 2014-10-08 23:59:00 +00:00
Nick Kralevich 152d2d4234 Revert "Enable verity on userdebug, and add disable-verity to adb"
Build is broken.

system/core/fs_mgr/fs_mgr_verity.c: In function 'fs_mgr_setup_verity':
system/core/fs_mgr/fs_mgr_verity.c:103:20: error: 'verity_table_signature' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     if (!RSA_verify(key,
                    ^
system/core/fs_mgr/fs_mgr_verity.c:374:11: note: 'verity_table_signature' was declared here
     char *verity_table_signature;
           ^
cc1: all warnings being treated as errors
make: *** [out/target/product/minnow/obj/STATIC_LIBRARIES/libfs_mgr_intermediates/fs_mgr_verity.o] Error 1
make: *** Waiting for unfinished jobs....

This reverts commit d4cea0bc16.

Change-Id: I6862cc79ef9d944a2472b6fb2e46dae514cea8ce
2014-10-08 23:55:05 +00:00
Mark Salyzyn fd4f05ce05 Merge changes I74796043,I7d0b85b5,I74796043,I74796043,Ie325e1b5, ... into lmp-mr1-dev
* changes:
  logd: kill(0,0) issue
  logd: LogStatistics leak
  logd: Add control statistics enable/disable.
  logd: cleanup
  logd: auditd: report facility LOG_AUTH
  logd: auditd: kmsg priority
2014-10-08 23:07:07 +00:00
Paul Lawrence ae413a71cb Merge "Enable verity on userdebug, and add disable-verity to adb" into lmp-mr1-dev 2014-10-08 22:57:15 +00:00
Paul Lawrence d4cea0bc16 Enable verity on userdebug, and add disable-verity to adb
Bug: 17691572

Change-Id: I58f588f318e7952d06a41325337d946d7c007e31
2014-10-08 15:24:37 -07:00
Mark Salyzyn 260f3be312 logd: kill(0,0) issue
- Recognize pid=0 as special case (kernel or pre-init sourced)
  and refrain from treating it in the general case.

(cherry pick from commit df5aa61f05)

Bug: 17526159
Change-Id: I74796043ac34753c6dd10018719ebc0bcd94e012
2014-10-08 14:01:45 -07:00
Mark Salyzyn 1e1d71e26c logd: LogStatistics leak
- uid = -1 in subtract operation to match add

(cherry pick from commit f48ea7c8dc)

Bug: 15986335
Change-Id: I7d0b85b5334c5264fd04309cb78e0c9aec0ad261
2014-10-08 14:01:45 -07:00
Mark Salyzyn a0e53540da logd: Add control statistics enable/disable.
- ro.build.type=user turn off statistics
- ro.config.low_ram=true turn off statistics
- logd.statistics override

(cherry pick from commit f5fc509589)

Bug: 17526159
Bug: 17526187
Change-Id: I74796043ac34753c6dd10018719ebc0bcd94e00f
2014-10-08 14:01:45 -07:00
Mark Salyzyn 987f1e0de3 logd: cleanup
- simplify access and control exposure to class list
- indent
- compile warning
- Follow standard naming convention for variables and methods
- merge common fragments
- Side Effects: none

(cherry pick from commit e72c6e4366)

Bug: 17526159
Change-Id: I74796043ac34753c6dd10018719ebc0bcd94e010
2014-10-08 14:01:45 -07:00
Mark Salyzyn 823a4c727a logd: auditd: report facility LOG_AUTH
(cherry pick from commit 7ee2aef8e0)

Change-Id: Ie325e1b58f52b6c728d5cfd6f6b87287fcf32e10
2014-10-08 14:01:45 -07:00
Mark Salyzyn 327cac6e0c logd: auditd: kmsg priority
(cherry pick from commit 6bdeee0ce6)

Change-Id: I2016fe140e2daf6c69efbd10aef205fffb931aa1
2014-10-08 14:01:45 -07:00
Riley Andrews 33b335495c Merge "Make the default cgroup, the foreground cgroup." into lmp-mr1-dev 2014-10-08 20:40:23 +00:00
Elliott Hughes 2c05b4fe41 Fix top for very large VSS.
Bug: 17913995

(cherry picked from commit 052d78f334)

Change-Id: Ia657c1aa5776f947905d8b0d499d64b5cfbae50c
2014-10-08 11:21:23 -07:00
Christopher Ferris 525db43bf5 am 6f7fd395: am 3fe9adc9: Merge "Fix write past end of memory." into lmp-dev
* commit '6f7fd39536b8d3dd7c0a5bbd9350e473e559ebff':
  Fix write past end of memory.
2014-10-08 05:24:51 +00:00