Commit Graph

142 Commits

Author SHA1 Message Date
Michael Wachenschwanz d53a5c4aa9 Disallow reading object data from Parcels with non-object reads
The check added to each non-object reads adds an overhead. If the
objects (binders and file descriptors) were written to the Parcel in
sequential order then check adds a small O(1) overhead to each read,
plus an O(N) overhead to the first read (to verify the N objects were
added in order).
If the objects were written out of order (as in by jumping around the
Parcel
with setDataPosition and writing Binder, DON'T DO THIS!!) (writing non
objects out of order is fine), the first read is forced to sort the
objects
in the internal bookkeeping. Based on the assumption non sequential
writes
are infrequent and overall Parcels are probably mostly sorted, insertion
sort was used. Worst case sorts will add an O(N^2) overhead to the first
non object read from the Parcel.

Test: run cts -m CtsOsTestCases -t android.os.cts.ParcelTest

Bug: 29833520
Change-Id: I82de8eb5f5eb56f869542d5358e96884c24301b2
(cherry picked from commit c517681c66a1a387be657e0cf06da8d19659dd14)
2018-07-16 20:31:22 +02:00
forkbomb 7cacf26abb libbinder: allow devices to disable ashmem size tracking
The addition of ashmem size tracking can lead to parcel objects
overwriting other values on the stack in old binary blobs.

Change-Id: Ife8514be1ba639c4061de38b59794c46bcc2d7f8
2015-12-10 10:15:49 +11:00
Steve Kondik 4951bcc16e Android 6.0.1 release 3
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iEYEABECAAYFAlZmBAkACgkQ6K0/gZqxDnhgbQCdFLtubCHWtlKUuIEKAVwzv2M3
 2jMAoI4UhN3nLb2Nf6BizcMSF3xo1pKO
 =NS5T
 -----END PGP SIGNATURE-----

Merge tag 'android-6.0.1_r3' of https://android.googlesource.com/platform/frameworks/native into cm-13.0

Android 6.0.1 release 3

Change-Id: I437aaf148d440a8144afe1454948980fc3b40cca
2015-12-07 17:07:16 -08:00
forkbomb 53602ffde5 libbinder: allow devices to disable ashmem size tracking
The addition of ashmem size tracking can lead to parcel objects
overwriting other values on the stack in old binary blobs.

Change-Id: Ida52cec851a6f9d5a57c8f9130a5875c03dcb094
2015-12-04 15:42:51 +11:00
Roman Birg 4dcf7868e3 update app ops
Change-Id: Id189866c1868e6340b1b01ca94c06983fbcc242d
Signed-off-by: Roman Birg <roman@cyngn.com>
2015-11-02 11:51:17 -08:00
codeworkx af2d946f2d binder: Squashed commit of MemoryHeapBaseIon
Source:
http://git.insignal.co.kr/samsung/exynos/android/platform/frameworks/native/commit/?h=exynos-jb&id=dc4cd25cc41e4358debd0c7d1a2706d208a58df6

Change-Id: Ib06cc37a2a25c78a061ee2bad48eec2d01b07833

binder: update MemoryHeapIon

* Update from ODROID-XU 09232013 BSP release

Change-Id: I5245c8a9f783e8902bf91a0ee23e60ebeb335b27

binder: update MemoryHeapIon

* Update from ODROID-XU 04212014 BSP

Change-Id: Ifc2664bcde37a71d855e05e7c9e50288a4508892

binder: Fixed new CM SLSI build variant

Change-Id: Icfff592cf705af660c7318b08fce75dbbf42103c
(cherry picked from commit 014ad5eee0a7de70c4a9f66e8f5ce7b32f4ecb16)
2015-11-02 17:29:40 +01:00
Adrian Roos 6bb3114246 Maintain Parcel ABI
Makes sure we don't change the memory layout of the Parcel class
to maintain binary compatibility with prebuilts linking against
libbinder.

Bug: 25004154
Change-Id: I656687497f08bb85cefda796aafa2341e601e30a
2015-10-22 17:48:16 -07:00
Adrian Roos cbf3726357 Revert "Revert "Track ashmem memory usage in Parcel""
This reverts commit 6880307e8e.

Bug: 25004154
Change-Id: I9b432d1ebc39f3bbcd7afdefc403f0fb6ced8158
2015-10-22 17:47:27 -07:00
Ian Pedowitz 6880307e8e Revert "Track ashmem memory usage in Parcel"
This reverts commit e2f499fb73.

