File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -969,6 +969,27 @@ check_swap () {
969969 say_warn " WARNING: SWAP enabled"
970970}
971971
972+ check_SSBD () {
973+ arch=$( uname -m)
974+ if [ " $arch " = " aarch64" ]; then
975+ local param=" ssbd=force-on"
976+ elif [ " $arch " = " x86_64" ]; then
977+ local param=" spec_store_bypass_disable=on"
978+ fi
979+
980+ ssbd_sysfs_file=" /sys/devices/system/cpu/vulnerabilities/spec_store_bypass"
981+
982+ if [ -f " $ssbd_sysfs_file " ]; then
983+ (grep -q " ^Vulnerable" $ssbd_sysfs_file ) && \
984+ say_warn " WARNING: SSBD mitigation is either globally disabled or" \
985+ " system does not support mitigation via prctl or seccomp. Try" \
986+ " enabling it system-wide, using the \` ${param} \` boot parameter."
987+ else
988+ say_warn " WARNING: SSBD mitigation not supported on this kernel." \
989+ " View the prod-host-setup.md for more details."
990+ fi
991+ }
992+
972993check_vm () {
973994 if [ $( dmesg | grep -c -i " hypervisor detected" ) -gt 0 ]; then
974995 say_warn " WARNING: you are running in a virtual machine." \
@@ -1001,6 +1022,7 @@ cmd_checkenv() {
10011022 check_L1TF
10021023 check_SMT
10031024 check_swap
1025+ check_SSBD
10041026}
10051027
10061028main () {
You can’t perform that action at this time.
0 commit comments