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
745742b3
Commit
745742b3
authored
Jun 20, 2022
by
Alexander Popov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rewrite the randomize_kstack_offset check
Reusing "is not set" for CmdlineCheck is a nice hack.
parent
ba678bf3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
__init__.py
kconfig_hardened_check/__init__.py
+5
-3
No files found.
kconfig_hardened_check/__init__.py
View file @
745742b3
...
@@ -426,8 +426,7 @@ def add_kconfig_checks(l, arch):
...
@@ -426,8 +426,7 @@ def add_kconfig_checks(l, arch):
if
arch
in
(
'X86_64'
,
'ARM64'
,
'X86_32'
):
if
arch
in
(
'X86_64'
,
'ARM64'
,
'X86_32'
):
stackleak_is_set
=
KconfigCheck
(
'self_protection'
,
'kspp'
,
'GCC_PLUGIN_STACKLEAK'
,
'y'
)
stackleak_is_set
=
KconfigCheck
(
'self_protection'
,
'kspp'
,
'GCC_PLUGIN_STACKLEAK'
,
'y'
)
l
+=
[
stackleak_is_set
]
l
+=
[
stackleak_is_set
]
l
+=
[
OR
(
KconfigCheck
(
'self_protection'
,
'kspp'
,
'RANDOMIZE_KSTACK_OFFSET_DEFAULT'
,
'y'
),
l
+=
[
KconfigCheck
(
'self_protection'
,
'kspp'
,
'RANDOMIZE_KSTACK_OFFSET_DEFAULT'
,
'y'
)]
CmdlineCheck
(
'self_protection'
,
'kspp'
,
'randomize_kstack_offset'
,
'1'
))]
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'
)]
...
@@ -652,7 +651,10 @@ def add_cmdline_checks(l, arch):
...
@@ -652,7 +651,10 @@ def add_cmdline_checks(l, arch):
l
+=
[
OR
(
CmdlineCheck
(
'self_protection'
,
'kspp'
,
'init_on_alloc'
,
'1'
),
l
+=
[
OR
(
CmdlineCheck
(
'self_protection'
,
'kspp'
,
'init_on_alloc'
,
'1'
),
AND
(
KconfigCheck
(
'self_protection'
,
'kspp'
,
'INIT_ON_ALLOC_DEFAULT_ON'
,
'y'
),
AND
(
KconfigCheck
(
'self_protection'
,
'kspp'
,
'INIT_ON_ALLOC_DEFAULT_ON'
,
'y'
),
CmdlineCheck
(
'self_protection'
,
'kspp'
,
'init_on_alloc'
,
'is not set'
)))]
CmdlineCheck
(
'self_protection'
,
'kspp'
,
'init_on_alloc'
,
'is not set'
)))]
if
arch
in
(
'X86_64'
,
'ARM64'
,
'X86_32'
):
l
+=
[
OR
(
CmdlineCheck
(
'self_protection'
,
'kspp'
,
'randomize_kstack_offset'
,
'1'
),
AND
(
KconfigCheck
(
'self_protection'
,
'kspp'
,
'RANDOMIZE_KSTACK_OFFSET_DEFAULT'
,
'y'
),
CmdlineCheck
(
'self_protection'
,
'kspp'
,
'randomize_kstack_offset'
,
'is not set'
)))]
if
arch
in
(
'X86_64'
,
'X86_32'
):
if
arch
in
(
'X86_64'
,
'X86_32'
):
l
+=
[
CmdlineCheck
(
'self_protection'
,
'kspp'
,
'pti'
,
'on'
)]
l
+=
[
CmdlineCheck
(
'self_protection'
,
'kspp'
,
'pti'
,
'on'
)]
# TODO: add other
# TODO: add other
...
...
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