Parcel: Avoid realloc on owned Parcels.

Continuation of support to allow 'write' calls
on Parcel objects in any state. That is, any call
on any Parcel API in any state should be valid.

Bug: 382799130
Test: with fuzzer
Change-Id: Ib139ee941f070724fb61ecb3ada2fc689545b11b
diff --git a/libs/binder/Parcel.cpp b/libs/binder/Parcel.cpp
index a5f416f..d09d5a8 100644
--- a/libs/binder/Parcel.cpp
+++ b/libs/binder/Parcel.cpp
@@ -1804,6 +1804,15 @@
         return finishWrite(sizeof(flat_binder_object));
     }
 
+    if (mOwner) {
+        // continueWrite does have the logic to convert this from an
+        // owned to an unowned Parcel. However, this is pretty inefficient,
+        // and it's really strange to need to do so, so prefer to avoid
+        // these paths than try to support them.
+        ALOGE("writing objects not supported on owned Parcels");
+        return PERMISSION_DENIED;
+    }
+
     if (!enoughData) {
         const status_t err = growData(sizeof(val));
         if (err != NO_ERROR) return err;