Closed basavesh closed 1 year ago
The same bug exists for IMUL
and I believe it will be there in IMULri
too as they are all variants of x86 imul
instruction.
Please be concise and to the point. There is way too much irrelevant data in this report.
Sorry but I don't understand this bug report. What is the meaning of Before and After ? what is the problem with flag ? If the problem is that some flag are undef, this is not a bug.
Tentative fix in #528.
sorry for the confusion. Before is asm state before executing the instruction and after is the result after executing that instruction.
The bug here is, for that input CF and OF should true. However Jasmin has set it to false.
My dumb fuzzer is happy with the fix. Usually it triggers the bug within couple of seconds and I don't see crashes anymore after the fix.
This bug is found due to fuzz-test. (the bug is present in all IMULr variants, though it is easily reproducible for size 16) In some cases, the flags CF and OF are not set properly.
I think the Jasmin semantic is wrong as it looks for overflow (I might be wrong)
Executing Instruction
IMULr_16_R12_RSI
->imulw %si, %r12w
Before:
After:
However, in the above case, Hardware sets the
CF
andOF
flags.These crashes are easily reproducible. Edit: removed irrelevant data CC: @vbgl @bgregoir @cryptojedi @gbarthe