Commit ee92757
Add bounds validation for FreeCall value_index in Method (pytorch#18176)
The FreeCall instruction handler directly indexes into values_ without
bounds checking, enabling OOB memory access via malicious PTE files.
This contrasts with JumpFalseCall which validates its index at init
time, and MoveCall which uses bounds-checked accessors at execution
time.
Add init-time validation for FreeCall matching the JumpFalseCall
pattern, and switch execution-time access to use the bounds-checked
mutable_value() accessor for defense in depth.
This PR was authored with the assistance of Claude.
Co-authored-by: Github Executorch <github_executorch@arm.com>1 parent 6bd9bca commit ee92757
1 file changed
Lines changed: 13 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1060 | 1060 | | |
1061 | 1061 | | |
1062 | 1062 | | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + | |
| 1068 | + | |
| 1069 | + | |
| 1070 | + | |
| 1071 | + | |
| 1072 | + | |
| 1073 | + | |
| 1074 | + | |
1063 | 1075 | | |
1064 | 1076 | | |
1065 | 1077 | | |
| |||
1501 | 1513 | | |
1502 | 1514 | | |
1503 | 1515 | | |
1504 | | - | |
| 1516 | + | |
1505 | 1517 | | |
1506 | 1518 | | |
1507 | 1519 | | |
| |||
0 commit comments