Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
kernel-hardening-checker
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fact-depend
kernel-hardening-checker
Commits
d0c0338f
Commit
d0c0338f
authored
Oct 23, 2022
by
Alexander Popov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update the self-protection checks adopted by KSPP (part V)
Thanks to @kees
parent
bdedd20b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
9 deletions
+7
-9
__init__.py
kconfig_hardened_check/__init__.py
+7
-9
No files found.
kconfig_hardened_check/__init__.py
View file @
d0c0338f
...
@@ -484,6 +484,11 @@ def add_kconfig_checks(l, arch):
...
@@ -484,6 +484,11 @@ def add_kconfig_checks(l, arch):
stackleak_is_set
,
stackleak_is_set
,
gcc_plugins_support_is_set
)]
gcc_plugins_support_is_set
)]
l
+=
[
KconfigCheck
(
'self_protection'
,
'kspp'
,
'RANDOMIZE_KSTACK_OFFSET_DEFAULT'
,
'y'
)]
l
+=
[
KconfigCheck
(
'self_protection'
,
'kspp'
,
'RANDOMIZE_KSTACK_OFFSET_DEFAULT'
,
'y'
)]
if
arch
in
(
'X86_64'
,
'ARM64'
):
cfi_clang_is_set
=
KconfigCheck
(
'self_protection'
,
'kspp'
,
'CFI_CLANG'
,
'y'
)
l
+=
[
cfi_clang_is_set
]
l
+=
[
AND
(
KconfigCheck
(
'self_protection'
,
'kspp'
,
'CFI_PERMISSIVE'
,
'is not set'
),
cfi_clang_is_set
)]
if
arch
in
(
'X86_64'
,
'X86_32'
):
if
arch
in
(
'X86_64'
,
'X86_32'
):
l
+=
[
KconfigCheck
(
'self_protection'
,
'kspp'
,
'SCHED_CORE'
,
'y'
)]
l
+=
[
KconfigCheck
(
'self_protection'
,
'kspp'
,
'SCHED_CORE'
,
'y'
)]
l
+=
[
KconfigCheck
(
'self_protection'
,
'kspp'
,
'DEFAULT_MMAP_MIN_ADDR'
,
'65536'
)]
l
+=
[
KconfigCheck
(
'self_protection'
,
'kspp'
,
'DEFAULT_MMAP_MIN_ADDR'
,
'65536'
)]
...
@@ -500,6 +505,8 @@ def add_kconfig_checks(l, arch):
...
@@ -500,6 +505,8 @@ def add_kconfig_checks(l, arch):
iommu_support_is_set
)]
iommu_support_is_set
)]
if
arch
==
'ARM64'
:
if
arch
==
'ARM64'
:
l
+=
[
KconfigCheck
(
'self_protection'
,
'kspp'
,
'ARM64_SW_TTBR0_PAN'
,
'y'
)]
l
+=
[
KconfigCheck
(
'self_protection'
,
'kspp'
,
'ARM64_SW_TTBR0_PAN'
,
'y'
)]
l
+=
[
KconfigCheck
(
'self_protection'
,
'kspp'
,
'SHADOW_CALL_STACK'
,
'y'
)]
l
+=
[
KconfigCheck
(
'self_protection'
,
'kspp'
,
'KASAN_HW_TAGS'
,
'y'
)]
if
arch
==
'X86_32'
:
if
arch
==
'X86_32'
:
l
+=
[
KconfigCheck
(
'self_protection'
,
'kspp'
,
'PAGE_TABLE_ISOLATION'
,
'y'
)]
l
+=
[
KconfigCheck
(
'self_protection'
,
'kspp'
,
'PAGE_TABLE_ISOLATION'
,
'y'
)]
l
+=
[
KconfigCheck
(
'self_protection'
,
'kspp'
,
'HIGHMEM64G'
,
'y'
)]
l
+=
[
KconfigCheck
(
'self_protection'
,
'kspp'
,
'HIGHMEM64G'
,
'y'
)]
...
@@ -510,15 +517,6 @@ def add_kconfig_checks(l, arch):
...
@@ -510,15 +517,6 @@ def add_kconfig_checks(l, arch):
# 'self_protection', 'clipos'
# 'self_protection', 'clipos'
l
+=
[
KconfigCheck
(
'self_protection'
,
'clipos'
,
'SLAB_MERGE_DEFAULT'
,
'is not set'
)]
l
+=
[
KconfigCheck
(
'self_protection'
,
'clipos'
,
'SLAB_MERGE_DEFAULT'
,
'is not set'
)]
# 'self_protection', 'my'
if
arch
==
'ARM64'
:
l
+=
[
KconfigCheck
(
'self_protection'
,
'my'
,
'SHADOW_CALL_STACK'
,
'y'
)]
# maybe it's alternative to STACKPROTECTOR_STRONG
l
+=
[
KconfigCheck
(
'self_protection'
,
'my'
,
'KASAN_HW_TAGS'
,
'y'
)]
cfi_clang_is_set
=
KconfigCheck
(
'self_protection'
,
'my'
,
'CFI_CLANG'
,
'y'
)
l
+=
[
cfi_clang_is_set
]
l
+=
[
AND
(
KconfigCheck
(
'self_protection'
,
'my'
,
'CFI_PERMISSIVE'
,
'is not set'
),
cfi_clang_is_set
)]
# 'security_policy'
# 'security_policy'
if
arch
in
(
'X86_64'
,
'ARM64'
,
'X86_32'
):
if
arch
in
(
'X86_64'
,
'ARM64'
,
'X86_32'
):
l
+=
[
KconfigCheck
(
'security_policy'
,
'defconfig'
,
'SECURITY'
,
'y'
)]
# and choose your favourite LSM
l
+=
[
KconfigCheck
(
'security_policy'
,
'defconfig'
,
'SECURITY'
,
'y'
)]
# and choose your favourite LSM
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment