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
bdac2c22
Commit
bdac2c22
authored
Mar 31, 2020
by
Alexander Popov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement PresenceCheck and use it for LDISC_AUTOLOAD
Refers to #32
parent
c5289224
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
1 deletions
+21
-1
__init__.py
kconfig_hardened_check/__init__.py
+21
-1
No files found.
kconfig_hardened_check/__init__.py
View file @
bdac2c22
...
...
@@ -130,6 +130,26 @@ class VerCheck:
print
(
'| {}'
.
format
(
self
.
result
),
end
=
''
)
class
PresenceCheck
:
def
__init__
(
self
,
name
):
self
.
name
=
name
self
.
state
=
None
self
.
result
=
None
def
check
(
self
):
if
self
.
state
is
None
:
self
.
result
=
'FAIL: not present'
return
False
,
self
.
result
else
:
self
.
result
=
'OK: is present'
return
True
,
self
.
result
def
table_print
(
self
,
with_results
):
print
(
'CONFIG_{:<84}'
.
format
(
self
.
name
+
' is present'
),
end
=
''
)
if
with_results
:
print
(
'| {}'
.
format
(
self
.
result
),
end
=
''
)
class
ComplexOptCheck
:
def
__init__
(
self
,
*
opts
):
self
.
opts
=
opts
...
...
@@ -458,7 +478,7 @@ def construct_checklist(checklist, arch):
checklist
.
append
(
OptCheck
(
'X86_MSR'
,
'is not set'
,
'clipos'
,
'cut_attack_surface'
))
# refers to LOCKDOWN
checklist
.
append
(
OptCheck
(
'X86_CPUID'
,
'is not set'
,
'clipos'
,
'cut_attack_surface'
))
checklist
.
append
(
AND
(
OptCheck
(
'LDISC_AUTOLOAD'
,
'is not set'
,
'clipos'
,
'cut_attack_surface'
),
\
VerCheck
((
5
,
1
))))
# LDISC_AUTOLOAD can be disabled since v5.1
PresenceCheck
(
'LDISC_AUTOLOAD'
)))
checklist
.
append
(
OptCheck
(
'AIO'
,
'is not set'
,
'grapheneos'
,
'cut_attack_surface'
))
...
...
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