Skip to contentSkip to conversation

sysfs/cpu: Add vulnerability folder

PATCH Alexey Dobriyan 4 participants 7 messages Jan 7, 2018 – Jan 8, 2018

lore
Share & tools
lore
#0 lore raw
Quoted 2 lines · Thomas Gleixner

Create /sys/devices/system/cpu/vulnerabilities folder and files for meltdown, spectre_v1 and spectre_v2.

It is called "grep -e '^bugs' /proc/cpuinfo".

kpti is deduceable from .config and /proc/cmdline .
If people don't know what .config they are running, god bless them.

#1 lore raw
Quoted 8 lines · Alexey Dobriyan
Quoted 2 lines · Thomas Gleixner

Create /sys/devices/system/cpu/vulnerabilities folder and files for meltdown, spectre_v1 and spectre_v2.

It is called "grep -e '^bugs' /proc/cpuinfo".

kpti is deduceable from .config and /proc/cmdline .
If people don't know what .config they are running, god bless them.

It is not just for meltdown (kpti). You also have retpoline and IBRS which is for spectre.

#2 lore raw
Quoted 5 lines · Konrad Rzeszutek Wilk
Quoted 4 lines · Alexey Dobriyan
Quoted 2 lines · Thomas Gleixner

Create /sys/devices/system/cpu/vulnerabilities folder and files for meltdown, spectre_v1 and spectre_v2.

Quoted 7 lines
Quoted 4 lines

It is called "grep -e '^bugs' /proc/cpuinfo".

kpti is deduceable from .config and /proc/cmdline .
If people don't know what .config they are running, god bless them.

It is not just for meltdown (kpti). You also have retpoline and IBRS which is for spectre.

If you, as kernel developer, are sure that bug is properly mitigated to the best of your knowledge then clear the bit from the bug mask.

#3 lore raw
Quoted 8 lines · Alexey Dobriyan
Quoted 7 lines · Konrad Rzeszutek Wilk
Quoted 6 lines · Alexey Dobriyan
Quoted 2 lines · Thomas Gleixner

Create /sys/devices/system/cpu/vulnerabilities folder and files for meltdown, spectre_v1 and spectre_v2.

It is called "grep -e '^bugs' /proc/cpuinfo".

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

kpti is deduceable from .config and /proc/cmdline .
If people don't know what .config they are running, god bless them.

It is not just for meltdown (kpti). You also have retpoline and IBRS which is for spectre.

If you, as kernel developer, are sure that bug is properly mitigated to the best of your knowledge then clear the bit from the bug mask.

Nope. The CPU is still buggy and does not become less so because we set a mitigation into effect.

Thanks,

tglx

#4 lore raw
Quoted 12 lines · Thomas Gleixner
Quoted 11 lines · Alexey Dobriyan
Quoted 10 lines · Konrad Rzeszutek Wilk
Quoted 8 lines · Alexey Dobriyan
Quoted 2 lines · Thomas Gleixner

Create /sys/devices/system/cpu/vulnerabilities folder and files for meltdown, spectre_v1 and spectre_v2.

It is called "grep -e '^bugs' /proc/cpuinfo".

kpti is deduceable from .config and /proc/cmdline .
If people don't know what .config they are running, god bless them.

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

It is not just for meltdown (kpti). You also have retpoline and IBRS which is for spectre.

If you, as kernel developer, are sure that bug is properly mitigated to the best of your knowledge then clear the bit from the bug mask.

Nope. The CPU is still buggy and does not become less so because we set a mitigation into effect.

There no reason why these files should exist, both technical and non-technical.

1) /proc/cpuinfo bugs section is time honored, this is where F00F and FDIV lived.

2) marketing monikers are used, they are for hype, leave them to journalists. I read both papers and bugs are cool but I have no clue which name is which bug (and which variant!) because they are very meaningless by themselves.

3) You're placing kernel on the hook for explaining users who is vulnerable. But kernel is not vulnerable! CPU vendors should put a page and distros refer to those pages. Then it is business as usual: write an advisory, give instructions how to enable KPTI, give instructions how to get new microcode and verify by checking for new flags in /proc/cpuinfo, give instructions for using new compiler flags.

4) defaults
default is "Not affected" which is easily incorrect as nobody knows what CPU manufacturers are doing.

Might as well say "Contact your CPU vendor for more information". At this point file becomes meaningless.

5) it is not clear what the fuss is all about
There is no file which lists every mitigation (LIST_POISON, refcounting, SLAB randomization, ASLR/KASLR etc), there is no reason to start now.

This is becoming WSJ-driven development (in wide sense of the word).

#5 lore raw
In reply to Alexey Dobriyan
Quoted 8 lines · On Mon, 8 Jan 2018 08:35:14 +0300 Alexey Dobriyan <[email protected]> wrote:
Quoted 7 lines · Konrad Rzeszutek Wilk
Quoted 6 lines · Alexey Dobriyan
Quoted 2 lines · Thomas Gleixner

Create /sys/devices/system/cpu/vulnerabilities folder and files for meltdown, spectre_v1 and spectre_v2.

It is called "grep -e '^bugs' /proc/cpuinfo".

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

kpti is deduceable from .config and /proc/cmdline .
If people don't know what .config they are running, god bless them.

It is not just for meltdown (kpti). You also have retpoline and IBRS which is for spectre.

If you, as kernel developer, are sure that bug is properly mitigated to the best of your knowledge then clear the bit from the bug mask.

It's probably useful to have the mitigation status somewhere because that is what most people will care about. Both pieces of information are needed though.

Alan

#6 lore raw
Quoted 17 lines · Alan Cox
Quoted 14 lines · On Mon, 8 Jan 2018 08:35:14 +0300 Alexey Dobriyan <[email protected]> wrote:
Quoted 12 lines · Konrad Rzeszutek Wilk
Quoted 8 lines · Alexey Dobriyan
Quoted 2 lines · Thomas Gleixner

Create /sys/devices/system/cpu/vulnerabilities folder and files for meltdown, spectre_v1 and spectre_v2.

It is called "grep -e '^bugs' /proc/cpuinfo".

kpti is deduceable from .config and /proc/cmdline .
If people don't know what .config they are running, god bless them.

It is not just for meltdown (kpti). You also have retpoline and IBRS which is for spectre.

Quoted 6 lines
Quoted 2 lines

If you, as kernel developer, are sure that bug is properly mitigated to the best of your knowledge then clear the bit from the bug mask.

It's probably useful to have the mitigation status somewhere because that is what most people will care about. Both pieces of information are needed though.

Then proper way for mainline is Documentation/.

Kernel doesn't announce many things such as ASLR, it simply enables it by default.

Real checks are done by disassembly and verifying that generated code does what's necessary anyway. But dumbed down version doesn't need runtime file in sysfs, internet page somewhere (kernel.org gitweb interface) should be enough.