GNS3/dynamips

ilt_create needs additional checks

Closed this issue · 0 comments

When ilt_create loads data from cache it assumes that the data is valid.

For mips64 the stable and unstable versions support a different number of instructions, so they produce different results.
Since the filename is the same, what stable generates is wrong for unstable and vice versa.
At minimum, ilt_create needs to validate that the number of instructions loaded from the cache matches what is requested.

A more general approach is to compute a hash over the instructions (mask+value) and either use it in the filename, or store it inside the file to compare after load, or both.
The hash should produce different results when an instruction is reordered, added, removed, or modified (mask+value).

Bug was found while trying to test and debug x86 jit code being converted to rust.