Copybara import of the project: - #11157
Open
copybara-service[bot] wants to merge 1 commit into
Open
Conversation
copybara-service
Bot
force-pushed
the
test_977470632
branch
from
September 8, 2026 17:40
f4afd6f to
bf07f46
Compare
-- e9d6b38 by destro4evr-rgb <destro4evr@proton.me>: litert/tensor: guard AveragePool2D/MaxPool2D/Conv2D/DepthwiseConv2D against under-rank input in arithmetic.h AveragePool2D, MaxPool2D, Conv2DImpl, and DepthwiseConv2DImpl all access fixed shape indices (shape[1], shape[2], shape[3]) without first checking that the input (and filter) shape vectors are large enough. A crafted TFLite model with a rank-0 or rank-1 tensor on any of these operators causes an out-of-bounds std::vector::operator[] access at graph-construction time, before inference, resulting in SIGSEGV. PR #11057 added equivalent guards to the ToXnnpack() methods in arithmetic.cc (graph-compilation time), but the earlier crash in arithmetic.h (graph-construction time) was not covered. Add rank < 4 checks before the first shape subscript in each function. FUTURE_COPYBARA_INTEGRATE_REVIEW=#11154 from destro4evr-rgb:fix/litert-conv-pool-arithmetic-h-rank-checks e9d6b38 PiperOrigin-RevId: 977470632
copybara-service
Bot
force-pushed
the
test_977470632
branch
from
September 8, 2026 19:49
bf07f46 to
f760ea3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Copybara import of the project:
--
e9d6b38 by destro4evr-rgb destro4evr@proton.me:
litert/tensor: guard AveragePool2D/MaxPool2D/Conv2D/DepthwiseConv2D against under-rank input in arithmetic.h
AveragePool2D, MaxPool2D, Conv2DImpl, and DepthwiseConv2DImpl all
access fixed shape indices (shape[1], shape[2], shape[3]) without
first checking that the input (and filter) shape vectors are large
enough. A crafted TFLite model with a rank-0 or rank-1 tensor on
any of these operators causes an out-of-bounds std::vector::operator[]
access at graph-construction time, before inference, resulting in
SIGSEGV.
PR #11057 added equivalent guards to the ToXnnpack() methods in
arithmetic.cc (graph-compilation time), but the earlier crash in
arithmetic.h (graph-construction time) was not covered. Add rank < 4
checks before the first shape subscript in each function.
FUTURE_COPYBARA_INTEGRATE_REVIEW=#11154 from destro4evr-rgb:fix/litert-conv-pool-arithmetic-h-rank-checks e9d6b38