Validate strided slice output dims in cpu executor

This fixes a buffer overflow in the strided slice cpu implementation.

The strided slice operation has an option to "shrink" an axis, meaning
that a dimension of the input is removed from the output. This requires
the corresponding slice to have size 1. The size constraint was not
checked and unit tests were using a size of 2, leading to an overflow
when executing the op.

TODO: add a test for the validation, b/79856511. I want to get this fix
in ASAP as currently the tests crash in the continuous build so we will
not see other failures.

Bug: 79705516
Test: NeuralNetworksTest_static/*strided_slice* with address sanitizer on marlin-userdebug
Test: NeuralNetworksTest_static/*strided_slice* on marlin-userdebug
Merged-In: I4db9c7460d1c4d943ba7ced36b4d8801d0e0ec99

(cherry picked from commit 7bdc10967deee216043f2dd8d79bb352776c66b7)

Change-Id: Icbc0f6eb52fe8fd179c25312aff9d2374ad58679
12 files changed
tree: f3f3ad5abf1d47b130774e949b4781ea3ea2a0a0
  1. common/
  2. driver/
  3. runtime/
  4. tools/
  5. Android.bp
  6. CleanSpec.mk
  7. OWNERS
  8. README.txt