| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
| |
This is slow, but it's required to prevent memory
corruption.
Ignore-AOSP-First: security
Bug: 370840874
Test: fuzzer
(cherry picked from commit c54dad65317f851ce9d016bd90ec6a7a04da09fc)
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:640d942d6a9a26a0beca87d3abdf2ee1048985b9)
Merged-In: Ibc5566ade0389221690dc90324f93394cf7fc9a5
Change-Id: Ibc5566ade0389221690dc90324f93394cf7fc9a5
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
This is unexpected behavior so throw an error.
Allocating this much memory may cause OOM or
other issues.
Bug: 370831157
Test: fuzzer
(cherry picked from commit 608524d462278c2c9f6716cd94f126c85e9f2e91)
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:93856b3c6df5a34717dddddfab23d945753f7de8)
Merged-In: Iea0884ca61b08e52e6a6e9c66693e427cb5536f4
Change-Id: Iea0884ca61b08e52e6a6e9c66693e427cb5536f4
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Only close FDs within the truncated part of the parcel.
This change also fixes a bug where a parcel truncated into the middle of
an object would not properly free that object. That could have resulted
in an OOB access in `Parcel::truncateRpcObjects`, so more bounds
checking is added.
The new tests show how to reproduce the bug by appending to or partially
truncating Parcels owned by the kernel. Two cases are disabled because
of a bug in the Parcel fdsan code (b/370824489).
Cherry-pick notes: Add truncateFileDescriptors method instead of
modifying closeFileDescriptors to avoid API change errors. Tweaked the
test to support older C++ and android-base libs.
Flag: EXEMPT bugfix
Ignore-AOSP-First: security fix
Bug: 239222407, 359179312
Test: atest binderLibTest
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:e77c9487166599cce197597038011f0879770ab4)
Merged-In: Iadf7e2e98e3eb97c56ec2fed2b49d1e6492af9a3
Change-Id: Iadf7e2e98e3eb97c56ec2fed2b49d1e6492af9a3
|
| |\
| |
| |
| |
| |
| |
| |
| |
| | |
dda7686ebb am: 8ff6f889dc
Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/2852823
Change-Id: I3ce78f71a50097e1e0e7f177a9e8a511c9b619a6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
|
| | |\ |
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
- add missing includes
- fix maybe_unused warning
- use LOG_ALWAYS_FATAL instead of __assert (behind flag)
Bug: 302723053
Test: mma in binder folder
Change-Id: I4e90ff7c7f37e6736bc38abaa11744ccf7155a17
|
| |\| |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
96b83024e4 am: 3969bc7e77 am: e712783ddc
Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/2860905
Change-Id: I6733149035dabe2e6d7fe47134df7a77fe8d97f9
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
|
| | |/
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Bringing this up in new environments, we need to make sure
they use different headers, so we never copy transactions
from one environment or another by accident.
Bug: 313702213
Test: build
Change-Id: I0cae4a149267862092030c00d239e93155f70143
|
| |\|
| |
| |
| |
| |
| |
| | |
Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/2813342
Change-Id: I64b6511d1bb87247f418f5de5ede4d85be58f9cf
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
|
| | |
| |
| |
| |
| |
| | |
Test: mma
Bug: 302723053
Change-Id: I52f14cadb027b3f854946d5315dce3d23aa21b19
|
| |\|
| |
| |
| |
| |
| |
| |
| |
| | |
"revert-2807644-revert-2780893-XRITMVSTFB-ZYEEKMIRIQ" into main am: dc0f937ddf am: d6ca48dcab am: 124fd63f89
Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/2809894
Change-Id: I4f9ae094682ebb7649dae05d04ad85ec565d2cda
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
|
| | |
| |
| |
| |
| |
| |
| |
| | |
25c1a3b8543dd1756308424dd65030f90bb7a99f
Test: m
Bug: 302723053
Change-Id: Id9355c10d78d0c55afb49f512b78bb0923fbc4f7
|
| |\|
| |
| |
| |
| |
| |
| |
| |
| | |
am: 2f1ac888ec am: f224612600
Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/2802651
Change-Id: Ib4effc268401fd8c09de27f88f2c80729eebb335
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
|
| | |
| |
| |
| |
| |
| | |
Bug: 302723053
Test: mma
Change-Id: Id68a10a491e3db7f27ea2cbf843078544bb0ab85
|
| |\|
| |
| |
| |
| |
| |
| |
| |
| | |
f334e5da6d am: 7eaf64f8ed am: e6bf9ec7e7
Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/2807155
Change-Id: Icaabf54dfc20d432d7c1b23fc82824211941bf07
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
|
| | |
| |
| |
| |
| |
| | |
Bug: 302723053
Test: mma
Change-Id: I0dddbd085b1999c3eb11577e6120ea422be4c10a
|
| |\|
| |
| |
| |
| |
| |
| |
| |
| | |
271bd23714 am: 4ad3f2b2ef am: e75d125951
Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/2807644
Change-Id: If83584db96e59d57965a65f20b257e7c4839dde1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Revert submission 2780893
Reason for revert: breaking boot tests
Bug: 308214260
Reverted changes: /q/submissionid:2780893
Change-Id: I7a4ee9a45583a8a1d4a33447de55c63e6ce9d42a
|
| |\|
| |
| |
| |
| |
| |
| |
| |
| | |
am: 01f261380d
Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/2780893
Change-Id: Ic227eca26dd7a4d3cf45e8c864f43a8a248e8844
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
|
| | |
| |
| |
| |
| |
| | |
Bug: 302723053
Test: mma
Change-Id: I27226885b8b5e771d675ba2d83d0a2e14551d13e
|
| |\|
| |
| |
| |
| |
| |
| |
| |
| | |
am: 50af66c545 am: d924869ae6
Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/2779429
Change-Id: I1212495972fd37e040cbb85747f45cd47cba255d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
|
| | |
| |
| |
| |
| |
| | |
Bug: 302723053
Test: mma
Change-Id: Ia6d80574a3b137c7646b4a8a7575e03197fcb527
|
| |\|
| |
| |
| |
| |
| |
| |
| |
| | |
e96bb74514 am: 7f68d9da8f
Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/2779430
Change-Id: I4ebb5f72ec3a2db03aea23fd18e59f94f5ee7b2a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
|
| | |
| |
| |
| |
| |
| | |
Bug: 302723053
Test: mma
Change-Id: I2abc138831da28783b26efe75ee6f4583e263692
|
| |\|
| |
| |
| |
| |
| |
| |
| |
| | |
into main am: 3f4c4957a6 am: 4792f034f3 am: 15d7bc7d43 am: 27138eb395 am: 8f7cc14d21
Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/2776819
Change-Id: I912047d8711101d2a8c9d4f690622c06bb4b865a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
|
| | |
| |
| |
| |
| |
| |
| | |
Bug: 302723053
Test: mma in binder folder
Test: aosp/2616196
Change-Id: I73df8fc453df0edf496960853cb0004f1c3a6a43
|
| |\|
| |
| |
| |
| |
| |
| |
| |
| | |
56f83aa426 am: e963d6b2d6 am: 3829544d2c am: 2362ad9738 am: 28b7a7e346
Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/2779433
Change-Id: Ic2312fd34ef66ff4356eb617d1dfe798f09dbf17
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
|
| | |
| |
| |
| |
| |
| | |
Bug: 302723053
Test: mma
Change-Id: I126772474763a55f43de0cd4a3d2605f7f84da3b
|
| |\|
| |
| |
| |
| |
| |
| |
| |
| | |
13da0f9a0f am: 7e5716d5fd am: 5f539c068f am: 132e927860
Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/2704458
Change-Id: I25e93d8f301178b4a45e6a5b82f2ff4abf99ff9a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Current String8::string() has two problems: it may suggest it's
returning a std::string and also prevents a drop-in replacement
with std::string.
Bug: 295394788
Test: make checkbuild
Change-Id: I1eb6ddebe3faede57f3e6f046da572a79056125a
|
| |\ \
| |/
|/| |
|
| | |
| |
| |
| |
| |
| | |
734537727237ec6217241520f66229630359d303
Change-Id: I8e3df46d474c857a76fb00ab195d73dbea282520
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Revert submission 23699976-fdsan-parcel
Reason for revert: Possible culprit for b/288448299
Reverted changes: /q/submissionid:23699976-fdsan-parcel
Change-Id: I8d7b4e222598436271ee03cfc8826910327c98aa
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Marks FDs as owned by the Parcel for clearer errors
if other things accidentally own them.
Bug: 287093457
Test: boot
Test: binderUnitTest
Test: binder_parcel_fuzzer (several minutes on-device)
Ignore-AOSP-First: this requires some fixes only in
git_master to avoid crashing
Change-Id: Ibbcc7fdf074a0a1a61ae11f61c8b11f8445aef20
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When passing binders into NDK backend services, we always
type check them immediately. This allows errors to show
up earlier there, but may be inefficient because the type
will also be checked on every transaction. Anyway...
This poses a problem for our automatic fuzzers because
callbacks passed into services (e.g. RandomBinder) will
be ignored for NDK backend fuzzers unless they correctly
guess their interface descriptor.
There are a few things we could do:
- use random strings from the environment
- export a list of possible interface descriptors from AIDL
- generate our corpuses from other data
However, the simplest thing we can do is ignore the check,
which this CL does.
Of course, it isn't great to continue differentiated fuzzer
behavior from actual behavior, so we'd like to revert this
once we have a more comprehensive solution. However, callbacks
are a fundamental AIDL building blocks, so forcing good
fuzzer coverage for these pieces seems justified.
Bug: N/A
Test: I added an abort in an NDK backend service. Without this
change, that path is never found, but with this change, it
was hit after only ~6,000 iterations.
Change-Id: I4cbe5c56b93b9300fbd57e72e24075c02df38ba9
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
We bypass this half the time in the driver now, but
it's better to bypass it here in Parcel so that we
fuzz how different fields are set at the beginning
of Parcel.
Bug: N/A
Test: servicemanager_fuzzer for several minutes
Change-Id: I17399680c0f5d9239071e9d4fa6bcedb545f7871
|
| |/
|
|
|
|
|
|
|
|
|
|
|
|
| |
In service fuzzing mode, we disable logs in the core
Parcel code and also limit some API checks.
This increases fuzzer efficiency (~2x or more, ignoring
service-specific inefficiencies) just due to bypassing
the 'mixing copies of libbinder' check, which isn't
critical for fuzzing.
Bug: N/A
Test: manual, diffing strace outputs
Change-Id: I4952b3ab5f55f27f33d5124e39541fdd40143971
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Checking for internal buffer size which should handle cases where
parcel has position set beyond datasize and data size is actually
returning the data position.
Test: m && acloud delete --all && acloud create --local-image --local-instance
&& atest -c CtsNdkBinderTestCases
Test: m binder_parcel_fuzzer &&
out/host/linux-x86/fuzz/x86_64/binder_parcel_fuzzer/binder_parcel_fuzzer
Bug: 264739302
Change-Id: Ib6c49fde1c1a56bae3932ce9af731a200b8a8faa
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Parcel::writeFileDescriptor should be creating a binder_fd_object and
serializing it for submission to the binder driver. However the common
Parcel::writeObject function takes a flat_binder_object as an argument,
so writeFileDescriptor creates a flat_binder_object and uses the memory
locations equivalent to the correct fields in binder_fd_object. That
works, but in the process the flags field of the object is populated
with FLAT_BINDER_FLAG_* values, which is incorrect for an object type
of BINDER_TYPE_FD. The binder driver does not attempt to check that the
flags field is populated only with valid flag bits (and this would be
pretty difficult, since valid flag values overlap between the two
types), but it also does not do anything with these invalid flags. So
here we remove them.
Test: Cuttlefish boots successfuly
Change-Id: I1ba07855976097f7b99ea78526c933df42be68ba
|
| |\ |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
Use the new dupFileDescriptor API in one additional place
in Parcel.cpp to make the code more portable.
Bug: 230135749
Test: presubmit
Change-Id: I41c18c1e319eb7ad06c90d6a495bad31bd677a6d
|
| |/
|
|
|
|
|
|
|
|
|
|
| |
Adding API to skip dataAvail check and using it in
fuzzService.
Bug: 241848255
Test: m binderUnitTest &&
out/host/linux-x86/nativetest64/binderUnitTest/binderUnitTest
Test: m servicemanager_fuzzer &&
out/host/linux-x86/fuzz/x86_64/servicemanager_fuzzer/servicemanager_fuzzer
Change-Id: Ib43936ff4a7dca4a036d34b3e475d553f3d21be2
|
| |
|
|
|
|
|
|
|
| |
Implement ParcelFileDescriptor support in Trusty by
adding support for ancillaryFd to RpcTransportTipcTrusty.
Bug: 242940548
Test: Trusty tests
Change-Id: Ic5602bbf9f239f65489e0f411f89b10907741be3
|
| |
|
|
|
|
|
|
|
|
| |
TextOutput based logs are causing direct leaks while fuzzing service
manager. Modifying logs to use liblog based logging functions.
BUG: 240388906
Test: m SANITIZE_HOST=address servicemanager_fuzzer &&
out/host/linux-x86/fuzz/x86_64/servicemanager_fuzzer/servicemanager_fuzzer
Change-Id: I3721051bc92df86c80dce9ed2e9dcac20cafef84
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Adds ParcelFileDescriptor.cpp to the Trusty build
which in turn compiles some extra related code from
Parcel.cpp. This code uses fcntl(...O_DUPFD_CLOEXEC...)
to duplicate file descriptors which is not available
on Trusty (or other OSes), so we abstract the relevant
calls to that function in a wrapper in OS.cpp.
Bug: 224644083
Test: m
Test: build on Trusty
Change-Id: I2e0ee517e7c7b55458a6ee6db977985aab4d7c58
|
| |
|
|
|
|
|
|
|
|
| |
We already check the bounds when they are used, but it is easier to
reason about the code if they are validated before being stored.
The `freeData` call was redundant (handled by dtor).
Test: TH
Change-Id: I5160e72b5225b933068a3aa68eb5287bf7a29af1
|
| |
|
|
|
|
|
|
|
|
| |
This enforces a clearer separation of concerns between the data owner
and the parcel code. It happened to reveal an edge case where FDs are
prematurely closed (tracking a fix in b/239222407).
Test: TH
Bug: 239222407
Change-Id: I54ff0c8e4a8f64afd529092d2038dac40c853371
|
| |
|
|
|
|
|
|
|
| |
Abort with LOG_ALWAYS_FATAL if Parcel::appendFrom is called
on a kernel Parcel in a no-kernel build.
Bug: 224644083
Test: build on Trusty
Change-Id: I8a63b23fbd465de8d0e89597622692f7266ed0bf
|
| |
|
|
|
|
|
|
|
| |
Use BINDER_KERNEL_IPC to disable all code that
uses flat_binder_object in Parcel.cpp.
Bug: 224644083
Test: m
Change-Id: I1f676dbfb464fc0c5eaa6b5266b7af1dabe984e1
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a slight change the to wire protocol. Now out-of-band FDs must
be sent along with the command header bytes.
The code changes exploit that by only using the more complex `recvmsg`
call when reading the command header. Additionally, we explicitly pass
around the list of FDs so that there is no risk of accumulating them.
The same (somewhat ugly) vector type is used everywhere now so that
there is only one allocation to capture the FDs and pass them to the
`Parcel` object.
Test: binderRpcTest
Bug: 185909244
Change-Id: I1f55995ca82338ab9716fb2246c954ac8b16cfe5
|