neo-go/pkg/vm
Anna Shaleva 3be37e8c5b vm: check instruction offset is valid before subsequent IP move
Reference implementation:
e167f03e25/src/neo-vm/ExecutionContext.cs (L77).

Turns out that exception-related code (try\finally handling) is the only
place where next instruction pointer bounds are not pre-checked before
assignment. This statement is true for both go and C# implementations.
However, C# code has duplicate check located inside the
InstructionPointer setter for all instructions except the
exception-related ones. Neo-go code doesn't perform this duplicate check.
Thus, C# VM FAULTs execution in case of invalid TRY/FINALLY offsets, and
neo-go VM does not.

This commit reverts a part of
https://github.com/nspcc-dev/neo-go/pull/2396. This bug is discovered
thanks to test added in https://github.com/neo-project/neo-vm/pull/453.
2022-05-11 14:04:02 +03:00
..
cli *: remove io/ioutil uses 2022-03-17 19:39:18 +03:00
emit [#2442] English Check 2022-05-04 19:48:27 +03:00
opcode [#2442] English Check 2022-05-04 19:48:27 +03:00
stackitem vm: adjust MaxByteArrayComparableSize value 2022-05-07 12:56:09 +03:00
testdata vm: add PACKMAP/PACKSTRUCT, extend UNPACK 2021-11-12 17:19:59 +03:00
bench_test.go vm: rework stack as a simple slice 2021-08-24 15:28:14 +03:00
context.go vm: check instruction offset is valid before subsequent IP move 2022-05-11 14:04:02 +03:00
contract_checks.go [#2442] English Check 2022-05-04 19:48:27 +03:00
contract_checks_test.go vm: avoid panic in IsScriptCorrect 2022-03-17 20:12:50 +03:00
debug_test.go vm: rework stack as a simple slice 2021-08-24 15:28:14 +03:00
exception.go [#2442] English Check 2022-05-04 19:48:27 +03:00
fuzz_test.go vm: add some Fuzz tests 2022-03-18 16:13:39 +03:00
interop.go interop: remove System.Iterator.Create, fix #1935 2021-05-11 12:13:30 +03:00
invocation_tree.go [#2442] English Check 2022-05-04 19:48:27 +03:00
invocation_tree_test.go vm: add invocation tree tracing 2021-11-20 21:57:41 +03:00
json_test.go *: remove io/ioutil uses 2022-03-17 19:39:18 +03:00
opcodebench_test.go vm: simplify slot and make it private 2021-12-01 21:36:25 +03:00
ref_counter.go [#2442] English Check 2022-05-04 19:48:27 +03:00
ref_counter_test.go vm: embed reference counter in compound items 2021-08-13 14:41:26 +03:00
slot.go [#2442] English Check 2022-05-04 19:48:27 +03:00
slot_test.go vm: simplify slot and make it private 2021-12-01 21:36:25 +03:00
stack.go [#2442] English Check 2022-05-04 19:48:27 +03:00
stack_test.go vm: rework stack as a simple slice 2021-08-24 15:28:14 +03:00
state.go [#2442] English Check 2022-05-04 19:48:27 +03:00
state_test.go vm: make byte representation of VMState compatible with C# 2022-04-04 13:52:29 +03:00
vm.go [#2442] English Check 2022-05-04 19:48:27 +03:00
vm_test.go vm: adjust MaxByteArrayComparableSize value 2022-05-07 12:56:09 +03:00