8821au-20210708
8821au-20210708 copied to clipboard
Kernel panics if CONFIG_CFI_CLANG is enabled
CFI stands for "Control flow integrity". Here is the prompt for this kernel config option:
`This option enables Clangâs forward-edge Control Flow Integrity (CFI) checking, where the compiler injects a runtime check to each indirect function call to ensure the target is a valid function with the correct static type. This restricts possible call targets and makes it more difficult for an attacker to exploit bugs that allow the modification of stored function pointers. More information can be found from Clang's documentation:
https://clang.llvm.org/docs/ControlFlowIntegrity.html`
More info: https://www.kernelconfig.io/config_cfi_clang
Steps to reproduce:
- Compile your own kernel, enabling the CONFIG_CC_IS_CLANG and CONFIG_CFI_CLANG.
- Compile and install 8821au module
- Load the module
This instantly causes a kernel panic, immediately crashing the Linux system. The corresponding kernel panic message is displayed if you load the module within the console or during boot.
CFI is not specific to Clang/LLVM. I believe this might also affect GGC builds with analogous options enabled. This link might have useful info on that regard: https://patrickfunke.de/control-flow-integrity-cfi-for-gcc-llvm/