sca-fuzzer icon indicating copy to clipboard operation
sca-fuzzer copied to clipboard

Linux v6 compatibility issues

Open neelkrish opened this issue 2 years ago • 7 comments

When I try to install executor kernel module, inpite of installing cpuid, I keep running into sca-fuzzer/src/x86/executor/main.c:15:10: fatal error: cpuid.h: No such file or directory 15 | #include <cpuid.h> | ^~~~~~~~~

kernel and headers version: 6.0.9; ubuntu 22.04. Incase its pertinent- I am using 3.10 version of python.

neelkrish avatar Nov 19 '22 02:11 neelkrish

I have seen this issue a few times before, it seems that cpuid.h was deprecated in newer versions of the Linux kernel. You can likely work around this by commenting out lines 15 and 30-48 of x86/executor/main.c. cpuid.h is only used to authenticate the processor you’re running on, and does not provide any core functionality to the fuzzer.

aidan5806 avatar Nov 19 '22 02:11 aidan5806

commenting off the #include<cpuid.h> {line15} and others is giving me In file included from sca-fuzzer/src/x86/executor/main.c:17: sca-fuzzer/src/x86/executor/main.h:27:25: error: operator '!=' has no left operand 27 | #elif L1D_ASSOCIATIVITY != 12 && L1D_ASSOCIATIVITY != 8 | ^~ sca-fuzzer/src/x86/executor/main.h:50:46: error: invalid type argument of unary ‘*’ (have ‘int’) 50 | #define EVICT_REGION_SIZE (L1D_ASSOCIATIVITY * 4096) | ^~~~~~

neelkrish avatar Nov 19 '22 06:11 neelkrish

It looks like there has been several changes in Linux v6 that are incompatible with the current implementation. Thanks for bringing this up!

Re/ cpuid: It looks like the header moved to a different place. Could you try replacing #include <cpuid.h> with #include <<../arch/x86/include/asm/processor.h>?

Re/ the other error messages: They look very weird. Which compiler are you using?

OleksiiOleksenko avatar Nov 25 '22 15:11 OleksiiOleksenko

gcc -11.3.0

neelkrish avatar Nov 28 '22 21:11 neelkrish

I cannot reproduce the issue on my setup. Let me try to install ubuntu 22 on my test machine, and I'll get back to you

OleksiiOleksenko avatar Nov 29 '22 09:11 OleksiiOleksenko

I tried a fresh install of ubuntu 22.04 with the default kernel (5.15), and everything works fine so far. I'll now try to upgrade the kernel, but for the time being, you could try to boot with a v5 kernel, it should fix your issue.

Also, just to check, are you by chance using a VM?

OleksiiOleksenko avatar Dec 05 '22 14:12 OleksiiOleksenko

How did you install the kernel? Did you use this build https://kernel.ubuntu.com/~kernel-ppa/mainline/v6.0.9/ ?

OleksiiOleksenko avatar Dec 05 '22 16:12 OleksiiOleksenko

Fixed the issue with cpuid.h. Could you try the updated version?

OleksiiOleksenko avatar Dec 14 '22 16:12 OleksiiOleksenko

@neelkrish Is the issue still there? Or should I close it?

OleksiiOleksenko avatar Jan 06 '23 13:01 OleksiiOleksenko

We can close! Thank you!

neelkrish avatar Jan 09 '23 16:01 neelkrish

Pulled the latest changes and I am closing this issue, as I am able to run the fuzzer without any blocks.

neelkrish avatar Jan 09 '23 16:01 neelkrish

Thanks! Let us know if you have any further issues, or even if something is unclear about the process of using the fuzzer.

OleksiiOleksenko avatar Jan 10 '23 10:01 OleksiiOleksenko

Oleksii, I did have one question- in the older version of this project (https://github.com/hw-sw-contracts/revizor/) we had the ability to look for lvi and mds. I dont see that in the sca-fuzzer tests. How would i go about looking for signatures for mds variants and lvi or something newer?

neelkrish avatar Jan 10 '23 19:01 neelkrish

If you don't mind, I'm moving this discussion here, as it is separate from the original issue

OleksiiOleksenko avatar Jan 11 '23 11:01 OleksiiOleksenko