mirror of
https://github.com/speed47/spectre-meltdown-checker.git
synced 2026-09-11 05:13:56 +02:00
fix: another attempt to avoid sigpipe on grep (#519)
Take this opportunity to factorize all the greps in /proc/cpuinfo
into a helper that avoids using a pipe to entirely avoid SIGPIPE
on a possibly gigantic /proc/cpuinfo
(cherry picked from commit 5bbffaf053)
This commit is contained in:
@@ -89,7 +89,7 @@ check_CVE_2018_3646_linux() {
|
||||
|
||||
pr_info "* Mitigation 2"
|
||||
pr_info_nol " * L1D flush is supported by kernel: "
|
||||
if [ "$g_mode" = live ] && grep -qw flush_l1d "$g_procfs/cpuinfo"; then
|
||||
if [ "$g_mode" = live ] && cpuinfo_has_flag flush_l1d; then
|
||||
l1d_kernel="found flush_l1d in $g_procfs/cpuinfo"
|
||||
fi
|
||||
if [ -z "$l1d_kernel" ]; then
|
||||
@@ -162,7 +162,7 @@ check_CVE_2018_3646_linux() {
|
||||
|
||||
pr_info_nol " * Hardware-backed L1D flush supported: "
|
||||
if [ "$g_mode" = live ]; then
|
||||
if grep -qw flush_l1d "$g_procfs/cpuinfo" || [ -n "$l1d_xen_hardware" ]; then
|
||||
if cpuinfo_has_flag flush_l1d || [ -n "$l1d_xen_hardware" ]; then
|
||||
pstatus green YES "performance impact of the mitigation will be greatly reduced"
|
||||
else
|
||||
pstatus blue NO "flush will be done in software, this is slower"
|
||||
|
||||
Reference in New Issue
Block a user