Faille microprocesseurs et patch Linux

Manifestement les choses bougent, ce matin pour Jessie :

Les NOUVEAUX paquets suivants seront installés :
  linux-headers-3.16.0-5-amd64 linux-headers-3.16.0-5-common
  linux-image-3.16.0-5-amd64
Les paquets suivants seront mis à jour :
  linux-compiler-gcc-4.8-x86 linux-headers-amd64 linux-image-amd64
  linux-libc-dev skypeforlinux

Pour Meltdown les patches sont semble-t-il distribués, pour Spectre cela semble plus compliqué.
https://www.digitalocean.com/community/tutorials/how-to-protect-your-server-against-the-meltdown-and-spectre-vulnerabilities`

Ces failles concernent essentiellement les serveurs, pas les ordis individuels si leurs utilisateurs sont prudents.

d’après cette page : https://cert.ssi.gouv.fr/alerte/CERTFR-2018-ALE-001/

Linux

Afin de s’assurer de la présence du mécanisme de sécurité KPTI sur un système utilisant un noyau Linux il est possible d’exécuter la commande suivante :

dmesg | grep ‘Kernel/User page tables isolation’

ca marche chez vous ? Je suis en cours de màj . Avant la maj ça ne donnait rien

ok chez moi

root@debian:/# dmesg | grep 'Kernel/User page tables isolation'
[    0.000000] Kernel/User page tables isolation: disabled
root@debian:/# grep name /proc/cpuinfo
model name	: AMD Athlon(tm) II P340 Dual-Core Processor
model name	: AMD Athlon(tm) II P340 Dual-Core Processor
root@debian:/# uname --all
Linux debian 4.9.0-5-amd64 #1 SMP Debian 4.9.65-3+deb9u2 (2018-01-04) x86_64 GNU/Linux
root@debian:/# 

https://cert.ssi.gouv.fr/alerte/CERTFR-2018-ALE-001/
dit
Processeurs AMD
AMD est vulnérable à Spectre, mais pas à Meltdown.

Après mise à jour :

jacques@jacques-t430:~$ dmesg | grep 'Kernel/User page tables isolation'
[    0.000000] Kernel/User page tables isolation: enabled

version (Jessie) :

jacques@jacques-t430:~$ uname -a
Linux jacques-t430 3.16.0-5-amd64 #1 SMP Debian 3.16.51-3+deb8u1 (2018-01-08) x86_64 GNU/Linux

chez moi, après maj et reboot :

dmesg | grep 'Kernel/User page tables isolation'
[    0.000000] Kernel/User page tables isolation: enabled
uname -a
Linux ICI 4.9.0-5-amd64 #1 SMP Debian 4.9.65-3+deb9u2 (2018-01-04) x86_64 GNU/Linux

Salut
Il existe un script de test
https://packages.debian.org/sid/main/spectre-meltdown-checker

root@debian:/# /usr/bin/spectre-meltdown-checker
Spectre and Meltdown mitigation detection tool v0.29

Checking for vulnerabilities against running kernel Linux 4.9.0-5-amd64 #1 SMP Debian 4.9.65-3+deb9u2 (2018-01-04) x86_64
CPU is AMD Athlon(tm) II P340 Dual-Core Processor

CVE-2017-5753 [bounds check bypass] aka 'Spectre Variant 1'
* Checking count of LFENCE opcodes in kernel:  NO 
> STATUS:  VULNERABLE  (only 25 opcodes found, should be >= 70, heuristic to be improved when official patches become available)

CVE-2017-5715 [branch target injection] aka 'Spectre Variant 2'
* Mitigation 1
*   Hardware (CPU microcode) support for mitigation:  NO 
*   Kernel support for IBRS:  NO 
*   IBRS enabled for Kernel space:  NO 
*   IBRS enabled for User space:  NO 
* Mitigation 2
*   Kernel compiled with retpoline option:  NO 
*   Kernel compiled with a retpoline-aware compiler:  NO 
> STATUS:  VULNERABLE  (IBRS hardware + kernel support OR kernel with retpoline are needed to mitigate the vulnerability)

