Having recently become aware of the latest vulnerability, SRBDS, I thought it was time to update the shell-script.
#!/bin/bash
echo -e "Kernel -- \c"
uname -r
if [ -d /sys/devices/system/cpu/vulnerabilities ]; then
if [ -r /sys/devices/system/cpu/vulnerabilities/itlb_multihit ]; then
echo -e "Itlb Multihit -- \c"
cat /sys/devices/system/cpu/vulnerabilities/itlb_multihit
fi
if [ -r /sys/devices/system/cpu/vulnerabilities/l1tf ]; then
echo -e "L1TF -- \c"
cat /sys/devices/system/cpu/vulnerabilities/l1tf
fi
if [ -r /sys/devices/system/cpu/vulnerabilities/mds ]; then
echo -e "MDS -- \c"
cat /sys/devices/system/cpu/vulnerabilities/mds
fi
if [ -r /sys/devices/system/cpu/vulnerabilities/meltdown ]; then
echo -e "Meltdown -- \c"
cat /sys/devices/system/cpu/vulnerabilities/meltdown
fi
if [ -r /sys/devices/system/cpu/vulnerabilities/spec_store_bypass ]; then
echo -e "Speculative Store Bypass -- \c"
cat /sys/devices/system/cpu/vulnerabilities/spec_store_bypass
fi
if [ -r /sys/devices/system/cpu/vulnerabilities/spectre_v1 ]; then
echo -e "Spectre v1 -- \c"
cat /sys/devices/system/cpu/vulnerabilities/spectre_v1
fi
if [ -r /sys/devices/system/cpu/vulnerabilities/spectre_v2 ]; then
echo -e "Spectre v2 -- \c"
cat /sys/devices/system/cpu/vulnerabilities/spectre_v2
fi
if [ -r /sys/devices/system/cpu/vulnerabilities/srbds ]; then
echo -e "Srbds -- \c"
cat /sys/devices/system/cpu/vulnerabilities/srbds
fi
if [ -r /sys/devices/system/cpu/vulnerabilities/tsx_async_abort ]; then
echo -e "TSX Async Abort -- \c"
cat /sys/devices/system/cpu/vulnerabilities/tsx_async_abort
fi
else
echo " -- No data available."
fi
exit 0