Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linux v6 compatibility issues #25

Closed
neelkrish opened this issue Nov 19, 2022 · 14 comments
Closed

Linux v6 compatibility issues #25

neelkrish opened this issue Nov 19, 2022 · 14 comments

Comments

@neelkrish
Copy link

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.

@aidan5806
Copy link
Collaborator

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.

@neelkrish
Copy link
Author

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)
| ^~~~~~

@OleksiiOleksenko OleksiiOleksenko changed the title cpuid.h not found Linux v6 compatibility issues Nov 25, 2022
@OleksiiOleksenko
Copy link
Contributor

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?

@neelkrish
Copy link
Author

gcc -11.3.0

@OleksiiOleksenko
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

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

@OleksiiOleksenko
Copy link
Contributor

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

OleksiiOleksenko added a commit that referenced this issue Jan 4, 2023
@OleksiiOleksenko
Copy link
Contributor

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

@neelkrish
Copy link
Author

We can close! Thank you!

@neelkrish
Copy link
Author

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

@OleksiiOleksenko
Copy link
Contributor

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

@neelkrish
Copy link
Author

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?

@OleksiiOleksenko
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants