{"id":13838295,"url":"https://github.com/a13xp0p0v/kernel-hardening-checker","last_synced_at":"2026-03-07T23:31:54.453Z","repository":{"id":39375756,"uuid":"137949274","full_name":"a13xp0p0v/kernel-hardening-checker","owner":"a13xp0p0v","description":"A tool for checking the security hardening options of the Linux kernel","archived":false,"fork":false,"pushed_at":"2026-02-28T20:34:36.000Z","size":4412,"stargazers_count":2039,"open_issues_count":11,"forks_count":181,"subscribers_count":52,"default_branch":"master","last_synced_at":"2026-02-28T22:28:45.454Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/a13xp0p0v.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2018-06-19T21:50:16.000Z","updated_at":"2026-02-28T20:34:39.000Z","dependencies_parsed_at":"2023-10-16T16:47:50.899Z","dependency_job_id":"dd1a1a49-a47f-4102-b10c-89e653816d9b","html_url":"https://github.com/a13xp0p0v/kernel-hardening-checker","commit_stats":null,"previous_names":["a13xp0p0v/kernel-hardening-checker","a13xp0p0v/kconfig-hardened-check"],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/a13xp0p0v/kernel-hardening-checker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a13xp0p0v%2Fkernel-hardening-checker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a13xp0p0v%2Fkernel-hardening-checker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a13xp0p0v%2Fkernel-hardening-checker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a13xp0p0v%2Fkernel-hardening-checker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/a13xp0p0v","download_url":"https://codeload.github.com/a13xp0p0v/kernel-hardening-checker/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a13xp0p0v%2Fkernel-hardening-checker/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30237329,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-07T23:24:20.706Z","status":"ssl_error","status_checked_at":"2026-03-07T23:21:10.486Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-04T15:01:48.942Z","updated_at":"2026-03-07T23:31:54.412Z","avatar_url":"https://github.com/a13xp0p0v.png","language":"Python","funding_links":[],"categories":["Python","Software Tools"],"sub_categories":["Security Auditing Frameworks"],"readme":"# kernel-hardening-checker\n\n__(formerly kconfig-hardened-check)__\u003cbr /\u003e\u003cbr /\u003e\n[![functional test](https://github.com/a13xp0p0v/kernel-hardening-checker/workflows/functional%20test/badge.svg)](https://github.com/a13xp0p0v/kernel-hardening-checker/actions/workflows/functional_test.yml)\n[![functional test coverage](https://codecov.io/gh/a13xp0p0v/kernel-hardening-checker/graph/badge.svg?flag=functional_test)](https://app.codecov.io/gh/a13xp0p0v/kernel-hardening-checker?flags%5B0%5D=functional_test)\u003cbr /\u003e\n[![engine unit-test](https://github.com/a13xp0p0v/kernel-hardening-checker/workflows/engine%20unit-test/badge.svg)](https://github.com/a13xp0p0v/kernel-hardening-checker/actions/workflows/engine_unit-test.yml)\n[![unit-test coverage](https://codecov.io/gh/a13xp0p0v/kernel-hardening-checker/graph/badge.svg?flag=engine_unit-test)](https://app.codecov.io/gh/a13xp0p0v/kernel-hardening-checker?flags%5B0%5D=engine_unit-test)\u003cbr /\u003e\n[![GitHub tag (latest by date)](https://img.shields.io/github/v/tag/a13xp0p0v/kernel-hardening-checker?label=release)](https://github.com/a13xp0p0v/kernel-hardening-checker/tags)\n[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)\n\n## Motivation\n\nThere are plenty of security hardening options for the Linux kernel. A lot of them are\nnot enabled by the major distros. We have to enable these options ourselves to\nmake our systems more secure.\n\nBut nobody likes checking configs manually. So let the computers do their job!\n\n__kernel-hardening-checker__ (formerly __kconfig-hardened-check__) is a tool for checking the security hardening options of the Linux kernel.\n\nLicense: GPL-3.0.\n\n## Repositories\n\n - At GitHub \u003chttps://github.com/a13xp0p0v/kernel-hardening-checker\u003e\n - At Codeberg: \u003chttps://codeberg.org/a13xp0p0v/kernel-hardening-checker\u003e (go there if something goes wrong with GitHub)\n - At GitFlic: \u003chttps://gitflic.ru/project/a13xp0p0v/kernel-hardening-checker\u003e\n\n## Features\n\n`kernel-hardening-checker` supports checking:\n\n  - Kconfig options (compile-time)\n  - Kernel cmdline arguments (boot-time)\n  - Sysctl parameters (runtime)\n\nSupported architectures:\n\n  - X86_64\n  - X86_32\n  - ARM64\n  - ARM\n  - RISC-V\n\nThe security hardening recommendations are based on:\n\n  - [KSPP recommended settings][1]\n  - [Direct feedback from the Linux kernel maintainers][23]\n  - Kernel options disabled by [grsecurity][3] to cut attack surface\n  - [CLIP OS kernel configuration][2]\n  - [GrapheneOS][25] recommendations\n  - [SECURITY_LOCKDOWN_LSM][5] patchset\n\nI also created the [__Linux Kernel Defence Map__][4], which is a graphical representation of the\nrelationships between security hardening features and the corresponding vulnerability classes\nor exploitation techniques.\n\n## Attention!\n\nChanging Linux kernel security parameters may also affect system performance\nand functionality of userspace software. So for choosing these parameters, consider\nthe threat model of your Linux-based information system and perform thorough testing\nof its typical workload.\n\n## Installation\n\nYou can install the package:\n\n```\npip install git+https://github.com/a13xp0p0v/kernel-hardening-checker\n```\n\nor simply run `./bin/kernel-hardening-checker` from the cloned repository.\n\nSome Linux distributions also provide `kernel-hardening-checker` as a package.\n\n## Usage\n```\n$ ./bin/kernel-hardening-checker -h\nusage: kernel-hardening-checker [-h] [--version] [-m {verbose,json,show_ok,show_fail}]\n                                [-a] [-c CONFIG] [-v KERNEL_VERSION] [-l CMDLINE]\n                                [-s SYSCTL] [-p {X86_64,X86_32,ARM64,ARM,RISCV}]\n                                [-g {X86_64,X86_32,ARM64,ARM,RISCV}]\n\nA tool for checking the security hardening options of the Linux kernel\n\noptions:\n  -h, --help            show this help message and exit\n  --version             show program's version number and exit\n  -m, --mode {verbose,json,show_ok,show_fail}\n                        choose the report mode\n  -a, --autodetect      autodetect and check the security hardening options of the\n                        running kernel\n  -c, --config CONFIG   check the security hardening options in the Kconfig file (also\n                        supports *.gz files)\n  -v, --kernel-version KERNEL_VERSION\n                        extract version from the kernel version file (contents of\n                        /proc/version) instead of Kconfig file\n  -l, --cmdline CMDLINE\n                        check the security hardening options in the kernel cmdline file\n                        (contents of /proc/cmdline)\n  -s, --sysctl SYSCTL   check the security hardening options in the sysctl output file\n                        (`sudo sysctl -a \u003e file`)\n  -p, --print {X86_64,X86_32,ARM64,ARM,RISCV}\n                        print the security hardening recommendations for the selected\n                        architecture\n  -g, --generate {X86_64,X86_32,ARM64,ARM,RISCV}\n                        generate a Kconfig fragment with the security hardening options\n                        for the selected architecture\n```\n\n## Output modes\n\n  -  no `-m` argument for the default output mode (see the example below)\n  - `-m verbose` for printing additional info:\n    - config options without a corresponding check\n    - internals of complex checks with AND/OR, like this:\n```\n-------------------------------------------------------------------------------------------\n    \u003c\u003c\u003c OR \u003e\u003e\u003e                                                                             \nCONFIG_STRICT_DEVMEM                  |kconfig|cut_attack_surface|defconfig |     y      \nCONFIG_DEVMEM                         |kconfig|cut_attack_surface|   kspp   | is not set \n-------------------------------------------------------------------------------------------\n```\n  - `-m show_fail` for showing only the failed checks\n  - `-m show_ok` for showing only the successful checks\n  - `-m json` for printing the results in JSON format (for combining `kernel-hardening-checker` with other tools)\n\n## Example output\n```\n$ ./bin/kernel-hardening-checker -a\n[+] Going to autodetect and check the security hardening options of the running kernel\n[+] Detected version of the running kernel: (6, 11, 0)\n[+] Detected kconfig file of the running kernel: /boot/config-6.11.0-1012-azure\n[+] Detected cmdline parameters of the running kernel: /proc/cmdline\n[+] Saved sysctls to a temporary file /tmp/sysctl-bticbl3p\n[+] Detected architecture: X86_64\n[+] Detected compiler: GCC 130300\n[!] WARNING: cmdline option \"console\" is found multiple times\n[!] WARNING: sysctl options available for root are not found in /tmp/sysctl-bticbl3p, try checking the output of `sudo sysctl -a`\n=========================================================================================================================\n             option_name              | type  |      reason      | decision |desired_val | check_result\n=========================================================================================================================\nCONFIG_BUG                            |kconfig| self_protection  |defconfig |     y      | OK\nCONFIG_SLUB_DEBUG                     |kconfig| self_protection  |defconfig |     y      | OK\nCONFIG_THREAD_INFO_IN_TASK            |kconfig| self_protection  |defconfig |     y      | OK\nCONFIG_IOMMU_DEFAULT_PASSTHROUGH      |kconfig| self_protection  |defconfig | is not set | OK\nCONFIG_IOMMU_SUPPORT                  |kconfig| self_protection  |defconfig |     y      | OK\nCONFIG_STACKPROTECTOR                 |kconfig| self_protection  |defconfig |     y      | OK\nCONFIG_STACKPROTECTOR_STRONG          |kconfig| self_protection  |defconfig |     y      | OK\nCONFIG_STRICT_KERNEL_RWX              |kconfig| self_protection  |defconfig |     y      | OK\nCONFIG_STRICT_MODULE_RWX              |kconfig| self_protection  |defconfig |     y      | OK\nCONFIG_REFCOUNT_FULL                  |kconfig| self_protection  |defconfig |     y      | OK: version \u003e= (5, 4, 208)\nCONFIG_INIT_STACK_ALL_ZERO            |kconfig| self_protection  |defconfig |     y      | OK\nCONFIG_CPU_MITIGATIONS                |kconfig| self_protection  |defconfig |     y      | OK\nCONFIG_RANDOMIZE_BASE                 |kconfig| self_protection  |defconfig |     y      | OK\nCONFIG_VMAP_STACK                     |kconfig| self_protection  |defconfig |     y      | OK\nCONFIG_DEBUG_WX                       |kconfig| self_protection  |defconfig |     y      | OK\nCONFIG_WERROR                         |kconfig| self_protection  |defconfig |     y      | FAIL: \"is not set\"\nCONFIG_X86_MCE                        |kconfig| self_protection  |defconfig |     y      | OK\nCONFIG_SYN_COOKIES                    |kconfig| self_protection  |defconfig |     y      | OK\nCONFIG_MICROCODE                      |kconfig| self_protection  |defconfig |     y      | OK\nCONFIG_MICROCODE_INTEL                |kconfig| self_protection  |defconfig |     y      | OK: CONFIG_MICROCODE is \"y\"\nCONFIG_MICROCODE_AMD                  |kconfig| self_protection  |defconfig |     y      | OK: CONFIG_MICROCODE is \"y\"\nCONFIG_X86_SMAP                       |kconfig| self_protection  |defconfig |     y      | OK: version \u003e= (5, 19, 0)\nCONFIG_X86_UMIP                       |kconfig| self_protection  |defconfig |     y      | OK\nCONFIG_X86_MCE_INTEL                  |kconfig| self_protection  |defconfig |     y      | OK\nCONFIG_X86_MCE_AMD                    |kconfig| self_protection  |defconfig |     y      | OK\nCONFIG_MITIGATION_RETPOLINE           |kconfig| self_protection  |defconfig |     y      | OK\nCONFIG_MITIGATION_RFDS                |kconfig| self_protection  |defconfig |     y      | OK\nCONFIG_MITIGATION_SPECTRE_BHI         |kconfig| self_protection  |defconfig |     y      | OK\nCONFIG_RANDOMIZE_MEMORY               |kconfig| self_protection  |defconfig |     y      | OK\nCONFIG_X86_KERNEL_IBT                 |kconfig| self_protection  |defconfig |     y      | FAIL: \"is not set\"\nCONFIG_MITIGATION_PAGE_TABLE_ISOLATION|kconfig| self_protection  |defconfig |     y      | OK\nCONFIG_MITIGATION_SRSO                |kconfig| self_protection  |defconfig |     y      | OK\nCONFIG_INTEL_IOMMU                    |kconfig| self_protection  |defconfig |     y      | OK\nCONFIG_AMD_IOMMU                      |kconfig| self_protection  |defconfig |     y      | OK\nCONFIG_RANDOM_KMALLOC_CACHES          |kconfig| self_protection  |   kspp   |     y      | OK\nCONFIG_SLAB_MERGE_DEFAULT             |kconfig| self_protection  |   kspp   | is not set | FAIL: \"y\"\nCONFIG_BUG_ON_DATA_CORRUPTION         |kconfig| self_protection  |   kspp   |     y      | FAIL: \"is not set\"\nCONFIG_SLAB_FREELIST_HARDENED         |kconfig| self_protection  |   kspp   |     y      | OK\nCONFIG_SLAB_FREELIST_RANDOM           |kconfig| self_protection  |   kspp   |     y      | OK\nCONFIG_SHUFFLE_PAGE_ALLOCATOR         |kconfig| self_protection  |   kspp   |     y      | OK\nCONFIG_FORTIFY_SOURCE                 |kconfig| self_protection  |   kspp   |     y      | OK\nCONFIG_DEBUG_VIRTUAL                  |kconfig| self_protection  |   kspp   |     y      | FAIL: \"is not set\"\nCONFIG_INIT_ON_ALLOC_DEFAULT_ON       |kconfig| self_protection  |   kspp   |     y      | OK\nCONFIG_STATIC_USERMODEHELPER          |kconfig| self_protection  |   kspp   |     y      | FAIL: \"is not set\"\nCONFIG_SECURITY_LOCKDOWN_LSM          |kconfig| self_protection  |   kspp   |     y      | OK\nCONFIG_LSM                            |kconfig| self_protection  |   kspp   | *lockdown* | OK: in \"landlock,lockdown,yama,integrity,apparmor\"\nCONFIG_SECURITY_LOCKDOWN_LSM_EARLY    |kconfig| self_protection  |   kspp   |     y      | OK\nCONFIG_LOCK_DOWN_KERNEL_FORCE_CONFIDENTIALITY|kconfig| self_protection  |   kspp   |     y      | FAIL: \"is not set\"\nCONFIG_DEBUG_CREDENTIALS              |kconfig| self_protection  |   kspp   |     y      | OK: version \u003e= (6, 6, 8)\nCONFIG_DEBUG_NOTIFIERS                |kconfig| self_protection  |   kspp   |     y      | FAIL: \"is not set\"\nCONFIG_KFENCE                         |kconfig| self_protection  |   kspp   |     y      | OK\nCONFIG_KFENCE_SAMPLE_INTERVAL         |kconfig| self_protection  |   kspp   |    100     | FAIL: \"0\"\nCONFIG_RANDSTRUCT_FULL                |kconfig| self_protection  |   kspp   |     y      | FAIL: is not found\nCONFIG_HARDENED_USERCOPY              |kconfig| self_protection  |   kspp   |     y      | OK\nCONFIG_HARDENED_USERCOPY_FALLBACK     |kconfig| self_protection  |   kspp   | is not set | OK: is not found\nCONFIG_HARDENED_USERCOPY_PAGESPAN     |kconfig| self_protection  |   kspp   | is not set | OK: is not found\nCONFIG_GCC_PLUGIN_LATENT_ENTROPY      |kconfig| self_protection  |   kspp   |     y      | FAIL: is not found\nCONFIG_MODULE_SIG                     |kconfig| self_protection  |   kspp   |     y      | OK\nCONFIG_MODULE_SIG_ALL                 |kconfig| self_protection  |   kspp   |     y      | OK\nCONFIG_MODULE_SIG_SHA512              |kconfig| self_protection  |   kspp   |     y      | OK\nCONFIG_MODULE_SIG_FORCE               |kconfig| self_protection  |   kspp   |     y      | FAIL: \"is not set\"\nCONFIG_INIT_ON_FREE_DEFAULT_ON        |kconfig| self_protection  |   kspp   |     y      | FAIL: \"is not set\"\nCONFIG_EFI_DISABLE_PCI_DMA            |kconfig| self_protection  |   kspp   |     y      | FAIL: \"is not set\"\nCONFIG_RESET_ATTACK_MITIGATION        |kconfig| self_protection  |   kspp   |     y      | OK\nCONFIG_UBSAN_BOUNDS                   |kconfig| self_protection  |   kspp   |     y      | OK\nCONFIG_UBSAN_LOCAL_BOUNDS             |kconfig| self_protection  |   kspp   |     y      | OK: CONFIG_UBSAN_BOUNDS is \"y\"\nCONFIG_UBSAN_TRAP                     |kconfig| self_protection  |   kspp   |     y      | FAIL: CONFIG_UBSAN_ENUM is not \"is not set\"\nCONFIG_UBSAN_SANITIZE_ALL             |kconfig| self_protection  |   kspp   |     y      | OK: CONFIG_UBSAN_BOUNDS is \"y\"\nCONFIG_SCHED_CORE                     |kconfig| self_protection  |   kspp   |     y      | OK\nCONFIG_DEBUG_SG                       |kconfig| self_protection  |   kspp   |     y      | FAIL: \"is not set\"\nCONFIG_LIST_HARDENED                  |kconfig| self_protection  |   kspp   |     y      | FAIL: \"is not set\"\nCONFIG_SCHED_STACK_END_CHECK          |kconfig| self_protection  |   kspp   |     y      | OK\nCONFIG_RANDOMIZE_KSTACK_OFFSET_DEFAULT|kconfig| self_protection  |   kspp   |     y      | OK\nCONFIG_DEFAULT_MMAP_MIN_ADDR          |kconfig| self_protection  |   kspp   |   65536    | OK\nCONFIG_GCC_PLUGIN_STACKLEAK           |kconfig| self_protection  |   kspp   |     y      | FAIL: is not found\nCONFIG_STACKLEAK_METRICS              |kconfig| self_protection  |   kspp   | is not set | FAIL: CONFIG_GCC_PLUGIN_STACKLEAK is not \"y\"\nCONFIG_STACKLEAK_RUNTIME_DISABLE      |kconfig| self_protection  |   kspp   | is not set | FAIL: CONFIG_GCC_PLUGIN_STACKLEAK is not \"y\"\nCONFIG_PAGE_TABLE_CHECK               |kconfig| self_protection  |   kspp   |     y      | FAIL: \"is not set\"\nCONFIG_PAGE_TABLE_CHECK_ENFORCED      |kconfig| self_protection  |   kspp   |     y      | FAIL: is not found\nCONFIG_HW_RANDOM_TPM                  |kconfig| self_protection  |   kspp   |     y      | OK\nCONFIG_CFI_CLANG                      |kconfig| self_protection  |   kspp   |     y      | FAIL: CONFIG_CC_IS_CLANG is not \"y\"\nCONFIG_CFI_PERMISSIVE                 |kconfig| self_protection  |   kspp   | is not set | FAIL: CONFIG_CC_IS_CLANG is not \"y\"\nCONFIG_IOMMU_DEFAULT_DMA_STRICT       |kconfig| self_protection  |   kspp   |     y      | FAIL: \"is not set\"\nCONFIG_INTEL_IOMMU_DEFAULT_ON         |kconfig| self_protection  |   kspp   |     y      | OK\nCONFIG_MITIGATION_SLS                 |kconfig| self_protection  |   kspp   |     y      | OK\nCONFIG_INTEL_IOMMU_SVM                |kconfig| self_protection  |   kspp   |     y      | OK\nCONFIG_AMD_IOMMU_V2                   |kconfig| self_protection  |   kspp   |     y      | OK: version \u003e= (6, 7, 0)\nCONFIG_CFI_AUTO_DEFAULT               |kconfig| self_protection  |a13xp0p0v | is not set | FAIL: CONFIG_CFI_AUTO_DEFAULT is not present\nCONFIG_SECURITY                       |kconfig| security_policy  |defconfig |     y      | OK\nCONFIG_SECURITY_YAMA                  |kconfig| security_policy  |   kspp   |     y      | OK\nCONFIG_LSM                            |kconfig| security_policy  |   kspp   |   *yama*   | OK: in \"landlock,lockdown,yama,integrity,apparmor\"\nCONFIG_SECURITY_LANDLOCK              |kconfig| security_policy  |   kspp   |     y      | OK\nCONFIG_LSM                            |kconfig| security_policy  |   kspp   | *landlock* | OK: in \"landlock,lockdown,yama,integrity,apparmor\"\nCONFIG_SECURITY_SELINUX_DISABLE       |kconfig| security_policy  |   kspp   | is not set | OK: is not found\nCONFIG_SECURITY_SELINUX_BOOTPARAM     |kconfig| security_policy  |   kspp   | is not set | FAIL: \"y\"\nCONFIG_SECURITY_SELINUX_DEVELOP       |kconfig| security_policy  |   kspp   | is not set | FAIL: \"y\"\nCONFIG_SECURITY_WRITABLE_HOOKS        |kconfig| security_policy  |   kspp   | is not set | OK: is not found\nCONFIG_SECURITY_SELINUX_DEBUG         |kconfig| security_policy  |   kspp   | is not set | OK\nCONFIG_SECURITY_SELINUX               |kconfig| security_policy  |a13xp0p0v |     y      | OK\nCONFIG_LSM                            |kconfig| security_policy  |a13xp0p0v | *selinux*  | OK: \"apparmor\" is in CONFIG_LSM\nCONFIG_SECCOMP                        |kconfig|cut_attack_surface|defconfig |     y      | OK\nCONFIG_SECCOMP_FILTER                 |kconfig|cut_attack_surface|defconfig |     y      | OK\nCONFIG_BPF_UNPRIV_DEFAULT_OFF         |kconfig|cut_attack_surface|defconfig |     y      | OK\nCONFIG_STRICT_DEVMEM                  |kconfig|cut_attack_surface|defconfig |     y      | OK\nCONFIG_X86_INTEL_TSX_MODE_OFF         |kconfig|cut_attack_surface|defconfig |     y      | OK\nCONFIG_SECURITY_DMESG_RESTRICT        |kconfig|cut_attack_surface|   kspp   |     y      | OK\nCONFIG_ACPI_CUSTOM_METHOD             |kconfig|cut_attack_surface|   kspp   | is not set | OK: is not found\nCONFIG_COMPAT_BRK                     |kconfig|cut_attack_surface|   kspp   | is not set | OK\nCONFIG_DEVKMEM                        |kconfig|cut_attack_surface|   kspp   | is not set | OK: is not found\nCONFIG_BINFMT_MISC                    |kconfig|cut_attack_surface|   kspp   | is not set | FAIL: \"m\"\nCONFIG_INET_DIAG                      |kconfig|cut_attack_surface|   kspp   | is not set | FAIL: \"m\"\nCONFIG_KEXEC                          |kconfig|cut_attack_surface|   kspp   | is not set | FAIL: \"y\"\nCONFIG_PROC_KCORE                     |kconfig|cut_attack_surface|   kspp   | is not set | FAIL: \"y\"\nCONFIG_LEGACY_PTYS                    |kconfig|cut_attack_surface|   kspp   | is not set | FAIL: \"y\"\nCONFIG_HIBERNATION                    |kconfig|cut_attack_surface|   kspp   | is not set | FAIL: \"y\"\nCONFIG_COMPAT                         |kconfig|cut_attack_surface|   kspp   | is not set | FAIL: \"y\"\nCONFIG_IA32_EMULATION                 |kconfig|cut_attack_surface|   kspp   | is not set | FAIL: \"y\"\nCONFIG_X86_X32                        |kconfig|cut_attack_surface|   kspp   | is not set | OK: is not found\nCONFIG_X86_X32_ABI                    |kconfig|cut_attack_surface|   kspp   | is not set | OK\nCONFIG_MODIFY_LDT_SYSCALL             |kconfig|cut_attack_surface|   kspp   | is not set | FAIL: \"y\"\nCONFIG_OABI_COMPAT                    |kconfig|cut_attack_surface|   kspp   | is not set | OK: is not found\nCONFIG_X86_MSR                        |kconfig|cut_attack_surface|   kspp   | is not set | FAIL: \"m\"\nCONFIG_LEGACY_TIOCSTI                 |kconfig|cut_attack_surface|   kspp   | is not set | OK\nCONFIG_MODULE_FORCE_LOAD              |kconfig|cut_attack_surface|   kspp   | is not set | OK\nCONFIG_MODULES                        |kconfig|cut_attack_surface|   kspp   | is not set | FAIL: \"y\"\nCONFIG_DEVMEM                         |kconfig|cut_attack_surface|   kspp   | is not set | FAIL: \"y\"\nCONFIG_IO_STRICT_DEVMEM               |kconfig|cut_attack_surface|   kspp   |     y      | FAIL: \"is not set\"\nCONFIG_LDISC_AUTOLOAD                 |kconfig|cut_attack_surface|   kspp   | is not set | FAIL: \"y\"\nCONFIG_X86_VSYSCALL_EMULATION         |kconfig|cut_attack_surface|   kspp   | is not set | FAIL: \"y\"\nCONFIG_COMPAT_VDSO                    |kconfig|cut_attack_surface|   kspp   | is not set | OK\nCONFIG_DRM_LEGACY                     |kconfig|cut_attack_surface|maintainer| is not set | OK: is not found\nCONFIG_FB                             |kconfig|cut_attack_surface|maintainer| is not set | FAIL: \"y\"\nCONFIG_VT                             |kconfig|cut_attack_surface|maintainer| is not set | FAIL: \"y\"\nCONFIG_BLK_DEV_FD                     |kconfig|cut_attack_surface|maintainer| is not set | OK\nCONFIG_BLK_DEV_FD_RAWCMD              |kconfig|cut_attack_surface|maintainer| is not set | OK: is not found\nCONFIG_NOUVEAU_LEGACY_CTX_SUPPORT     |kconfig|cut_attack_surface|maintainer| is not set | OK: is not found\nCONFIG_N_GSM                          |kconfig|cut_attack_surface|maintainer| is not set | FAIL: \"m\"\nCONFIG_ZSMALLOC_STAT                  |kconfig|cut_attack_surface|  grsec   | is not set | OK\nCONFIG_DEBUG_KMEMLEAK                 |kconfig|cut_attack_surface|  grsec   | is not set | OK\nCONFIG_BINFMT_AOUT                    |kconfig|cut_attack_surface|  grsec   | is not set | OK: is not found\nCONFIG_KPROBE_EVENTS                  |kconfig|cut_attack_surface|  grsec   | is not set | FAIL: \"y\"\nCONFIG_UPROBE_EVENTS                  |kconfig|cut_attack_surface|  grsec   | is not set | FAIL: \"y\"\nCONFIG_GENERIC_TRACER                 |kconfig|cut_attack_surface|  grsec   | is not set | FAIL: \"y\"\nCONFIG_FUNCTION_TRACER                |kconfig|cut_attack_surface|  grsec   | is not set | FAIL: \"y\"\nCONFIG_STACK_TRACER                   |kconfig|cut_attack_surface|  grsec   | is not set | FAIL: \"y\"\nCONFIG_HIST_TRIGGERS                  |kconfig|cut_attack_surface|  grsec   | is not set | FAIL: \"y\"\nCONFIG_BLK_DEV_IO_TRACE               |kconfig|cut_attack_surface|  grsec   | is not set | FAIL: \"y\"\nCONFIG_PROC_VMCORE                    |kconfig|cut_attack_surface|  grsec   | is not set | FAIL: \"y\"\nCONFIG_PROC_PAGE_MONITOR              |kconfig|cut_attack_surface|  grsec   | is not set | FAIL: \"y\"\nCONFIG_USELIB                         |kconfig|cut_attack_surface|  grsec   | is not set | FAIL: \"y\"\nCONFIG_CHECKPOINT_RESTORE             |kconfig|cut_attack_surface|  grsec   | is not set | FAIL: \"y\"\nCONFIG_USERFAULTFD                    |kconfig|cut_attack_surface|  grsec   | is not set | FAIL: \"y\"\nCONFIG_HWPOISON_INJECT                |kconfig|cut_attack_surface|  grsec   | is not set | FAIL: \"m\"\nCONFIG_MEM_SOFT_DIRTY                 |kconfig|cut_attack_surface|  grsec   | is not set | FAIL: \"y\"\nCONFIG_DEVPORT                        |kconfig|cut_attack_surface|  grsec   | is not set | FAIL: \"y\"\nCONFIG_DEBUG_FS                       |kconfig|cut_attack_surface|  grsec   | is not set | FAIL: \"y\"\nCONFIG_NOTIFIER_ERROR_INJECTION       |kconfig|cut_attack_surface|  grsec   | is not set | FAIL: \"m\"\nCONFIG_FAIL_FUTEX                     |kconfig|cut_attack_surface|  grsec   | is not set | OK: is not found\nCONFIG_PUNIT_ATOM_DEBUG               |kconfig|cut_attack_surface|  grsec   | is not set | FAIL: \"m\"\nCONFIG_ACPI_CONFIGFS                  |kconfig|cut_attack_surface|  grsec   | is not set | OK\nCONFIG_EDAC_DEBUG                     |kconfig|cut_attack_surface|  grsec   | is not set | OK\nCONFIG_DRM_I915_DEBUG                 |kconfig|cut_attack_surface|  grsec   | is not set | OK\nCONFIG_DVB_C8SECTPFE                  |kconfig|cut_attack_surface|  grsec   | is not set | OK: is not found\nCONFIG_MTD_SLRAM                      |kconfig|cut_attack_surface|  grsec   | is not set | OK: is not found\nCONFIG_MTD_PHRAM                      |kconfig|cut_attack_surface|  grsec   | is not set | OK: is not found\nCONFIG_IO_URING                       |kconfig|cut_attack_surface|  grsec   | is not set | FAIL: \"y\"\nCONFIG_KCMP                           |kconfig|cut_attack_surface|  grsec   | is not set | FAIL: \"y\"\nCONFIG_RSEQ                           |kconfig|cut_attack_surface|  grsec   | is not set | FAIL: \"y\"\nCONFIG_LATENCYTOP                     |kconfig|cut_attack_surface|  grsec   | is not set | FAIL: \"y\"\nCONFIG_KCOV                           |kconfig|cut_attack_surface|  grsec   | is not set | OK\nCONFIG_PROVIDE_OHCI1394_DMA_INIT      |kconfig|cut_attack_surface|  grsec   | is not set | OK\nCONFIG_SUNRPC_DEBUG                   |kconfig|cut_attack_surface|  grsec   | is not set | FAIL: \"y\"\nCONFIG_X86_16BIT                      |kconfig|cut_attack_surface|  grsec   | is not set | FAIL: \"y\"\nCONFIG_BLK_DEV_UBLK                   |kconfig|cut_attack_surface|  grsec   | is not set | FAIL: \"m\"\nCONFIG_SMB_SERVER                     |kconfig|cut_attack_surface|  grsec   | is not set | FAIL: \"m\"\nCONFIG_XFS_ONLINE_SCRUB_STATS         |kconfig|cut_attack_surface|  grsec   | is not set | OK: is not found\nCONFIG_CACHESTAT_SYSCALL              |kconfig|cut_attack_surface|  grsec   | is not set | FAIL: \"y\"\nCONFIG_PREEMPTIRQ_TRACEPOINTS         |kconfig|cut_attack_surface|  grsec   | is not set | OK: is not found\nCONFIG_ENABLE_DEFAULT_TRACERS         |kconfig|cut_attack_surface|  grsec   | is not set | OK: is not found\nCONFIG_PROVE_LOCKING                  |kconfig|cut_attack_surface|  grsec   | is not set | OK\nCONFIG_TEST_DEBUG_VIRTUAL             |kconfig|cut_attack_surface|  grsec   | is not set | OK: is not found\nCONFIG_MPTCP                          |kconfig|cut_attack_surface|  grsec   | is not set | FAIL: \"y\"\nCONFIG_TLS                            |kconfig|cut_attack_surface|  grsec   | is not set | FAIL: \"m\"\nCONFIG_TIPC                           |kconfig|cut_attack_surface|  grsec   | is not set | FAIL: \"m\"\nCONFIG_IP_SCTP                        |kconfig|cut_attack_surface|  grsec   | is not set | FAIL: \"m\"\nCONFIG_KGDB                           |kconfig|cut_attack_surface|  grsec   | is not set | FAIL: \"y\"\nCONFIG_PTDUMP_DEBUGFS                 |kconfig|cut_attack_surface|  grsec   | is not set | OK\nCONFIG_X86_PTDUMP                     |kconfig|cut_attack_surface|  grsec   | is not set | OK: is not found\nCONFIG_DEBUG_CLOSURES                 |kconfig|cut_attack_surface|  grsec   | is not set | OK\nCONFIG_BCACHE_CLOSURES_DEBUG          |kconfig|cut_attack_surface|  grsec   | is not set | OK: is not found\nCONFIG_STAGING                        |kconfig|cut_attack_surface|  clipos  | is not set | FAIL: \"y\"\nCONFIG_KSM                            |kconfig|cut_attack_surface|  clipos  | is not set | FAIL: \"y\"\nCONFIG_KALLSYMS                       |kconfig|cut_attack_surface|  clipos  | is not set | FAIL: \"y\"\nCONFIG_KEXEC_FILE                     |kconfig|cut_attack_surface|  clipos  | is not set | FAIL: \"y\"\nCONFIG_CRASH_DUMP                     |kconfig|cut_attack_surface|  clipos  | is not set | FAIL: \"y\"\nCONFIG_USER_NS                        |kconfig|cut_attack_surface|  clipos  | is not set | FAIL: \"y\"\nCONFIG_X86_CPUID                      |kconfig|cut_attack_surface|  clipos  | is not set | FAIL: \"m\"\nCONFIG_X86_IOPL_IOPERM                |kconfig|cut_attack_surface|  clipos  | is not set | FAIL: \"y\"\nCONFIG_ACPI_TABLE_UPGRADE             |kconfig|cut_attack_surface|  clipos  | is not set | OK\nCONFIG_EFI_CUSTOM_SSDT_OVERLAYS       |kconfig|cut_attack_surface|  clipos  | is not set | FAIL: \"y\"\nCONFIG_AIO                            |kconfig|cut_attack_surface|  clipos  | is not set | FAIL: \"y\"\nCONFIG_MAGIC_SYSRQ                    |kconfig|cut_attack_surface|  clipos  | is not set | FAIL: \"y\"\nCONFIG_MAGIC_SYSRQ_SERIAL             |kconfig|cut_attack_surface|grapheneos| is not set | FAIL: \"y\"\nCONFIG_EFI_TEST                       |kconfig|cut_attack_surface| lockdown | is not set | FAIL: \"m\"\nCONFIG_MMIOTRACE_TEST                 |kconfig|cut_attack_surface| lockdown | is not set | OK\nCONFIG_KPROBES                        |kconfig|cut_attack_surface| lockdown | is not set | FAIL: \"y\"\nCONFIG_BPF_SYSCALL                    |kconfig|cut_attack_surface| lockdown | is not set | FAIL: \"y\"\nCONFIG_MMIOTRACE                      |kconfig|cut_attack_surface|a13xp0p0v | is not set | FAIL: \"y\"\nCONFIG_LIVEPATCH                      |kconfig|cut_attack_surface|a13xp0p0v | is not set | FAIL: \"y\"\nCONFIG_IP_DCCP                        |kconfig|cut_attack_surface|a13xp0p0v | is not set | FAIL: \"m\"\nCONFIG_FTRACE                         |kconfig|cut_attack_surface|a13xp0p0v | is not set | FAIL: \"y\"\nCONFIG_VIDEO_VIVID                    |kconfig|cut_attack_surface|a13xp0p0v | is not set | FAIL: \"m\"\nCONFIG_INPUT_EVBUG                    |kconfig|cut_attack_surface|a13xp0p0v | is not set | FAIL: \"m\"\nCONFIG_CORESIGHT                      |kconfig|cut_attack_surface|a13xp0p0v | is not set | OK: is not found\nCONFIG_XFS_SUPPORT_V4                 |kconfig|cut_attack_surface|a13xp0p0v | is not set | FAIL: \"y\"\nCONFIG_BLK_DEV_WRITE_MOUNTED          |kconfig|cut_attack_surface|a13xp0p0v | is not set | FAIL: \"y\"\nCONFIG_FAULT_INJECTION                |kconfig|cut_attack_surface|a13xp0p0v | is not set | OK\nCONFIG_ARM_PTDUMP_DEBUGFS             |kconfig|cut_attack_surface|a13xp0p0v | is not set | OK: is not found\nCONFIG_ARM_PTDUMP                     |kconfig|cut_attack_surface|a13xp0p0v | is not set | OK: is not found\nCONFIG_SECCOMP_CACHE_DEBUG            |kconfig|cut_attack_surface|a13xp0p0v | is not set | OK\nCONFIG_LKDTM                          |kconfig|cut_attack_surface|a13xp0p0v | is not set | OK\nCONFIG_TRIM_UNUSED_KSYMS              |kconfig|cut_attack_surface|a13xp0p0v |     y      | FAIL: \"is not set\"\nCONFIG_COREDUMP                       |kconfig| harden_userspace |  clipos  | is not set | FAIL: \"y\"\nCONFIG_ARCH_MMAP_RND_BITS             |kconfig| harden_userspace |a13xp0p0v |     32     | OK\nCONFIG_ARCH_MMAP_RND_COMPAT_BITS      |kconfig| harden_userspace |a13xp0p0v |     16     | OK\nCONFIG_X86_USER_SHADOW_STACK          |kconfig| harden_userspace |   kspp   |     y      | OK\nnosmep                                |cmdline| self_protection  |defconfig | is not set | OK: is not found\nnosmap                                |cmdline| self_protection  |defconfig | is not set | OK: is not found\nnokaslr                               |cmdline| self_protection  |defconfig | is not set | OK: is not found\nnopti                                 |cmdline| self_protection  |defconfig | is not set | OK: is not found\nnospectre_v1                          |cmdline| self_protection  |defconfig | is not set | OK: is not found\nnospectre_v2                          |cmdline| self_protection  |defconfig | is not set | OK: is not found\nnospectre_bhb                         |cmdline| self_protection  |defconfig | is not set | OK: is not found\nnospec_store_bypass_disable           |cmdline| self_protection  |defconfig | is not set | OK: is not found\ndis_ucode_ldr                         |cmdline| self_protection  |defconfig | is not set | OK: is not found\narm64.nobti                           |cmdline| self_protection  |defconfig | is not set | OK: is not found\narm64.nopauth                         |cmdline| self_protection  |defconfig | is not set | OK: is not found\narm64.nomte                           |cmdline| self_protection  |defconfig | is not set | OK: is not found\niommu.passthrough                     |cmdline| self_protection  |defconfig |     0      | OK: CONFIG_IOMMU_DEFAULT_PASSTHROUGH is \"is not set\"\nrodata                                |cmdline| self_protection  |defconfig |     on     | OK: rodata is not found\nspectre_v2                            |cmdline| self_protection  |defconfig | is not off | FAIL: is off, not found\nspectre_v2_user                       |cmdline| self_protection  |defconfig | is not off | FAIL: is off, not found\nspectre_bhi                           |cmdline| self_protection  |defconfig | is not off | FAIL: is off, not found\nspec_store_bypass_disable             |cmdline| self_protection  |defconfig | is not off | FAIL: is off, not found\nl1tf                                  |cmdline| self_protection  |defconfig | is not off | FAIL: is off, not found\nmds                                   |cmdline| self_protection  |defconfig | is not off | FAIL: is off, not found\ntsx_async_abort                       |cmdline| self_protection  |defconfig | is not off | FAIL: is off, not found\nsrbds                                 |cmdline| self_protection  |defconfig | is not off | FAIL: is off, not found\nmmio_stale_data                       |cmdline| self_protection  |defconfig | is not off | FAIL: is off, not found\nretbleed                              |cmdline| self_protection  |defconfig | is not off | FAIL: is off, not found\nspec_rstack_overflow                  |cmdline| self_protection  |defconfig | is not off | FAIL: is off, not found\ngather_data_sampling                  |cmdline| self_protection  |defconfig | is not off | FAIL: is off, not found\nreg_file_data_sampling                |cmdline| self_protection  |defconfig | is not off | FAIL: is off, not found\nslab_merge                            |cmdline| self_protection  |   kspp   | is not set | OK: is not found\nslub_merge                            |cmdline| self_protection  |   kspp   | is not set | OK: is not found\npage_alloc.shuffle                    |cmdline| self_protection  |   kspp   |     1      | FAIL: is not found\nslab_nomerge                          |cmdline| self_protection  |   kspp   | is present | FAIL: is not present\ninit_on_alloc                         |cmdline| self_protection  |   kspp   |     1      | OK: CONFIG_INIT_ON_ALLOC_DEFAULT_ON is \"y\"\ninit_on_free                          |cmdline| self_protection  |   kspp   |     1      | FAIL: is not found\nhardened_usercopy                     |cmdline| self_protection  |   kspp   |     1      | OK: CONFIG_HARDENED_USERCOPY is \"y\"\nslab_common.usercopy_fallback         |cmdline| self_protection  |   kspp   | is not set | OK: is not found\nkfence.sample_interval                |cmdline| self_protection  |   kspp   |    100     | FAIL: is not found\nrandomize_kstack_offset               |cmdline| self_protection  |   kspp   |     1      | OK: CONFIG_RANDOMIZE_KSTACK_OFFSET_DEFAULT is \"y\"\nmitigations                           |cmdline| self_protection  |   kspp   | auto,nosmt | FAIL: is not found\niommu.strict                          |cmdline| self_protection  |   kspp   |     1      | FAIL: is not found\npti                                   |cmdline| self_protection  |   kspp   |     on     | FAIL: is not found\ncfi                                   |cmdline| self_protection  |   kspp   |    kcfi    | FAIL: is not found\niommu                                 |cmdline| self_protection  |  clipos  |   force    | FAIL: is not found\ntsx                                   |cmdline|cut_attack_surface|defconfig |    off     | OK: CONFIG_X86_INTEL_TSX_MODE_OFF is \"y\"\nnosmt                                 |cmdline|cut_attack_surface|   kspp   | is present | FAIL: is not present\nvsyscall                              |cmdline|cut_attack_surface|   kspp   |    none    | FAIL: is not found\nvdso32                                |cmdline|cut_attack_surface|   kspp   |     0      | OK: CONFIG_COMPAT_VDSO is \"is not set\"\ndebugfs                               |cmdline|cut_attack_surface|  grsec   |    off     | FAIL: is not found\nsysrq_always_enabled                  |cmdline|cut_attack_surface|grapheneos| is not set | OK: is not found\nbdev_allow_write_mounted              |cmdline|cut_attack_surface|a13xp0p0v |     0      | FAIL: is not found\nia32_emulation                        |cmdline|cut_attack_surface|a13xp0p0v |     0      | FAIL: is not found\nnorandmaps                            |cmdline| harden_userspace |defconfig | is not set | OK: is not found\nnet.core.bpf_jit_harden               |sysctl | self_protection  |   kspp   |     2      | FAIL: is not found\nkernel.oops_limit                     |sysctl | self_protection  |a13xp0p0v |    100     | FAIL: \"10000\"\nkernel.warn_limit                     |sysctl | self_protection  |a13xp0p0v |    100     | FAIL: \"0\"\nvm.mmap_min_addr                      |sysctl | self_protection  |   kspp   |   65536    | OK\nkernel.dmesg_restrict                 |sysctl |cut_attack_surface|   kspp   |     1      | OK\nkernel.perf_event_paranoid            |sysctl |cut_attack_surface|   kspp   |     3      | FAIL: \"4\"\ndev.tty.ldisc_autoload                |sysctl |cut_attack_surface|   kspp   |     0      | FAIL: \"1\"\nkernel.kptr_restrict                  |sysctl |cut_attack_surface|   kspp   |     2      | FAIL: \"1\"\ndev.tty.legacy_tiocsti                |sysctl |cut_attack_surface|   kspp   |     0      | OK\nuser.max_user_namespaces              |sysctl |cut_attack_surface|   kspp   |     0      | FAIL: \"63936\"\nkernel.kexec_load_disabled            |sysctl |cut_attack_surface|   kspp   |     1      | FAIL: \"0\"\nkernel.unprivileged_bpf_disabled      |sysctl |cut_attack_surface|   kspp   |     1      | FAIL: \"2\"\nvm.unprivileged_userfaultfd           |sysctl |cut_attack_surface|   kspp   |     0      | OK\nkernel.modules_disabled               |sysctl |cut_attack_surface|   kspp   |     1      | FAIL: \"0\"\nkernel.io_uring_disabled              |sysctl |cut_attack_surface|  grsec   |     2      | FAIL: \"0\"\nkernel.sysrq                          |sysctl |cut_attack_surface|a13xp0p0v |     0      | FAIL: \"176\"\nfs.protected_symlinks                 |sysctl | harden_userspace |   kspp   |     1      | OK\nfs.protected_hardlinks                |sysctl | harden_userspace |   kspp   |     1      | OK\nfs.protected_fifos                    |sysctl | harden_userspace |   kspp   |     2      | FAIL: \"1\"\nfs.protected_regular                  |sysctl | harden_userspace |   kspp   |     2      | OK\nfs.suid_dumpable                      |sysctl | harden_userspace |   kspp   |     0      | FAIL: \"2\"\nkernel.randomize_va_space             |sysctl | harden_userspace |   kspp   |     2      | OK\nkernel.yama.ptrace_scope              |sysctl | harden_userspace |   kspp   |     3      | FAIL: \"1\"\nvm.mmap_rnd_bits                      |sysctl | harden_userspace |a13xp0p0v |     32     | FAIL: is not found\nvm.mmap_rnd_compat_bits               |sysctl | harden_userspace |a13xp0p0v |     16     | FAIL: is not found\n\n[+] Config check is finished: 'OK' - 155 / 'FAIL' - 147\n```\n\n## Generating a Kconfig fragment with the security hardening options\n\nWith the `-g` argument, the tool generates a Kconfig fragment with the security hardening options for the selected architecture.\n\nThis Kconfig fragment can be merged with the existing Linux kernel config:\n```\n$ ./bin/kernel-hardening-checker -g X86_64 \u003e /tmp/fragment\n$ cd ~/linux-src/\n$ ./scripts/kconfig/merge_config.sh .config /tmp/fragment\nUsing .config as base\nMerging /tmp/fragment\nValue of CONFIG_BUG_ON_DATA_CORRUPTION is redefined by fragment /tmp/fragment:\nPrevious value: # CONFIG_BUG_ON_DATA_CORRUPTION is not set\nNew value: CONFIG_BUG_ON_DATA_CORRUPTION=y\n ...\n```\n\n## Thanks\n\nThanks to the [contributors][26] and users of this project!\n\n## Questions and answers\n\n__Q:__ How all these kernel parameters influence the Linux kernel security?\n\n__A:__ To answer this question, you can use the `kernel-hardening-checker` [sources of recommendations][24]\nand the [Linux Kernel Defence Map][4] with its references.\n\n\u003cbr /\u003e\n\n__Q:__ How disabling `CONFIG_USER_NS` cuts the attack surface? It's needed for containers!\n\n__A:__ Yes, the `CONFIG_USER_NS` option provides some isolation between the userspace programs,\nbut the tool recommends disabling it to cut the attack surface __of the kernel__.\n\nThe rationale:\n\n  - An LWN article about the corresponding LKML discussion: https://lwn.net/Articles/673597/\n\n  - A twitter thread about `CONFIG_USER_NS` and security: https://twitter.com/robertswiecki/status/1095447678949953541\n\n  - A good overview of the trade-off between having user namespaces enabled, disabled and available only for root: https://github.com/NixOS/nixpkgs/pull/84522#issuecomment-614640601\n\n\u003cbr /\u003e\n\n__Q:__ KSPP and CLIP OS recommend `CONFIG_PANIC_ON_OOPS=y`. Why doesn't this tool do the same?\n\n__A:__ I can't support this recommendation because:\n  - It decreases system robustness (kernel oops is still not a rare situation even on production systems)\n  - It allows easier denial-of-service attacks for the whole system\n\nYou should enable `CONFIG_PANIC_ON_OOPS` if:\n  - Your kernel doesn't encounter oopses during a typical workload\n  - Occasional system reboot is not a problem in your use case\n\nI see a good compromise, which `kernel-hardening-checker` recommends:\n  - Enable the `CONFIG_BUG` kconfig option. If a kernel oops happens in the process context, the offending/attacking process is killed. In other cases, the kernel panics, which is similar to `CONFIG_PANIC_ON_OOPS=y`.\n  - Set the sysctl options `kernel.oops_limit` and `kernel.warn_limit` to `100`, for example. On the one hand, this value doesn't allow easy DoS. On the other hand, it is not too large to miss the vulnerability exploitation attempts generating a lot of kernel warnings or oopses.\n\n\u003cbr /\u003e\n\n__Q:__ Why enabling `CONFIG_STATIC_USERMODEHELPER` breaks various things in my GNU/Linux system?\nDo I really need that feature?\n\n__A:__ Linux kernel usermode helpers can be used for privilege escalation in kernel exploits\n([example 1][9], [example 2][10]). `CONFIG_STATIC_USERMODEHELPER` prevents that method. But it\nrequires the corresponding support in the userspace: see the [example implementation][11] by\nTycho Andersen [@tych0][12].\n\n\u003cbr /\u003e\n\n__Q:__ What about performance impact of these security hardening options?\n\n__A:__ Ike Devolder [@BlackIkeEagle][7] made some performance tests and described the results in [this article][8].\nA more detailed evaluation is in the TODO list (the issue [#66][21]).\n\n\u003cbr /\u003e\n\n__Q:__ Can I easily check which kernel versions support some Kconfig option?\n\n__A:__ Yes. See the [LKDDb][18] project (Linux Kernel Driver Database) by Giacomo Catenazzi [@cateee][19].\nYou can use it for the `mainline` or `stable` tree from [kernel.org][20] or for your custom kernel sources.\n\n\u003cbr /\u003e\n\n__Q:__ Does my kernel have all those mitigations of Transient Execution Vulnerabilities in my hardware?\n\n__A:__ Checking the kernel config is not enough to answer this question.\nI highly recommend using [spectre-meltdown-checker][13] tool maintained by Stéphane Lesimple [@speed47][14].\n\n\u003cbr /\u003e\n\n__Q:__ Why the `CONFIG_GCC_PLUGINS` option is automatically disabled during the kernel compilation?\n\n__A:__ It means that your gcc doesn't support plugins. For example, if you have `gcc-14` on Ubuntu,\ntry to install `gcc-14-plugin-dev` package, it should help.\n\n\n[1]: https://kspp.github.io/Recommended_Settings\n[2]: https://docs.clip-os.org/clipos/kernel.html#configuration\n[3]: https://grsecurity.net/\n[4]: https://github.com/a13xp0p0v/linux-kernel-defence-map\n[5]: https://lwn.net/Articles/791863/\n[6]: https://github.com/a13xp0p0v/kernel-hardening-checker/issues/38\n[7]: https://github.com/BlackIkeEagle\n[8]: https://blog.herecura.eu/blog/2020-05-30-kconfig-hardening-tests/\n[9]: https://googleprojectzero.blogspot.com/2018/09/a-cache-invalidation-bug-in-linux.html\n[10]: https://a13xp0p0v.github.io/2020/02/15/CVE-2019-18683.html\n[11]: https://github.com/tych0/huldufolk\n[12]: https://github.com/tych0\n[13]: https://github.com/speed47/spectre-meltdown-checker\n[14]: https://github.com/speed47\n[15]: https://github.com/a13xp0p0v/kernel-hardening-checker/issues/53\n[16]: https://github.com/a13xp0p0v/kernel-hardening-checker/pull/54\n[17]: https://github.com/a13xp0p0v/kernel-hardening-checker/pull/62\n[18]: https://cateee.net/lkddb/web-lkddb/\n[19]: https://github.com/cateee/lkddb\n[20]: https://kernel.org/\n[21]: https://github.com/a13xp0p0v/kernel-hardening-checker/issues/66\n[22]: https://github.com/a13xp0p0v/kernel-hardening-checker/issues/56\n[23]: https://github.com/a13xp0p0v/kernel-hardening-checker/issues?q=label%3Akernel_maintainer_feedback\n[24]: https://github.com/a13xp0p0v/kernel-hardening-checker#motivation\n[25]: https://grapheneos.org/features\n[26]: https://github.com/a13xp0p0v/kernel-hardening-checker/graphs/contributors\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fa13xp0p0v%2Fkernel-hardening-checker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fa13xp0p0v%2Fkernel-hardening-checker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fa13xp0p0v%2Fkernel-hardening-checker/lists"}