diff options
-rw-r--r-- | include/android/storage_manager.h | 6 | ||||
-rw-r--r-- | libs/binder/Parcel.cpp | 1 | ||||
-rw-r--r-- | libs/binder/ParcelableHolder.cpp | 5 | ||||
-rw-r--r-- | libs/binder/ndk/include_cpp/android/binder_parcelable_utils.h | 7 | ||||
-rw-r--r-- | libs/binder/rust/src/parcel/parcelable_holder.rs | 4 | ||||
-rw-r--r-- | libs/input/Android.bp | 2 |
6 files changed, 21 insertions, 4 deletions
diff --git a/include/android/storage_manager.h b/include/android/storage_manager.h index 7f2ee08d62..270570e0df 100644 --- a/include/android/storage_manager.h +++ b/include/android/storage_manager.h @@ -124,6 +124,12 @@ typedef void (*AStorageManager_obbCallbackFunc)(const char* filename, const int3 /** * Attempts to mount an OBB file. This is an asynchronous operation. + * + * Since API level 33, this function can only be used to mount unencrypted OBBs, + * i.e. the {@code key} parameter must be {@code null} or an empty string. Note + * that even before API level 33, mounting encrypted OBBs didn't work on many + * Android device implementations. Applications should not assume any particular + * behavior when {@code key} is nonempty. */ void AStorageManager_mountObb(AStorageManager* mgr, const char* filename, const char* key, AStorageManager_obbCallbackFunc cb, void* data); diff --git a/libs/binder/Parcel.cpp b/libs/binder/Parcel.cpp index 504c6c2d83..a217a157c9 100644 --- a/libs/binder/Parcel.cpp +++ b/libs/binder/Parcel.cpp @@ -1862,6 +1862,7 @@ status_t Parcel::readStrongBinder(sp<IBinder>* val) const { status_t status = readNullableStrongBinder(val); if (status == OK && !val->get()) { + ALOGW("Expecting binder but got null!"); status = UNEXPECTED_NULL; } return status; diff --git a/libs/binder/ParcelableHolder.cpp b/libs/binder/ParcelableHolder.cpp index 2e86b7415a..3cf94e3047 100644 --- a/libs/binder/ParcelableHolder.cpp +++ b/libs/binder/ParcelableHolder.cpp @@ -52,7 +52,10 @@ status_t ParcelableHolder::writeToParcel(Parcel* p) const { } status_t ParcelableHolder::readFromParcel(const Parcel* p) { - this->mStability = static_cast<Stability>(p->readInt32()); + int32_t wireStability; + if (status_t status = p->readInt32(&wireStability); status != OK) return status; + if (static_cast<int32_t>(this->mStability) != wireStability) return BAD_VALUE; + this->mParcelable = nullptr; this->mParcelableName = std::nullopt; int32_t rawDataSize; diff --git a/libs/binder/ndk/include_cpp/android/binder_parcelable_utils.h b/libs/binder/ndk/include_cpp/android/binder_parcelable_utils.h index 28819bb42a..f45aa7631b 100644 --- a/libs/binder/ndk/include_cpp/android/binder_parcelable_utils.h +++ b/libs/binder/ndk/include_cpp/android/binder_parcelable_utils.h @@ -101,7 +101,12 @@ class AParcelableHolder { return STATUS_INVALID_OPERATION; } - RETURN_ON_FAILURE(AParcel_readInt32(parcel, &this->mStability)); + parcelable_stability_t wireStability; + RETURN_ON_FAILURE(AParcel_readInt32(parcel, &wireStability)); + if (this->mStability != wireStability) { + return STATUS_BAD_VALUE; + } + int32_t dataSize; binder_status_t status = AParcel_readInt32(parcel, &dataSize); diff --git a/libs/binder/rust/src/parcel/parcelable_holder.rs b/libs/binder/rust/src/parcel/parcelable_holder.rs index d58e839ad4..432da5dfd7 100644 --- a/libs/binder/rust/src/parcel/parcelable_holder.rs +++ b/libs/binder/rust/src/parcel/parcelable_holder.rs @@ -233,7 +233,9 @@ impl Parcelable for ParcelableHolder { } fn read_from_parcel(&mut self, parcel: &BorrowedParcel<'_>) -> Result<(), StatusCode> { - self.stability = parcel.read()?; + if self.stability != parcel.read()? { + return Err(StatusCode::BAD_VALUE); + } let data_size: i32 = parcel.read()?; if data_size < 0 { diff --git a/libs/input/Android.bp b/libs/input/Android.bp index e73c3b8518..71a129141d 100644 --- a/libs/input/Android.bp +++ b/libs/input/Android.bp @@ -113,7 +113,7 @@ cc_library { "frameworks/native/libs/arect/include", ], }, - linux_glibc: { + host_linux: { srcs: [ "InputTransport.cpp", "android/os/IInputConstants.aidl", |