-
Notifications
You must be signed in to change notification settings - Fork 161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Modify requirements for Android configs #91
Modify requirements for Android configs #91
Conversation
Hello @petervanvugt, Nice idea, thanks. Let's discuss some details. |
@@ -51,8 +52,9 @@ def add_kconfig_checks(l, arch): | |||
l += [OR(KconfigCheck('self_protection', 'defconfig', 'STRICT_MODULE_RWX', 'y'), | |||
KconfigCheck('self_protection', 'defconfig', 'DEBUG_SET_MODULE_RONX', 'y'), | |||
modules_not_set)] # DEBUG_SET_MODULE_RONX was before v4.11 | |||
l += [OR(KconfigCheck('self_protection', 'defconfig', 'REFCOUNT_FULL', 'y'), | |||
VersionCheck((5, 5)))] # REFCOUNT_FULL is enabled by default since v5.5 | |||
if arch in ('X86_64'): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you describe the rationale behind this change?
I think REFCOUNT_FULL
was available for other architectures, not only for X86_64
.
@@ -118,7 +120,7 @@ def add_kconfig_checks(l, arch): | |||
l += [KconfigCheck('self_protection', 'kspp', 'DEBUG_NOTIFIERS', 'y')] | |||
l += [KconfigCheck('self_protection', 'kspp', 'INIT_ON_ALLOC_DEFAULT_ON', 'y')] | |||
l += [KconfigCheck('self_protection', 'kspp', 'KFENCE', 'y')] | |||
l += [KconfigCheck('self_protection', 'kspp', 'HW_RANDOM_TPM', 'y')] | |||
l += [OR(KconfigCheck('self_protection', 'kspp', 'HW_RANDOM_TPM', 'y'), is_android)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you describe the contradiction between ANDROID
and HW_RANDOM_TPM
?
@@ -222,11 +224,13 @@ def add_kconfig_checks(l, arch): | |||
l += [KconfigCheck('security_policy', 'defconfig', 'SECURITY', 'y')] | |||
if arch == 'ARM': | |||
l += [KconfigCheck('security_policy', 'kspp', 'SECURITY', 'y')] | |||
l += [KconfigCheck('security_policy', 'kspp', 'SECURITY_YAMA', 'y')] | |||
l += [OR(KconfigCheck('security_policy', 'kspp', 'SECURITY_YAMA', 'y'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you describe the contradiction between ANDROID
and SECURITY_YAMA
?
@@ -265,7 +269,7 @@ def add_kconfig_checks(l, arch): | |||
l += [KconfigCheck('cut_attack_surface', 'kspp', 'MODIFY_LDT_SYSCALL', 'is not set')] | |||
l += [KconfigCheck('cut_attack_surface', 'kspp', 'OABI_COMPAT', 'is not set')] | |||
l += [KconfigCheck('cut_attack_surface', 'kspp', 'X86_MSR', 'is not set')] # refers to LOCKDOWN | |||
l += [modules_not_set] | |||
l += [OR(modules_not_set, is_android)] # Android requires kernel modules |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I've found this in the documentation: https://source.android.com/docs/core/architecture/kernel/loadable-kernel-modules
l += [KconfigCheck('security_policy', 'kspp', 'SECURITY_LANDLOCK', 'y')] | ||
l += [KconfigCheck('security_policy', 'kspp', 'SECURITY_SELINUX_DISABLE', 'is not set')] | ||
l += [KconfigCheck('security_policy', 'kspp', 'SECURITY_SELINUX_BOOTPARAM', 'is not set')] | ||
l += [KconfigCheck('security_policy', 'kspp', 'SECURITY_SELINUX_DEVELOP', 'is not set')] | ||
l += [OR(KconfigCheck('security_policy', 'kspp', 'SECURITY_SELINUX_DEVELOP', 'is not set'), | ||
is_android)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's interesting.
Why does ANDROID
require this debug option for SELINUX
?
@@ -338,7 +342,8 @@ def add_kconfig_checks(l, arch): | |||
l += [KconfigCheck('cut_attack_surface', 'clipos', 'STAGING', 'is not set')] | |||
l += [KconfigCheck('cut_attack_surface', 'clipos', 'KSM', 'is not set')] # to prevent FLUSH+RELOAD attack | |||
l += [KconfigCheck('cut_attack_surface', 'clipos', 'KALLSYMS', 'is not set')] | |||
l += [KconfigCheck('cut_attack_surface', 'clipos', 'MAGIC_SYSRQ', 'is not set')] | |||
l += [OR(KconfigCheck('cut_attack_surface', 'clipos', 'MAGIC_SYSRQ', 'is not set'), | |||
is_android)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you describe the contradiction between ANDROID
and MAGIC_SYSRQ
?
@@ -367,6 +372,7 @@ def add_kconfig_checks(l, arch): | |||
l += [KconfigCheck('cut_attack_surface', 'my', 'CORESIGHT', 'is not set')] | |||
l += [KconfigCheck('cut_attack_surface', 'my', 'XFS_SUPPORT_V4', 'is not set')] | |||
l += [OR(KconfigCheck('cut_attack_surface', 'my', 'TRIM_UNUSED_KSYMS', 'y'), | |||
is_android, # Android frequently uses out-of-tree modules |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto, I would ask a reference to the documentation.
@@ -351,7 +356,7 @@ def add_kconfig_checks(l, arch): | |||
l += [KconfigCheck('cut_attack_surface', 'lockdown', 'EFI_TEST', 'is not set')] # refers to LOCKDOWN | |||
l += [KconfigCheck('cut_attack_surface', 'lockdown', 'MMIOTRACE_TEST', 'is not set')] # refers to LOCKDOWN | |||
l += [KconfigCheck('cut_attack_surface', 'lockdown', 'KPROBES', 'is not set')] # refers to LOCKDOWN | |||
l += [bpf_syscall_not_set] # refers to LOCKDOWN | |||
l += [OR(bpf_syscall_not_set, is_android)] # refers to LOCKDOWN, Android requires BPF |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would ask a reference to the documentation.
> Android configs require various things that are currently disallowed in this tool. We can use CONFIG_ANDROID to detect Android configs and generate reports with fewer positives that cannot/should not be changed. Based on a13xp0p0v#91
ea24300
to
78f5595
Compare
> Android configs require various things that are currently disallowed in this > tool. We can use CONFIG_ANDROID to detect Android configs and generate reports with fewer positives that cannot/should not be changed. Based on a13xp0p0v#91
For now, closing this pull request. See the details in #142. |
Android configs require various things that are currently disallowed in this tool. We can use CONFIG_ANDROID to detect Android configs and generate reports with fewer positives that cannot/should not be changed.