From b42d8f2f276092a23549d333ac4a34b1b5846c0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Lesimple?= Date: Sun, 25 Mar 2018 12:53:50 +0200 Subject: [PATCH] fix(write_msr): use /dev/zero instead of manually echoing zeroes --- spectre-meltdown-checker.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spectre-meltdown-checker.sh b/spectre-meltdown-checker.sh index b13a228..c055990 100755 --- a/spectre-meltdown-checker.sh +++ b/spectre-meltdown-checker.sh @@ -1280,7 +1280,7 @@ write_msr() else # convert to decimal _msrindex=$(( $1 )) - _echo_nol -9 "\0\0\0\0\0\0\0\0" | dd of=/dev/cpu/"$2"/msr bs=8 count=1 seek="$_msrindex" oflag=seek_bytes 2>/dev/null; ret=$? + dd if=/dev/zero of=/dev/cpu/"$2"/msr bs=8 count=1 seek="$_msrindex" oflag=seek_bytes 2>/dev/null; ret=$? fi _debug "write_msr: for cpu $2 on msr $1 ($_msrindex), ret=$ret" return $ret