Bug: 25169267
Bug: 25191602
Bug: 25004154
Change-Id: I24bb0da4e8739ee5a0c251e4adac9904827144e0
2015-10-22 22:09:16 +00:00
Adrian Roos e2f499fb73 Track ashmem memory usage in Parcel
Bug: 25004154
Change-Id: Id9d5656dd0605f1b50525596b75601309f67ebdc
2015-10-21 22:32:35 +00:00
Jeff Brown 13b1604018 Enable more flexible usage of blobs in parcels.
Add functions to allow a client to take over the ashmem region
that was transferred so that it can claim it for its own and
reuse it.

Add support for mutable ashmem regions too.

Bug: 21428802
Change-Id: I16eca338cdb99b07d81fc43573d53ce86dbc60c8
2015-06-05 17:40:59 -07:00
Tim Kilbourn 9e6d2ee030 DO NOT MERGE Remove unused ParcelFileDescriptor methods in parcel.
Attempts to replicate Java parceling in native code is fraught with
peril.

Change-Id: I4359036c5dddd1b886d886beef1d060523e53e5f
(cherry picked from commit f47a381001)
2015-06-04 21:36:21 +00:00
Ruben Brunk d47da60836 Track camera and flashlight usage in battery stats.
Bug: 15986092

Change-Id: I272ec070113a0bfc41c637c45a6e1a2ab346e87b
2015-06-01 16:55:07 -07:00
Svetoslav b412f6e203 Add body sensors app op - framework native
Change-Id: I727a2bb1e28ae9158f2df9c74dd0aee977dfd47f
2015-05-01 13:51:45 -07:00
Svet Ganov f1377f506c Respect the record audio app op - frameworks native
Change-Id: Id747767377953fd644a538aad3f603d6c50875a2
2015-04-28 16:33:28 -07:00
Dan Sandler 8f91a6fb04 Merge "Add ashmem stats to Parcels" 2015-04-21 14:10:23 +00:00
Dan Sandler aa5c2346c7 Add ashmem stats to Parcels
Requires change Ifaf115da in frameworks/base.

Bug: 20079551
Change-Id: Ifaf115dabd1a59cdb1b46e2d49c41f64ac107de4
2015-04-16 04:08:53 +00:00
Wale Ogunwale 376b822728 Added IPCThreadState::blockUntilThreadAvailable() method.
Will be used by the system_server watchdog to monitor the
availability of binder threads in the process to handle
incoming IPC requests.

Bug: 19297165
Change-Id: I39175f3869ad14da5620fddb47f454e6e4ee2b25
2015-04-14 13:17:25 -07:00
Ronghua Wu 2d13afdfa1 binder: add uint64 support to Parcel.
Bug: 19620911
Change-Id: Ifce5319e4e35afd344dead67ab7ba1cd399476a3
2015-03-19 16:45:04 -07:00
Ruben Brunk 52f0407d68 Add ProcessInfoService to activity manager.
- Adds a new AIDL interface for querying process
  information from activity manager.

Bug: 19186859

Change-Id: Ic08858f346d6b66e7bfc9da6faa2c6e38d9b2e82
2015-02-02 14:56:55 -08:00
Dan Stoza e4ea03f74d am 80e81505: Merge "binder: Add {read,write}Uint32 methods to Parcel"
* commit '80e8150549c9d8380dadf942336d41ab3d92bf78':
  binder: Add {read,write}Uint32 methods to Parcel
2014-12-01 19:27:00 +00:00
Dan Stoza 32ad1d518b am 104e1259: Merge "binder: Return pid_t/uid_t instead of int"
* commit '104e12594e085bc8dd32eedb96643b774b1508a0':
  binder: Return pid_t/uid_t instead of int
2014-12-01 19:23:22 +00:00
Dan Stoza 41a0f2f86c binder: Add {read,write}Uint32 methods to Parcel
Adds readUint32 and writeUint32 methods to the Parcel class. This
saves a lot of static_casting in anything implementing a Binder
interface on the native side.

Change-Id: Iafc73b0633654a3a4c49767f41806b56906c924f
2014-12-01 11:13:11 -08:00
Dan Stoza 9c634fd2d1 binder: Return pid_t/uid_t instead of int
Makes IPCThreadState::getCalling{Pid,Uid} return a more
appropriate type.

Change-Id: I97f8a83c1c0722bc1afbf8a6df1a288f8f1f0d2c
2014-12-01 11:07:14 -08:00
Marco Nelissen e12cfc23b2 am 55f71bc0: Merge "Replace IInterface::asBinder() with a static"
* commit '55f71bc0800b9ec7a779c5d30d5a90e074c2526b':
  Replace IInterface::asBinder() with a static
2014-11-17 18:52:56 +00:00
Marco Nelissen 097ca275f4 Replace IInterface::asBinder() with a static
so we can do NULL checks again, and update calls to IInterface::asBinder()
to use the new static version.

Change-Id: Ia7b10eb38ca55b72278bfd33d3bf647f338b4e6a
2014-11-17 08:47:01 -08:00
Yabin Cui 007335e688 am bc49cd07: Merge "kill HAVE_FORKEXEC"
* commit 'bc49cd07664d8a590bc6ed44884ba9405f6b706e':
  kill HAVE_FORKEXEC
2014-11-13 23:35:25 +00:00
Yabin Cui 0dd549aae0 kill HAVE_FORKEXEC
Bug: 18317407
Change-Id: I0c7b5886e5de12bdd95cfcc046bc87e4a6aeef5b
2014-11-12 17:10:40 -08:00
Dianne Hackborn 7e790af756 Add tracking of parcel memory allocations.
Change-Id: I76ffed0e69ccfe70e87d98646f11d4de7c3fd980
2014-11-11 16:23:04 -08:00
Hans Boehm 08ff802151 Revert "Revert "Revert "Revert "Remove incorrect android_atomic_...64 use.""""
After fixing b/16874785.

This reverts commit f010a05c7e.

Original comment, which actually describes the effect of this:

Change the mExtras field in Binder.h to be a stdatomic.h atomic
value, and replace references to it with proper stdatomic.h calls.
This removes one of a small number of remaining 64 bit
android_atomic references.  It also replaces the erroneously
non-atomic read accesses to mExtras.

It would be better if this used the C++11 <atomic> facility,
but we don't quite have that yet.

Fixes

Bug:16513433

Change-Id: I1645ca5d6f60595bf5d388913665ce4b8780b26d
(cherry picked from commit 3effababf2)
2014-09-02 16:11:46 -07:00
Hans Boehm dc1fb90857 am a0187a9c: Merge "Revert "Revert "Revert "Revert "Remove incorrect android_atomic_...64 use."""""
* commit 'a0187a9c83cb042b4cb92dac59214247bb7affcf':
  Revert "Revert "Revert "Revert "Remove incorrect android_atomic_...64 use.""""
2014-08-13 00:19:23 +00:00
Hans Boehm 3effababf2 Revert "Revert "Revert "Revert "Remove incorrect android_atomic_...64 use.""""
After fixing b/16874785.

This reverts commit f010a05c7e.

Change-Id: I1645ca5d6f60595bf5d388913665ce4b8780b26d
2014-08-12 22:56:00 +00:00
Hans Boehm d87319ddc8 am f491f497: Merge "Revert "Revert "Revert "Remove incorrect android_atomic_...64 use.""""
* commit 'f491f497b2a4ba5a0ec60b291cce4ffb3be3d33c':
  Revert "Revert "Revert "Remove incorrect android_atomic_...64 use."""
2014-08-09 02:50:38 +00:00
Hans Boehm f010a05c7e Revert "Revert "Revert "Remove incorrect android_atomic_...64 use."""
This reverts commit 66629e0de5.

Change-Id: Ic298b345d0e500d18e4297b00e755ce3340f13fb
2014-08-09 01:17:13 +00:00
Hans Boehm e0b96dbf2a am 6e5316b1: Merge "Revert "Revert "Remove incorrect android_atomic_...64 use."""
* commit '6e5316b1dac10bed0d81f4b2942e4a8749cd67b2':
  Revert "Revert "Remove incorrect android_atomic_...64 use.""
2014-08-09 00:38:27 +00:00
Hans Boehm 66629e0de5 Revert "Revert "Remove incorrect android_atomic_...64 use.""
This reverts commit 9dc5c269f7.
Adds a stdint.h include in case stdatomic.h stops including that.

