Commit 7bdc1096 authored by Mika Raento's avatar Mika Raento
Browse files

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.

TODO: cherry-pick to pi-dev - the test crash is in master and I want to
verify it is fixed.

Bug: 79705516
Test: NeuralNetworksTest_static/*strided_slice* with address sanitizer on marlin-userdebug
Test: NeuralNetworksTest_static/*strided_slice* on marlin-userdebug
Change-Id: I4db9c7460d1c4d943ba7ced36b4d8801d0e0ec99
parent 08f6a619
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment