Skip to content

False positive for CVE-2017-5715 due to failing to detect retpolines #420

@wizeman

Description

@wizeman

When I updated my kernel from 5.15.27 -> 5.15.28, spectre-meltdown-checker started complaining that I was vulnerable to CVE-2017-5715 (Spectre Variant 2, branch target injection).

After doing a little investigation, this seems to be caused by the following line of code:

if echo "$fullmsg" | grep -qwi retpoline; then

This is trying to detect whether the /sys/devices/system/cpu/vulnerabilities/spectre_v2 file contains the word retpoline (case insensitively).

I think kernel 5.15.27 used to contain the text Mitigation: AMD retpoline, (...) (or something similar) but 5.15.28 switched to a generic retpoline implementation, so the file now contains Mitigation: Retpolines, (...).

Since the grep command in the above line of code contains the -w switch but the word is now plural (and therefore doesn't match anymore), spectre-meltdown-checker doesn't detect that the kernel is compiled with a retpoline-aware compiler and therefore considers my machine to be vulnerable to CVE-2017-5715.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions