fix: bad kernel/config var names

This commit is contained in:
Stéphane Lesimple
2026-04-01 19:53:34 +00:00
parent 4718134427
commit 08702b07c9
3 changed files with 8 additions and 8 deletions

View File

@@ -298,16 +298,16 @@ This is where the real detection lives. Check for mitigations at each layer:
``` ```
Guard with `if [ -n "$g_kernel_err" ]; then` first - the kernel image may be unavailable. Guard with `if [ -n "$g_kernel_err" ]; then` first - the kernel image may be unavailable.
- **Kernel config** (`$g_kernel_config`): Look for the `CONFIG_*` option that enables the mitigation. - **Kernel config** (`$opt_config`): Look for the `CONFIG_*` option that enables the mitigation.
```sh ```sh
if [ -n "$g_kernel_config" ] && grep -q '^CONFIG_MITIGATION_NAME=y' "$g_kernel_config"; then if [ -n "$opt_config" ] && grep -q '^CONFIG_MITIGATION_NAME=y' "$opt_config"; then
kernel_mitigated="found mitigation config option enabled" kernel_mitigated="found mitigation config option enabled"
fi fi
``` ```
- **System.map** (`$g_kernel_map`): Look for function names directly linked to the mitigation. - **System.map** (`$opt_map`): Look for function names directly linked to the mitigation.
```sh ```sh
if [ -n "$g_kernel_map" ] && grep -q 'mitigation_function_name' "$g_kernel_map"; then if [ -n "$opt_map" ] && grep -q 'mitigation_function_name' "$opt_map"; then
kernel_mitigated="found mitigation function in System.map" kernel_mitigated="found mitigation function in System.map"
fi fi
``` ```

View File

@@ -82,8 +82,8 @@ check_CVE_2024_36350_linux() {
kernel_tsa="CONFIG_MITIGATION_TSA=y found in kernel config" kernel_tsa="CONFIG_MITIGATION_TSA=y found in kernel config"
fi fi
fi fi
if [ -z "$kernel_tsa" ] && [ -n "$g_kernel_map" ]; then if [ -z "$kernel_tsa" ] && [ -n "$opt_map" ]; then
if grep -q 'tsa_select_mitigation' "$g_kernel_map"; then if grep -q 'tsa_select_mitigation' "$opt_map"; then
kernel_tsa="found tsa_select_mitigation in System.map" kernel_tsa="found tsa_select_mitigation in System.map"
fi fi
fi fi

View File

@@ -82,8 +82,8 @@ check_CVE_2024_36357_linux() {
kernel_tsa="CONFIG_MITIGATION_TSA=y found in kernel config" kernel_tsa="CONFIG_MITIGATION_TSA=y found in kernel config"
fi fi
fi fi
if [ -z "$kernel_tsa" ] && [ -n "$g_kernel_map" ]; then if [ -z "$kernel_tsa" ] && [ -n "$opt_map" ]; then
if grep -q 'tsa_select_mitigation' "$g_kernel_map"; then if grep -q 'tsa_select_mitigation' "$opt_map"; then
kernel_tsa="found tsa_select_mitigation in System.map" kernel_tsa="found tsa_select_mitigation in System.map"
fi fi
fi fi