|
|
38a2c0 |
From 742e103392746dac771663247d169cfe498ee658 Mon Sep 17 00:00:00 2001
|
|
|
38a2c0 |
From: Vojtech Polasek <vpolasek@redhat.com>
|
|
|
38a2c0 |
Date: Fri, 21 Jan 2022 14:02:16 +0100
|
|
|
38a2c0 |
Subject: [PATCH 1/7] modify vsyscall rules according to rhel9 ospp
|
|
|
38a2c0 |
|
|
|
38a2c0 |
add references
|
|
|
38a2c0 |
make rules scored in th e profile
|
|
|
38a2c0 |
---
|
|
|
38a2c0 |
.../system/bootloader-grub2/grub2_vsyscall_argument/rule.yml | 1 +
|
|
|
38a2c0 |
.../system/bootloader-zipl/zipl_vsyscall_argument/rule.yml | 3 +++
|
|
|
38a2c0 |
products/rhel9/profiles/ospp.profile | 4 ----
|
|
|
38a2c0 |
3 files changed, 4 insertions(+), 4 deletions(-)
|
|
|
38a2c0 |
|
|
|
38a2c0 |
diff --git a/linux_os/guide/system/bootloader-grub2/grub2_vsyscall_argument/rule.yml b/linux_os/guide/system/bootloader-grub2/grub2_vsyscall_argument/rule.yml
|
|
|
38a2c0 |
index 1dd26fea9b6..9f38a1c13b9 100644
|
|
|
38a2c0 |
--- a/linux_os/guide/system/bootloader-grub2/grub2_vsyscall_argument/rule.yml
|
|
|
38a2c0 |
+++ b/linux_os/guide/system/bootloader-grub2/grub2_vsyscall_argument/rule.yml
|
|
|
38a2c0 |
@@ -25,6 +25,7 @@ identifiers:
|
|
|
38a2c0 |
references:
|
|
|
38a2c0 |
disa: CCI-001084
|
|
|
38a2c0 |
nist: CM-7(a)
|
|
|
38a2c0 |
+ ospp: FPT_ASLR_EXT.1
|
|
|
38a2c0 |
srg: SRG-OS-000480-GPOS-00227,SRG-OS-000134-GPOS-00068
|
|
|
38a2c0 |
stigid@ol8: OL08-00-010422
|
|
|
38a2c0 |
stigid@rhel8: RHEL-08-010422
|
|
|
38a2c0 |
diff --git a/linux_os/guide/system/bootloader-zipl/zipl_vsyscall_argument/rule.yml b/linux_os/guide/system/bootloader-zipl/zipl_vsyscall_argument/rule.yml
|
|
|
38a2c0 |
index 52b192ffc52..9d645c8876e 100644
|
|
|
38a2c0 |
--- a/linux_os/guide/system/bootloader-zipl/zipl_vsyscall_argument/rule.yml
|
|
|
38a2c0 |
+++ b/linux_os/guide/system/bootloader-zipl/zipl_vsyscall_argument/rule.yml
|
|
|
38a2c0 |
@@ -21,6 +21,9 @@ identifiers:
|
|
|
38a2c0 |
cce@rhel8: CCE-83381-4
|
|
|
38a2c0 |
cce@rhel9: CCE-84100-7
|
|
|
38a2c0 |
|
|
|
38a2c0 |
+references:
|
|
|
38a2c0 |
+ ospp: FPT_ASLR_EXT.1
|
|
|
38a2c0 |
+
|
|
|
38a2c0 |
ocil_clause: 'vsyscalls are enabled'
|
|
|
38a2c0 |
|
|
|
38a2c0 |
ocil: |-
|
|
|
38a2c0 |
diff --git a/products/rhel9/profiles/ospp.profile b/products/rhel9/profiles/ospp.profile
|
|
|
38a2c0 |
index 287a28c43c5..f0b850a4ced 100644
|
|
|
38a2c0 |
--- a/products/rhel9/profiles/ospp.profile
|
|
|
38a2c0 |
+++ b/products/rhel9/profiles/ospp.profile
|
|
|
38a2c0 |
@@ -128,8 +128,6 @@ selections:
|
|
|
38a2c0 |
- grub2_slub_debug_argument
|
|
|
38a2c0 |
- grub2_page_poison_argument
|
|
|
38a2c0 |
- grub2_vsyscall_argument
|
|
|
38a2c0 |
- - grub2_vsyscall_argument.role=unscored
|
|
|
38a2c0 |
- - grub2_vsyscall_argument.severity=info
|
|
|
38a2c0 |
- grub2_pti_argument
|
|
|
38a2c0 |
- grub2_kernel_trust_cpu_rng
|
|
|
38a2c0 |
|
|
|
38a2c0 |
@@ -421,5 +419,3 @@ selections:
|
|
|
38a2c0 |
- zipl_slub_debug_argument
|
|
|
38a2c0 |
- zipl_page_poison_argument
|
|
|
38a2c0 |
- zipl_vsyscall_argument
|
|
|
38a2c0 |
- - zipl_vsyscall_argument.role=unscored
|
|
|
38a2c0 |
- - zipl_vsyscall_argument.severity=info
|
|
|
38a2c0 |
|
|
|
38a2c0 |
From d167658d46accbc75200a5d145a746322f1c2d4a Mon Sep 17 00:00:00 2001
|
|
|
38a2c0 |
From: Vojtech Polasek <vpolasek@redhat.com>
|
|
|
38a2c0 |
Date: Fri, 21 Jan 2022 14:05:24 +0100
|
|
|
38a2c0 |
Subject: [PATCH 2/7] add ospp references to fips rules
|
|
|
38a2c0 |
|
|
|
38a2c0 |
---
|
|
|
38a2c0 |
.../software/integrity/fips/enable_dracut_fips_module/rule.yml | 1 +
|
|
|
38a2c0 |
.../system/software/integrity/fips/enable_fips_mode/rule.yml | 2 +-
|
|
|
38a2c0 |
2 files changed, 2 insertions(+), 1 deletion(-)
|
|
|
38a2c0 |
|
|
|
38a2c0 |
diff --git a/linux_os/guide/system/software/integrity/fips/enable_dracut_fips_module/rule.yml b/linux_os/guide/system/software/integrity/fips/enable_dracut_fips_module/rule.yml
|
|
|
38a2c0 |
index f342b9b8d95..3b7c3229b6f 100644
|
|
|
38a2c0 |
--- a/linux_os/guide/system/software/integrity/fips/enable_dracut_fips_module/rule.yml
|
|
|
38a2c0 |
+++ b/linux_os/guide/system/software/integrity/fips/enable_dracut_fips_module/rule.yml
|
|
|
38a2c0 |
@@ -29,6 +29,7 @@ references:
|
|
|
38a2c0 |
ism: "1446"
|
|
|
38a2c0 |
nerc-cip: CIP-003-8 R4.2,CIP-007-3 R5.1
|
|
|
38a2c0 |
nist: SC-12(2),SC-12(3),IA-7,SC-13,CM-6(a),SC-12
|
|
|
38a2c0 |
+ ospp: FCS_RBG_EXT.1
|
|
|
38a2c0 |
srg: SRG-OS-000478-GPOS-00223
|
|
|
38a2c0 |
stigid@ol8: OL08-00-010020
|
|
|
38a2c0 |
stigid@rhel8: RHEL-08-010020
|
|
|
38a2c0 |
diff --git a/linux_os/guide/system/software/integrity/fips/enable_fips_mode/rule.yml b/linux_os/guide/system/software/integrity/fips/enable_fips_mode/rule.yml
|
|
|
38a2c0 |
index 7559e61600d..9d89114b07f 100644
|
|
|
38a2c0 |
--- a/linux_os/guide/system/software/integrity/fips/enable_fips_mode/rule.yml
|
|
|
38a2c0 |
+++ b/linux_os/guide/system/software/integrity/fips/enable_fips_mode/rule.yml
|
|
|
38a2c0 |
@@ -39,7 +39,7 @@ references:
|
|
|
38a2c0 |
ism: "1446"
|
|
|
38a2c0 |
nerc-cip: CIP-003-8 R4.2,CIP-007-3 R5.1
|
|
|
38a2c0 |
nist: SC-12(2),SC-12(3),IA-7,SC-13,CM-6(a),SC-12
|
|
|
38a2c0 |
- ospp: FCS_COP.1(1),FCS_COP.1(2),FCS_COP.1(3),FCS_COP.1(4),FCS_CKM.1,FCS_CKM.2,FCS_TLSC_EXT.1
|
|
|
38a2c0 |
+ ospp: FCS_COP.1(1),FCS_COP.1(2),FCS_COP.1(3),FCS_COP.1(4),FCS_CKM.1,FCS_CKM.2,FCS_TLSC_EXT.1,FCS_RBG_EXT.1
|
|
|
38a2c0 |
srg: SRG-OS-000478-GPOS-00223,SRG-OS-000396-GPOS-00176
|
|
|
38a2c0 |
stigid@ol8: OL08-00-010020
|
|
|
38a2c0 |
stigid@rhel8: RHEL-08-010020
|
|
|
38a2c0 |
|
|
|
38a2c0 |
From f05e895bb96b64a5142e62e3dd0f7208633d5c23 Mon Sep 17 00:00:00 2001
|
|
|
38a2c0 |
From: Vojtech Polasek <vpolasek@redhat.com>
|
|
|
38a2c0 |
Date: Fri, 21 Jan 2022 14:08:36 +0100
|
|
|
38a2c0 |
Subject: [PATCH 3/7] drop no longer needed rules from ospp rhel9 profile
|
|
|
38a2c0 |
|
|
|
38a2c0 |
---
|
|
|
38a2c0 |
products/rhel9/profiles/ospp.profile | 6 ------
|
|
|
38a2c0 |
1 file changed, 6 deletions(-)
|
|
|
38a2c0 |
|
|
|
38a2c0 |
diff --git a/products/rhel9/profiles/ospp.profile b/products/rhel9/profiles/ospp.profile
|
|
|
38a2c0 |
index f0b850a4ced..7e30054bc98 100644
|
|
|
38a2c0 |
--- a/products/rhel9/profiles/ospp.profile
|
|
|
38a2c0 |
+++ b/products/rhel9/profiles/ospp.profile
|
|
|
38a2c0 |
@@ -125,11 +125,7 @@ selections:
|
|
|
38a2c0 |
## Boot prompt
|
|
|
38a2c0 |
- grub2_audit_argument
|
|
|
38a2c0 |
- grub2_audit_backlog_limit_argument
|
|
|
38a2c0 |
- - grub2_slub_debug_argument
|
|
|
38a2c0 |
- - grub2_page_poison_argument
|
|
|
38a2c0 |
- grub2_vsyscall_argument
|
|
|
38a2c0 |
- - grub2_pti_argument
|
|
|
38a2c0 |
- - grub2_kernel_trust_cpu_rng
|
|
|
38a2c0 |
|
|
|
38a2c0 |
## Security Settings
|
|
|
38a2c0 |
- sysctl_kernel_kptr_restrict
|
|
|
38a2c0 |
@@ -416,6 +412,4 @@ selections:
|
|
|
38a2c0 |
- zipl_bootmap_is_up_to_date
|
|
|
38a2c0 |
- zipl_audit_argument
|
|
|
38a2c0 |
- zipl_audit_backlog_limit_argument
|
|
|
38a2c0 |
- - zipl_slub_debug_argument
|
|
|
38a2c0 |
- - zipl_page_poison_argument
|
|
|
38a2c0 |
- zipl_vsyscall_argument
|
|
|
38a2c0 |
|
|
|
38a2c0 |
From 972ae269eff95de8a6914056d38e58b7aeafb8c3 Mon Sep 17 00:00:00 2001
|
|
|
38a2c0 |
From: Vojtech Polasek <vpolasek@redhat.com>
|
|
|
38a2c0 |
Date: Fri, 21 Jan 2022 15:12:46 +0100
|
|
|
38a2c0 |
Subject: [PATCH 4/7] add grub2_init_on_alloc rule
|
|
|
38a2c0 |
|
|
|
38a2c0 |
---
|
|
|
38a2c0 |
.../grub2_init_on_alloc_argument/rule.yml | 46 +++++++++++++++++++
|
|
|
38a2c0 |
shared/references/cce-redhat-avail.txt | 1 -
|
|
|
38a2c0 |
2 files changed, 46 insertions(+), 1 deletion(-)
|
|
|
38a2c0 |
create mode 100644 linux_os/guide/system/bootloader-grub2/grub2_init_on_alloc_argument/rule.yml
|
|
|
38a2c0 |
|
|
|
38a2c0 |
diff --git a/linux_os/guide/system/bootloader-grub2/grub2_init_on_alloc_argument/rule.yml b/linux_os/guide/system/bootloader-grub2/grub2_init_on_alloc_argument/rule.yml
|
|
|
38a2c0 |
new file mode 100644
|
|
|
38a2c0 |
index 00000000000..592e2fb117d
|
|
|
38a2c0 |
--- /dev/null
|
|
|
38a2c0 |
+++ b/linux_os/guide/system/bootloader-grub2/grub2_init_on_alloc_argument/rule.yml
|
|
|
38a2c0 |
@@ -0,0 +1,46 @@
|
|
|
38a2c0 |
+documentation_complete: true
|
|
|
38a2c0 |
+
|
|
|
38a2c0 |
+prodtype: rhel9
|
|
|
38a2c0 |
+
|
|
|
38a2c0 |
+title: 'Configure kernel to zero out memory before allocation (through Grub2)'
|
|
|
38a2c0 |
+
|
|
|
38a2c0 |
+description: |-
|
|
|
38a2c0 |
+ To configure the kernel to zero out memory before allocating it, add the
|
|
|
38a2c0 |
+ <tt>init_on_alloc=1</tt> argument to the default GRUB 2 command line for
|
|
|
38a2c0 |
+ the Linux operating system in <tt>/etc/default/grub</tt>, in the manner
|
|
|
38a2c0 |
+ below:
|
|
|
38a2c0 |
+ GRUB_CMDLINE_LINUX="crashkernel=auto quiet rd.shell=0 audit=1 audit_backlog_limit=8192 init_on_alloc=1"
|
|
|
38a2c0 |
+ Update the boot parameter for existing kernels by running the following command:
|
|
|
38a2c0 |
+ # grubby --update-kernel=ALL --args="init_on_alloc=1"
|
|
|
38a2c0 |
+
|
|
|
38a2c0 |
+rationale: |-
|
|
|
38a2c0 |
+ When the kernel configuration option <tt>init_on_alloc</tt> is enabled,
|
|
|
38a2c0 |
+ all page allocator and slab allocator memory will be zeroed when allocated,
|
|
|
38a2c0 |
+ eliminating many kinds of "uninitialized heap memory" flaws, effectively
|
|
|
38a2c0 |
+ preventing data leaks.
|
|
|
38a2c0 |
+
|
|
|
38a2c0 |
+severity: medium
|
|
|
38a2c0 |
+
|
|
|
38a2c0 |
+identifiers:
|
|
|
38a2c0 |
+ cce@rhel9: CCE-85867-0
|
|
|
38a2c0 |
+
|
|
|
38a2c0 |
+ocil_clause: 'the kernel is not configured to zero out memory before allocation'
|
|
|
38a2c0 |
+
|
|
|
38a2c0 |
+ocil: |-
|
|
|
38a2c0 |
+ Make sure that the kernel is configured to zero out memory before
|
|
|
38a2c0 |
+ allocation. Ensure that the parameter is configured in
|
|
|
38a2c0 |
+ <tt>/etc/default/grub</tt>:
|
|
|
38a2c0 |
+ grep GRUB_CMDLINE_LINUX /etc/default/grub
|
|
|
38a2c0 |
+ The output should contain <tt>init_on_alloc=1</tt>.
|
|
|
38a2c0 |
+ Run the following command to display command line parameters of all
|
|
|
38a2c0 |
+ installed kernels:
|
|
|
38a2c0 |
+ # grubby --info=ALL | grep args
|
|
|
38a2c0 |
+ Ensure that each line contains the <tt>init_on_alloc=1</tt> parameter.
|
|
|
38a2c0 |
+
|
|
|
38a2c0 |
+platform: machine
|
|
|
38a2c0 |
+
|
|
|
38a2c0 |
+template:
|
|
|
38a2c0 |
+ name: grub2_bootloader_argument
|
|
|
38a2c0 |
+ vars:
|
|
|
38a2c0 |
+ arg_name: init_on_alloc
|
|
|
38a2c0 |
+ arg_value: '1'
|
|
|
38a2c0 |
diff --git a/shared/references/cce-redhat-avail.txt b/shared/references/cce-redhat-avail.txt
|
|
|
38a2c0 |
index 8aad24b20f7..6835189cd99 100644
|
|
|
38a2c0 |
--- a/shared/references/cce-redhat-avail.txt
|
|
|
38a2c0 |
+++ b/shared/references/cce-redhat-avail.txt
|
|
|
38a2c0 |
@@ -1,4 +1,3 @@
|
|
|
38a2c0 |
-CCE-85867-0
|
|
|
38a2c0 |
CCE-85868-8
|
|
|
38a2c0 |
CCE-85872-0
|
|
|
38a2c0 |
CCE-85873-8
|
|
|
38a2c0 |
|
|
|
38a2c0 |
From a865514257c85d79aaf7e4286d8723aa1ad8de03 Mon Sep 17 00:00:00 2001
|
|
|
38a2c0 |
From: Vojtech Polasek <vpolasek@redhat.com>
|
|
|
38a2c0 |
Date: Mon, 24 Jan 2022 10:01:23 +0100
|
|
|
38a2c0 |
Subject: [PATCH 5/7] add zipl_init_on_alloc_argument rule
|
|
|
38a2c0 |
|
|
|
38a2c0 |
---
|
|
|
38a2c0 |
.../zipl_init_on_alloc_argument/rule.yml | 41 +++++++++++++++++++
|
|
|
38a2c0 |
.../tests/correct_option.pass.sh | 15 +++++++
|
|
|
38a2c0 |
.../tests/missing_in_cmdline.fail.sh | 13 ++++++
|
|
|
38a2c0 |
.../tests/missing_in_entry.fail.sh | 13 ++++++
|
|
|
38a2c0 |
shared/references/cce-redhat-avail.txt | 1 -
|
|
|
38a2c0 |
5 files changed, 82 insertions(+), 1 deletion(-)
|
|
|
38a2c0 |
create mode 100644 linux_os/guide/system/bootloader-zipl/zipl_init_on_alloc_argument/rule.yml
|
|
|
38a2c0 |
create mode 100644 linux_os/guide/system/bootloader-zipl/zipl_init_on_alloc_argument/tests/correct_option.pass.sh
|
|
|
38a2c0 |
create mode 100644 linux_os/guide/system/bootloader-zipl/zipl_init_on_alloc_argument/tests/missing_in_cmdline.fail.sh
|
|
|
38a2c0 |
create mode 100644 linux_os/guide/system/bootloader-zipl/zipl_init_on_alloc_argument/tests/missing_in_entry.fail.sh
|
|
|
38a2c0 |
|
|
|
38a2c0 |
diff --git a/linux_os/guide/system/bootloader-zipl/zipl_init_on_alloc_argument/rule.yml b/linux_os/guide/system/bootloader-zipl/zipl_init_on_alloc_argument/rule.yml
|
|
|
38a2c0 |
new file mode 100644
|
|
|
38a2c0 |
index 00000000000..b47a7757327
|
|
|
38a2c0 |
--- /dev/null
|
|
|
38a2c0 |
+++ b/linux_os/guide/system/bootloader-zipl/zipl_init_on_alloc_argument/rule.yml
|
|
|
38a2c0 |
@@ -0,0 +1,41 @@
|
|
|
38a2c0 |
+documentation_complete: true
|
|
|
38a2c0 |
+
|
|
|
38a2c0 |
+prodtype: rhel9
|
|
|
38a2c0 |
+
|
|
|
38a2c0 |
+title: 'Configure kernel to zero out memory before allocation (through zIPl)'
|
|
|
38a2c0 |
+
|
|
|
38a2c0 |
+description: |-
|
|
|
38a2c0 |
+ To ensure that the kernel is configured to zero out memory before
|
|
|
38a2c0 |
+ allocation, check that all boot entries in
|
|
|
38a2c0 |
+ <tt>/boot/loader/entries/*.conf</tt> have <tt>init_on_alloc=1</tt>
|
|
|
38a2c0 |
+ included in its options.
|
|
|
38a2c0 |
+
|
|
|
38a2c0 |
+ To ensure that new kernels and boot entries continue to zero out memory
|
|
|
38a2c0 |
+ before allocation, add <tt>init_on_alloc=1</tt> to <tt>/etc/kernel/cmdline</tt>.
|
|
|
38a2c0 |
+
|
|
|
38a2c0 |
+rationale: |-
|
|
|
38a2c0 |
+ When the kernel configuration option <tt>init_on_alloc</tt> is enabled,
|
|
|
38a2c0 |
+ all page allocator and slab allocator memory will be zeroed when allocated,
|
|
|
38a2c0 |
+ eliminating many kinds of "uninitialized heap memory" flaws, effectively
|
|
|
38a2c0 |
+ preventing data leaks.
|
|
|
38a2c0 |
+
|
|
|
38a2c0 |
+severity: medium
|
|
|
38a2c0 |
+
|
|
|
38a2c0 |
+identifiers:
|
|
|
38a2c0 |
+ cce@rhel9: CCE-85868-8
|
|
|
38a2c0 |
+
|
|
|
38a2c0 |
+ocil_clause: 'the kernel is not configured to zero out memory before allocation'
|
|
|
38a2c0 |
+
|
|
|
38a2c0 |
+ocil: |-
|
|
|
38a2c0 |
+ To check that the kernel is configured to zero out memory before allocation
|
|
|
38a2c0 |
+ time, check all boot entries with following command:
|
|
|
38a2c0 |
+ sudo grep -L"^options\s+.*\binit_on_alloc=1\b" /boot/loader/entries/*.conf
|
|
|
38a2c0 |
+ No line should be returned, each line returned is a boot entry that doesn't enable audit.
|
|
|
38a2c0 |
+
|
|
|
38a2c0 |
+platform: machine
|
|
|
38a2c0 |
+
|
|
|
38a2c0 |
+template:
|
|
|
38a2c0 |
+ name: zipl_bls_entries_option
|
|
|
38a2c0 |
+ vars:
|
|
|
38a2c0 |
+ arg_name: init_on_alloc
|
|
|
38a2c0 |
+ arg_value: '1'
|
|
|
38a2c0 |
diff --git a/linux_os/guide/system/bootloader-zipl/zipl_init_on_alloc_argument/tests/correct_option.pass.sh b/linux_os/guide/system/bootloader-zipl/zipl_init_on_alloc_argument/tests/correct_option.pass.sh
|
|
|
38a2c0 |
new file mode 100644
|
|
|
38a2c0 |
index 00000000000..50cf1b78f70
|
|
|
38a2c0 |
--- /dev/null
|
|
|
38a2c0 |
+++ b/linux_os/guide/system/bootloader-zipl/zipl_init_on_alloc_argument/tests/correct_option.pass.sh
|
|
|
38a2c0 |
@@ -0,0 +1,15 @@
|
|
|
38a2c0 |
+#!/bin/bash
|
|
|
38a2c0 |
+# platform = multi_platform_fedora,Red Hat Enterprise Linux 8, Red Hat Enterprise Linux 9
|
|
|
38a2c0 |
+
|
|
|
38a2c0 |
+# Make sure boot loader entries contain init_on_alloc=1
|
|
|
38a2c0 |
+for file in /boot/loader/entries/*.conf
|
|
|
38a2c0 |
+do
|
|
|
38a2c0 |
+ if ! grep -q '^options.*init_on_alloc=1.*$' "$file" ; then
|
|
|
38a2c0 |
+ sed -i '/^options / s/$/ init_on_alloc=1/' "$file"
|
|
|
38a2c0 |
+ fi
|
|
|
38a2c0 |
+done
|
|
|
38a2c0 |
+
|
|
|
38a2c0 |
+# Make sure /etc/kernel/cmdline contains init_on_alloc=1
|
|
|
38a2c0 |
+if ! grep -qs '^(.*\s)?init_on_alloc=1(\s.*)?$' /etc/kernel/cmdline ; then
|
|
|
38a2c0 |
+ echo "init_on_alloc=1" >> /etc/kernel/cmdline
|
|
|
38a2c0 |
+fi
|
|
|
38a2c0 |
diff --git a/linux_os/guide/system/bootloader-zipl/zipl_init_on_alloc_argument/tests/missing_in_cmdline.fail.sh b/linux_os/guide/system/bootloader-zipl/zipl_init_on_alloc_argument/tests/missing_in_cmdline.fail.sh
|
|
|
38a2c0 |
new file mode 100644
|
|
|
38a2c0 |
index 00000000000..7c0d9154776
|
|
|
38a2c0 |
--- /dev/null
|
|
|
38a2c0 |
+++ b/linux_os/guide/system/bootloader-zipl/zipl_init_on_alloc_argument/tests/missing_in_cmdline.fail.sh
|
|
|
38a2c0 |
@@ -0,0 +1,13 @@
|
|
|
38a2c0 |
+#!/bin/bash
|
|
|
38a2c0 |
+# platform = multi_platform_fedora,Red Hat Enterprise Linux 8, Red Hat Enterprise Linux 9
|
|
|
38a2c0 |
+
|
|
|
38a2c0 |
+# Make sure boot loader entries contain init_on_alloc=1
|
|
|
38a2c0 |
+for file in /boot/loader/entries/*.conf
|
|
|
38a2c0 |
+do
|
|
|
38a2c0 |
+ if ! grep -q '^options.*init_on_alloc=1.*$' "$file" ; then
|
|
|
38a2c0 |
+ sed -i '/^options / s/$/ init_on_alloc=1/' "$file"
|
|
|
38a2c0 |
+ fi
|
|
|
38a2c0 |
+done
|
|
|
38a2c0 |
+
|
|
|
38a2c0 |
+# Make sure /etc/kernel/cmdline doesn't contain init_on_alloc=1
|
|
|
38a2c0 |
+sed -Ei 's/(^.*)init_on_alloc=1(.*?)$/\1\2/' /etc/kernel/cmdline || true
|
|
|
38a2c0 |
diff --git a/linux_os/guide/system/bootloader-zipl/zipl_init_on_alloc_argument/tests/missing_in_entry.fail.sh b/linux_os/guide/system/bootloader-zipl/zipl_init_on_alloc_argument/tests/missing_in_entry.fail.sh
|
|
|
38a2c0 |
new file mode 100644
|
|
|
38a2c0 |
index 00000000000..9d330c9192d
|
|
|
38a2c0 |
--- /dev/null
|
|
|
38a2c0 |
+++ b/linux_os/guide/system/bootloader-zipl/zipl_init_on_alloc_argument/tests/missing_in_entry.fail.sh
|
|
|
38a2c0 |
@@ -0,0 +1,13 @@
|
|
|
38a2c0 |
+#!/bin/bash
|
|
|
38a2c0 |
+# platform = multi_platform_fedora,Red Hat Enterprise Linux 8, Red Hat Enterprise Linux 9
|
|
|
38a2c0 |
+
|
|
|
38a2c0 |
+# Remove init_on_alloc=1 from all boot entries
|
|
|
38a2c0 |
+sed -Ei 's/(^options.*\s)init_on_alloc=1(.*?)$/\1\2/' /boot/loader/entries/*
|
|
|
38a2c0 |
+# But make sure one boot loader entry contains init_on_alloc=1
|
|
|
38a2c0 |
+sed -i '/^options / s/$/ init_on_alloc=1/' /boot/loader/entries/*rescue.conf
|
|
|
38a2c0 |
+sed -Ei 's/(^options.*\s)\$kernelopts(.*?)$/\1\2/' /boot/loader/entries/*rescue.conf
|
|
|
38a2c0 |
+
|
|
|
38a2c0 |
+# Make sure /etc/kernel/cmdline contains init_on_alloc=1
|
|
|
38a2c0 |
+if ! grep -qs '^(.*\s)?init_on_alloc=1(\s.*)?$' /etc/kernel/cmdline ; then
|
|
|
38a2c0 |
+ echo "init_on_alloc=1" >> /etc/kernel/cmdline
|
|
|
38a2c0 |
+fi
|
|
|
38a2c0 |
diff --git a/shared/references/cce-redhat-avail.txt b/shared/references/cce-redhat-avail.txt
|
|
|
38a2c0 |
index 6835189cd99..05a641aeaf0 100644
|
|
|
38a2c0 |
--- a/shared/references/cce-redhat-avail.txt
|
|
|
38a2c0 |
+++ b/shared/references/cce-redhat-avail.txt
|
|
|
38a2c0 |
@@ -1,4 +1,3 @@
|
|
|
38a2c0 |
-CCE-85868-8
|
|
|
38a2c0 |
CCE-85872-0
|
|
|
38a2c0 |
CCE-85873-8
|
|
|
38a2c0 |
CCE-85874-6
|
|
|
38a2c0 |
|
|
|
38a2c0 |
From 9ca5ec04e734941b1c401369b6da6672b42824b1 Mon Sep 17 00:00:00 2001
|
|
|
38a2c0 |
From: Vojtech Polasek <vpolasek@redhat.com>
|
|
|
38a2c0 |
Date: Mon, 24 Jan 2022 10:07:24 +0100
|
|
|
38a2c0 |
Subject: [PATCH 6/7] add new rules to rhel9 ospp
|
|
|
38a2c0 |
|
|
|
38a2c0 |
---
|
|
|
38a2c0 |
products/rhel9/profiles/ospp.profile | 2 ++
|
|
|
38a2c0 |
1 file changed, 2 insertions(+)
|
|
|
38a2c0 |
|
|
|
38a2c0 |
diff --git a/products/rhel9/profiles/ospp.profile b/products/rhel9/profiles/ospp.profile
|
|
|
38a2c0 |
index 7e30054bc98..28c7e92d298 100644
|
|
|
38a2c0 |
--- a/products/rhel9/profiles/ospp.profile
|
|
|
38a2c0 |
+++ b/products/rhel9/profiles/ospp.profile
|
|
|
38a2c0 |
@@ -126,6 +126,7 @@ selections:
|
|
|
38a2c0 |
- grub2_audit_argument
|
|
|
38a2c0 |
- grub2_audit_backlog_limit_argument
|
|
|
38a2c0 |
- grub2_vsyscall_argument
|
|
|
38a2c0 |
+ - grub2_init_on_alloc_argument
|
|
|
38a2c0 |
|
|
|
38a2c0 |
## Security Settings
|
|
|
38a2c0 |
- sysctl_kernel_kptr_restrict
|
|
|
38a2c0 |
@@ -413,3 +414,4 @@ selections:
|
|
|
38a2c0 |
- zipl_audit_argument
|
|
|
38a2c0 |
- zipl_audit_backlog_limit_argument
|
|
|
38a2c0 |
- zipl_vsyscall_argument
|
|
|
38a2c0 |
+ - zipl_init_on_alloc_argument
|
|
|
38a2c0 |
|
|
|
38a2c0 |
From 42a118bcc615051ae4cd268a5fc758aa5d75108d Mon Sep 17 00:00:00 2001
|
|
|
38a2c0 |
From: Vojtech Polasek <vpolasek@redhat.com>
|
|
|
38a2c0 |
Date: Thu, 27 Jan 2022 14:08:20 +0100
|
|
|
38a2c0 |
Subject: [PATCH 7/7] make rule names consistent
|
|
|
38a2c0 |
|
|
|
38a2c0 |
---
|
|
|
38a2c0 |
.../bootloader-grub2/grub2_init_on_alloc_argument/rule.yml | 2 +-
|
|
|
38a2c0 |
.../system/bootloader-zipl/zipl_init_on_alloc_argument/rule.yml | 2 +-
|
|
|
38a2c0 |
2 files changed, 2 insertions(+), 2 deletions(-)
|
|
|
38a2c0 |
|
|
|
38a2c0 |
diff --git a/linux_os/guide/system/bootloader-grub2/grub2_init_on_alloc_argument/rule.yml b/linux_os/guide/system/bootloader-grub2/grub2_init_on_alloc_argument/rule.yml
|
|
|
38a2c0 |
index 592e2fb117d..a9253c74cc6 100644
|
|
|
38a2c0 |
--- a/linux_os/guide/system/bootloader-grub2/grub2_init_on_alloc_argument/rule.yml
|
|
|
38a2c0 |
+++ b/linux_os/guide/system/bootloader-grub2/grub2_init_on_alloc_argument/rule.yml
|
|
|
38a2c0 |
@@ -2,7 +2,7 @@ documentation_complete: true
|
|
|
38a2c0 |
|
|
|
38a2c0 |
prodtype: rhel9
|
|
|
38a2c0 |
|
|
|
38a2c0 |
-title: 'Configure kernel to zero out memory before allocation (through Grub2)'
|
|
|
38a2c0 |
+title: 'Configure kernel to zero out memory before allocation'
|
|
|
38a2c0 |
|
|
|
38a2c0 |
description: |-
|
|
|
38a2c0 |
To configure the kernel to zero out memory before allocating it, add the
|
|
|
38a2c0 |
diff --git a/linux_os/guide/system/bootloader-zipl/zipl_init_on_alloc_argument/rule.yml b/linux_os/guide/system/bootloader-zipl/zipl_init_on_alloc_argument/rule.yml
|
|
|
38a2c0 |
index b47a7757327..fa272250a28 100644
|
|
|
38a2c0 |
--- a/linux_os/guide/system/bootloader-zipl/zipl_init_on_alloc_argument/rule.yml
|
|
|
38a2c0 |
+++ b/linux_os/guide/system/bootloader-zipl/zipl_init_on_alloc_argument/rule.yml
|
|
|
38a2c0 |
@@ -2,7 +2,7 @@ documentation_complete: true
|
|
|
38a2c0 |
|
|
|
38a2c0 |
prodtype: rhel9
|
|
|
38a2c0 |
|
|
|
38a2c0 |
-title: 'Configure kernel to zero out memory before allocation (through zIPl)'
|
|
|
38a2c0 |
+title: 'Configure kernel to zero out memory before allocation in zIPL'
|
|
|
38a2c0 |
|
|
|
38a2c0 |
description: |-
|
|
|
38a2c0 |
To ensure that the kernel is configured to zero out memory before
|