Change-Id: If3dd1db1f1132c0f2dc1efb0a44617d3f36d7cfb
2014-08-08 17:14:30 -07:00
Hans Boehm 9e0ef391e8 am 735082ea: Merge "Revert "Remove incorrect android_atomic_...64 use.""
* commit '735082ea156d91cf72c241e9134abc22038c8f13':
  Revert "Remove incorrect android_atomic_...64 use."
2014-08-06 22:56:57 +00:00
Hans Boehm 9dc5c269f7 Revert "Remove incorrect android_atomic_...64 use."
This reverts commit 88b7541d68.

Change-Id: Ie701c308451a3697bb167aff119318b932133f90
2014-08-06 22:45:13 +00:00
Hans Boehm 52bfb70cf8 am c11eca81: Merge "Remove incorrect android_atomic_...64 use."
* commit 'c11eca81e66892eb62a03b4553055197d122fe5b':
  Remove incorrect android_atomic_...64 use.
2014-08-06 21:21:05 +00:00
Chong Zhang 2cbba477be add noteResetVideo/Audio to IBatteryStats
Bug: 12979595
Change-Id: Ida474e539a3af0a85ec157a66bbf986430c8020e
2014-07-23 21:51:56 +00:00
Hans Boehm 88b7541d68 Remove incorrect android_atomic_...64 use.
Change the mExtras field in Binder.h to be a stdatomic.h atomic
value, and replace references to it with proper stdatomic.h calls.
This removes one of a small number of remaining 64 bit
android_atomic references.  It also replaces the erroneously
non-atomic read accesses to mExtras.

It would be better if this used the C++11 <atomic> facility,
but we don't quite have that yet.

Bug: 16513433
Change-Id: Ibabb88d05025187ee1ce6c7f1aa670b133a547f8
2014-07-23 11:35:13 -07:00
Chong Zhang bd42d38b16 update battery status for audio/video
Bug: 12979595

Change-Id: Ic8e8d625becc6d1050f840ad63b7423f388eeba3
2014-07-22 23:08:53 +00:00
Narayan Kamath 7da40c0a84 Remove Parcel::writeIntPtr.
All uses of this API have been removed. It should
never have been made public in the first place.

bug: 15424960
Change-Id: Id07d24ec95b2b393e6da138a7e8a9a4ecebeca94
2014-06-12 15:26:39 +01:00
Narayan Kamath f905bc3bdc Remove Parcel::writeIntPtr.
All uses of this API have been removed. It should
never have been made public in the first place.

bug: 15424960

(cherry picked from commit 7da40c0a84)

Change-Id: I8d89f62dbdaee7149ef908e0c97417b85e0c48a2
2014-06-13 10:27:33 +01:00
Bill Yi e4f00b2aae Merge commit '6d05ef2310bdc84811d5b0385b009ad11447a749' into HEAD 2014-04-29 11:34:19 -07:00
Narayan Kamath 7f4fe6e586 am d09b2acd: am 033bdd72: Merge "Remove global variables from ProcessState."
* commit 'd09b2acdc8ca706c65984956e61c0bb333cee992':
  Remove global variables from ProcessState.
2014-04-03 16:56:29 +00:00
Narayan Kamath d09b2acdc8 am 033bdd72: Merge "Remove global variables from ProcessState."
* commit '033bdd72f9f32f4bd3d282750bdc0dcfbb469959':
  Remove global variables from ProcessState.
2014-04-03 14:11:31 +00:00
Narayan Kamath 162ea0e9e8 Remove global variables from ProcessState.
These weren't really being used and they make it
very hard to reason about who looks at command line
arguments.

Processes started via app_process (this includes all
zygote forks and the system_server) can get information
about command line arguments from the AndroidRuntime
class, which is available via a call to
AndroidRuntime::getRuntime.

bug: 13647418

Change-Id: I6f92680c3619a68c6d4b0995db4cdc9adc788e36
2014-04-03 12:29:44 +00:00
Glenn Kasten 6546f2e458 Allow creation of heaps that are read-only to partner
Change-Id: I3c2b3d9b1671da4b9d9c58dce27e291d30703b03
2014-03-18 15:07:43 -07:00
Marco Nelissen ce9f107c9d am 793be12c: am b730a452: am f0190bff: Add support for writing byte arrays to parcels
* commit '793be12c0f5a7878d1085e94e58a9c36c84f0911':
  Add support for writing byte arrays to parcels
2014-03-15 00:30:46 +00:00