CVE-2017-5754 [rogue data cache load] aka 'Meltdown' aka 'Variant 3'
* Kernel supports Page Table Isolation (PTI):  YES 
* PTI enabled and active:  NO 
> STATUS:  NOT VULNERABLE  (your CPU vendor reported your CPU model as not vulnerable)

A false sense of security is worse than no security at all, see --disclaimer
root@debian:/# 
```

Confirme que mon AMD Athlon(tm) II P340 Dual-Core Processo est vulnérable à Spectre et immunisé contre Meltdown

Bon, apparemment, AMD est passé aux aveux : http://www.comptoir-hardware.com/actus/processeurs/35576-amd-clarifie-enfin-sa-situation-vis-a-vis-de-spectre-et-meltdown.html

pour les utilisateurs de chromium

chrome://flags/

ctrl + f et rechercher la chaine “Strict site isolation” sur la page

Activer

Source https://blog.linuxmint.com/?p=3496

Attention, bobo la tête, le remède est pire que le mal

Si vous avez un processeur Intel regardez y a deux fois
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=886998
And the version to pick when downgrading is 20171117

1 J'aime

Mon laptop (thinkpad x200 avec un Core 2 Duo P8-quelque-chose) est sur le kernel 4.9.0-5, je n’ai pas (encore) rencontré de gros problèmes particuliers.
Le temps de démarrage de la session graphique est certes beaucoup plus long que sur les noyaux antérieurs (à l’occasion je ferai des comparatifs de systemd-analyze) mais je n’ai pas eu de reboot intempestif ni d’autre “comportement imprévisible”, ou alors j’ai rien vu. C’est ça d’avoir du vieux matos :sunglasses:

Et vous ?

Comme indiqué plus haut

j’ai fait une mise à jour de sécurité et n’ai pas noté de problème particulier.
Thinkpad T430 de quelques années, proc i5.
Ce qui est relativement tordu dans ces affaires est qu’un processus utilisateur puisse accéder sans difficulté à des paramètres hardware profonds du processeur comme le nombre de cycles d’horloge mis pour exécuter une instruction. J’ai vérifié, c’est très simple d’avoir accès à ce fameux compteur de cycles (https://en.wikipedia.org/wiki/Time_Stamp_Counter) avec une ligne d’assembleur incluse dans un programme C, par exemple.

faut pas confondre le palliatif dans le noyau et les patchs Intel qui sont dans leur microcode
De plus il faut etre certain du modèle de cpu.

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=886998

apt list intel-microcode -a

la version a été downgradée pour revenir en arrière sur les patchs Intel
intel-microcode/testing 3.20180108.1+really20171117.1

Qu’Intel libère son microcode :slight_smile: !

Finalement une question naïve : je constate que le paquet intel-microcode n’est pas installé sur mon PC (portable à usage strictement perso). Que vaut-il mieux faire : installer le paquet de patches ou en rester là ?

Comme Debian fait bien le boulot la version des patchs Intel a été rétrogradée dans testing et n’a pas changée dans stable mais c’est vraiment la crise … de rire

Tu peux vérifier si un patch concerne ton processeur avant d’installer le paquet

version stable
http://metadata.ftp-master.debian.org/changelogs/non-free/i/intel-microcode/intel-microcode_3.20170707.1~deb9u1_changelog

version testing
http://metadata.ftp-master.debian.org/changelogs/non-free/i/intel-microcode/intel-microcode_3.20180108.1+really20171117.1_changelog

je vois la version en cours dans /sys/devices/system/cpu/cpu0/microcode/version

Aujourd’hui nouvelle version de l’outil de test

spectre-meltdown-checker 
Spectre and Meltdown mitigation detection tool v0.36

Checking for vulnerabilities on current system
Kernel is Linux 4.9.0-6-amd64 #1 SMP Debian 4.9.82-1+deb9u3 (2018-03-02) x86_64
CPU is AMD Athlon(tm) II P340 Dual-Core Processor

Hardware check
* Hardware support (CPU microcode) for mitigation techniques
  * Indirect Branch Restricted Speculation (IBRS)
    * SPEC_CTRL MSR is available:  NO 
    * CPU indicates IBRS capability:  NO 
  * Indirect Branch Prediction Barrier (IBPB)
    * PRED_CMD MSR is available:  NO 
    * CPU indicates IBPB capability:  NO 
  * Single Thread Indirect Branch Predictors (STIBP)
    * SPEC_CTRL MSR is available:  NO 
    * CPU indicates STIBP capability:  NO 
  * Enhanced IBRS (IBRS_ALL)
    * CPU indicates ARCH_CAPABILITIES MSR availability:  NO 
    * ARCH_CAPABILITIES MSR advertises IBRS_ALL capability:  NO 
  * CPU explicitly indicates not being vulnerable to Meltdown (RDCL_NO):  NO 
  * CPU microcode is known to cause stability problems:  NO 
* CPU vulnerability to the three speculative execution attack variants
  * Vulnerable to Variant 1:  YES 
  * Vulnerable to Variant 2:  YES 
  * Vulnerable to Variant 3:  NO 

CVE-2017-5753 [bounds check bypass] aka 'Spectre Variant 1'
* Mitigated according to the /sys interface:  YES  (kernel confirms that the mitigation is active)
* Kernel has array_index_mask_nospec:  YES  (1 occurence(s) found of 64 bits array_index_mask_nospec())
* Kernel has the Red Hat/Ubuntu patch:  NO 
> STATUS:  NOT VULNERABLE  (Mitigation: __user pointer sanitization)

CVE-2017-5715 [branch target injection] aka 'Spectre Variant 2'
* Mitigated according to the /sys interface:  YES  (kernel confirms that the mitigation is active)
* Mitigation 1
  * Kernel is compiled with IBRS/IBPB support:  NO 
  * Currently enabled features
    * IBRS enabled for Kernel space:  NO 
    * IBRS enabled for User space:  NO 
    * IBPB enabled:  NO 
* Mitigation 2
  * Kernel compiled with retpoline option:  YES 
  * Kernel compiled with a retpoline-aware compiler:  YES  (kernel reports full retpoline compilation)
> STATUS:  NOT VULNERABLE  (Mitigation: Full AMD retpoline)

CVE-2017-5754 [rogue data cache load] aka 'Meltdown' aka 'Variant 3'
* Mitigated according to the /sys interface:  YES  (kernel confirms that your CPU is unaffected)
* Kernel supports Page Table Isolation (PTI):  YES 
* PTI enabled and active:  NO 
* Running as a Xen PV DomU:  NO 
> STATUS:  NOT VULNERABLE  (your CPU vendor reported your CPU model as not vulnerable)

A false sense of security is worse than no security at all, see --disclaimer

_> STATUS: NOT VULNERABLE (Mitigation: _user pointer sanitization)
> STATUS: NOT VULNERABLE (Mitigation: Full AMD retpoline)
> STATUS: NOT VULNERABLE (your CPU vendor reported your CPU model as not vulnerable)

Tout va bien

Y a quelque chose que je ne pige pas

le script décrit d’abord le matériel pour lequel AMD indique ne pas être concerné par la faille

Puis le script décrit le statut, faille par faille et confirme que le matériel n’est pas concerné pour cette faille

Je ne vois pas où est l’ambiguité.

Faut pas chercher, ça vient de moi :slight_smile:

l’outil de test en est à variante 4

root@debian:~# spectre-meltdown-checker 
Spectre and Meltdown mitigation detection tool v0.38

Checking for vulnerabilities on current system
Kernel is Linux 4.9.0-7-amd64 #1 SMP Debian 4.9.110-3+deb9u2 (2018-08-13) x86_64
CPU is AMD Athlon(tm) II P340 Dual-Core Processor

Hardware check
* Hardware support (CPU microcode) for mitigation techniques
  * Indirect Branch Restricted Speculation (IBRS)
    * SPEC_CTRL MSR is available:  NO 
    * CPU indicates IBRS capability:  NO 
    * CPU indicates preferring IBRS always-on:  NO 
    * CPU indicates preferring IBRS over retpoline:  NO 
  * Indirect Branch Prediction Barrier (IBPB)
    * PRED_CMD MSR is available:  NO 
    * CPU indicates IBPB capability:  NO 
  * Single Thread Indirect Branch Predictors (STIBP)
    * SPEC_CTRL MSR is available:  NO 
    * CPU indicates STIBP capability:  NO 
    * CPU indicates preferring STIBP always-on:  NO 
  * Speculative Store Bypass Disable (SSBD)
    * CPU indicates SSBD capability:  NO 
  * CPU explicitly indicates not being vulnerable to Variant 4 (SSB_NO):  NO 
  * CPU microcode is known to cause stability problems:  NO  (model 0x6 family 0x10 stepping 0x3 ucode 0x10000c8 cpuid 0x100f63)
* CPU vulnerability to the speculative execution attack variants
  * Vulnerable to Variant 1:  YES 
  * Vulnerable to Variant 2:  YES 
  * Vulnerable to Variant 3:  NO 
  * Vulnerable to Variant 3a:  NO 
  * Vulnerable to Variant 4:  NO 

CVE-2017-5753 [bounds check bypass] aka 'Spectre Variant 1'
* Mitigated according to the /sys interface:  YES  (Mitigation: __user pointer sanitization)
* Kernel has array_index_mask_nospec:  YES  (1 occurrence(s) found of x86 64 bits array_index_mask_nospec())
* Kernel has the Red Hat/Ubuntu patch:  NO 
* Kernel has mask_nospec64 (arm64):  NO 
> STATUS:  NOT VULNERABLE  (Mitigation: __user pointer sanitization)

CVE-2017-5715 [branch target injection] aka 'Spectre Variant 2'
* Mitigated according to the /sys interface:  YES  (Mitigation: Full AMD retpoline)
* Mitigation 1
  * Kernel is compiled with IBRS support:  YES 
    * IBRS enabled and active:  NO 
  * Kernel is compiled with IBPB support:  YES 
    * IBPB enabled and active:  NO 
* Mitigation 2
  * Kernel has branch predictor hardening (arm):  NO 
  * Kernel compiled with retpoline option:  YES 
    * Kernel compiled with a retpoline-aware compiler:  YES  (kernel reports full retpoline compilation)
> STATUS:  NOT VULNERABLE  (Full retpoline is mitigating the vulnerability)
IBPB is considered as a good addition to retpoline for Variant 2 mitigation, but your CPU microcode doesn''t support it

CVE-2017-5754 [rogue data cache load] aka 'Meltdown' aka 'Variant 3'
* Mitigated according to the /sys interface:  YES  (Not affected)
* Kernel supports Page Table Isolation (PTI):  YES 
  * PTI enabled and active:  NO 
  * Reduced performance impact of PTI:  NO  (PCID/INVPCID not supported, performance impact of PTI will be significant)
* Running as a Xen PV DomU:  NO 
> STATUS:  NOT VULNERABLE  (your CPU vendor reported your CPU model as not vulnerable)

CVE-2018-3640 [rogue system register read] aka 'Variant 3a'
* CPU microcode mitigates the vulnerability:  NO 
> STATUS:  NOT VULNERABLE  (your CPU vendor reported your CPU model as not vulnerable)

CVE-2018-3639 [speculative store bypass] aka 'Variant 4'
* Mitigated according to the /sys interface:  YES  (Not affected)
* Kernel supports speculation store bypass:  YES  (found in /proc/self/status)
> STATUS:  NOT VULNERABLE  (your CPU vendor reported your CPU model as not vulnerable)

Need more detailed information about mitigation options? Use --explain
A false sense of security is worse than no security at all, see --disclaimer
root@debian:~# 
1 J'aime