fix(retpoline): retpoline-compiler detection

When kernel is not compiled with retpoline option, doesn't
have the sysfs vulnerability hierarchy and our heuristic to
detect a retpoline-aware compiler didn't match, change result
for retpoline-aware compiler detection from UNKNOWN to NO.
When CONFIG_RETPOLINE is not set, a retpoline-aware compiler
won't produce different asm than a standard one anyway.
This commit is contained in:
Stéphane Lesimple 2018-01-22 10:48:48 +01:00
parent e7aa3b9d16
commit ddc7197b86
1 changed files with 5 additions and 5 deletions

View File

@ -1131,7 +1131,7 @@ check_variant2()
retpoline_compiler=1 retpoline_compiler=1
pstatus green YES "kernel reports full retpoline compilation" pstatus green YES "kernel reports full retpoline compilation"
else else
pstatus yellow UNKNOWN [ "$retpoline" = 1 ] && pstatus yellow UNKNOWN || pstatus red NO
fi fi
elif [ -n "$opt_map" ]; then elif [ -n "$opt_map" ]; then
# look for the symbol # look for the symbol
@ -1139,7 +1139,7 @@ check_variant2()
retpoline_compiler=1 retpoline_compiler=1
pstatus green YES "noretpoline_setup symbol found in System.map" pstatus green YES "noretpoline_setup symbol found in System.map"
else else
pstatus yellow UNKNOWN [ "$retpoline" = 1 ] && pstatus yellow UNKNOWN || pstatus red NO
fi fi
elif [ -n "$vmlinux" ]; then elif [ -n "$vmlinux" ]; then
# look for the symbol # look for the symbol
@ -1149,7 +1149,7 @@ check_variant2()
retpoline_compiler=1 retpoline_compiler=1
pstatus green YES "noretpoline_setup found in vmlinux symbols" pstatus green YES "noretpoline_setup found in vmlinux symbols"
else else
pstatus yellow UNKNOWN [ "$retpoline" = 1 ] && pstatus yellow UNKNOWN || pstatus red NO
fi fi
elif grep -q noretpoline_setup "$vmlinux"; then elif grep -q noretpoline_setup "$vmlinux"; then
# if we don't have nm, nevermind, the symbol name is long enough to not have # if we don't have nm, nevermind, the symbol name is long enough to not have
@ -1157,10 +1157,10 @@ check_variant2()
retpoline_compiler=1 retpoline_compiler=1
pstatus green YES "noretpoline_setup found in vmlinux" pstatus green YES "noretpoline_setup found in vmlinux"
else else
pstatus yellow UNKNOWN [ "$retpoline" = 1 ] && pstatus yellow UNKNOWN || pstatus red NO
fi fi
else else
pstatus yellow UNKNOWN "couldn't find your kernel image or System.map" [ "$retpoline" = 1 ] && pstatus yellow UNKNOWN "couldn't find your kernel image or System.map" || pstatus red NO
fi fi
_info_nol "* Retpoline enabled: " _info_nol "* Retpoline enabled: "