Skip to contentSkip to conversation

fuzz/x86emul: remove bogus check against fuzzer msr index

PATCH In review Wei Liu 2 participants 3 messages Feb 7, 2017 – Feb 8, 2017

lore
Share & tools
lore

Wei Liu

author
#0 lore raw

PATCH 1/1 fuzz/x86emul: remove bogus check against fuzzer msr index

The "reg" variable in fuzz_read_msr stores the real MSR index, not an index within the fuzzer.

The rest of that function already handles things correctly. We just need to remove the bogus check.

---
 tools/fuzz/x86_instruction_emulator/x86-insn-emulator-fuzzer.c | 3 ---
 1 file changed, 3 deletions(-)
tools/fuzz/x86_instruction_emulator/x86-insn-emulator-fuzzer.c +0 -3
index 3b6d33aa25..4a2bdbe392 100644
@@ -347,9 +347,6 @@ static int fuzz_read_msr(
 {
     unsigned int idx;
 
-    if ( reg >= MSR_INDEX_MAX )
-        return X86EMUL_UNHANDLEABLE;
-
     switch ( reg )
     {
     case MSR_TSC_AUX:
Signature · 7 lines
2.11.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Wei Liu

The "reg" variable in fuzz_read_msr stores the real MSR index, not an index within the fuzzer.

The rest of that function already handles things correctly. We just need to remove the bogus check.

"Spotted by Coverity."

Quoted 1 line
Quoted 9 lines
---
 tools/fuzz/x86_instruction_emulator/x86-insn-emulator-fuzzer.c | 3 ---
 1 file changed, 3 deletions(-)
tools/fuzz/x86_instruction_emulator/x86-insn-emulator-fuzzer.c +0 -0
index 3b6d33aa25..4a2bdbe392 100644

tools/fuzz/x86_instruction_emulator/x86-insn-emulator-fuzzer.c static int fuzz_read_msr( · line 352

Quoted 9 lines
tools/fuzz/x86_instruction_emulator/x86-insn-emulator-fuzzer.c +0 -3
@@ -347,9 +347,6 @@ static int fuzz_read_msr(
 {
     unsigned int idx;
 
-    if ( reg >= MSR_INDEX_MAX )
-        return X86EMUL_UNHANDLEABLE;
-
     switch ( reg )
     {
     case MSR_TSC_AUX:

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

author Applied
#2 lore raw
Quoted 4 lines · Andrew Cooper
Quoted 3 lines · Wei Liu

The "reg" variable in fuzz_read_msr stores the real MSR index, not an index within the fuzzer.

Quoted 9 lines
Quoted 2 lines

The rest of that function already handles things correctly. We just need to remove the bogus check.

"Spotted by Coverity."

Quoted 1 line

Applied.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel