fix oob operand read on short coopMatPerElementNV arg list - #4395
Open
saddamr3e wants to merge 1 commit into
Open
fix oob operand read on short coopMatPerElementNV arg list#4395saddamr3e wants to merge 1 commit into
saddamr3e wants to merge 1 commit into
Conversation
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.
ASan,
coopMatPerElementNV()andcoopMatPerElementNV(relu):coopMatPerElementNV/EXTare declared with an empty prototype (void coopMatPerElementNV();), so overload resolution accepts any argument list. A call missing one of the required (result matrix, input matrix, per-element function) operands is not passed as an aggregate, so the whole validation body inhandleCoopMat2FunctionCall(guarded byarguments->getAsAggregate()) is skipped and the malformedEOpCooperativeMatrixPerElementOpNVreaches codegen, whereoperands[0]is read as the result matrix: with no arguments the operand vector is empty, with one it holds the function id whose type lookup dereferences a null instruction.Reject a per-element call that is not an aggregate of at least three arguments in the front end. Both builtins map to
EOpCooperativeMatrixPerElementOpNV, so one check covers them, and only these two use the empty prototype. AddedTest/spv.coopmat2_perelement_error.comp.