Для полного устранения уязвимости необходимо включить безусловную очистку L1D (CVE-2018-3646).

С findи однолинейным:

find. -mindepth 2 -type f -execdir sh -c 'mv -vt../ "$@" ; rmdir "$PWD"' _ {} +
  • -mindepth 2позволит команде findигнорировать файлы текущих каталогов.
  • -execdirэто важно здесь, и это заставляет findизменить текущий каталог на каталог, в котором найден файл, и команды внутри будут выполняться в самом этом каталоге.

  • mv -vt../ "$@", это расширится доmv -vt../ "file1" "file 2" "..." "fileN"

  • rmdir "$PWD"удалит каталог, в котором находится -execdir, который запустится после того, как все файлы будут перемещены в parentDirectory .

Будьте осторожны, вы не перезапишете файлы с тем же именем файла при переходе по пути назначения.

0
18.10.2019, 11:37
1 ответ

Я немного покопался, и эта уязвимость в документации упоминается как:

L1TF = отказ клеммы L1

На самом деле я нашел документацию по ядру напрямую , цитата:

l1tf=   [X86] Control mitigation of the L1TF vulnerability on
        affected CPUs

        The kernel PTE inversion protection is unconditionally
        enabled and cannot be disabled.

        full
            Provides all available mitigations for the
            L1TF vulnerability. Disables SMT and
            enables all mitigations in the
            hypervisors, i.e. unconditional L1D flush.

            SMT control and L1D flush control via the
            sysfs interface is still possible after
            boot.  Hypervisors will issue a warning
            when the first VM is started in a
            potentially insecure configuration,
            i.e. SMT enabled or L1D flush disabled.

        full,force
            Same as 'full', but disables SMT and L1D
            flush runtime control. Implies the
            'nosmt=force' command line option.
            (i.e. sysfs control of SMT is disabled.)

        flush
            Leaves SMT enabled and enables the default
            hypervisor mitigation, i.e. conditional
            L1D flush.

            SMT control and L1D flush control via the
            sysfs interface is still possible after
            boot.  Hypervisors will issue a warning
            when the first VM is started in a
            potentially insecure configuration,
            i.e. SMT enabled or L1D flush disabled.

        flush,nosmt

            Disables SMT and enables the default
            hypervisor mitigation.

            SMT control and L1D flush control via the
            sysfs interface is still possible after
            boot.  Hypervisors will issue a warning
            when the first VM is started in a
            potentially insecure configuration,
            i.e. SMT enabled or L1D flush disabled.

        flush,nowarn
            Same as 'flush', but hypervisors will not
            warn when a VM is started in a potentially
            insecure configuration.

        off
            Disables hypervisor mitigations and doesn't
            emit any warnings.
            It also drops the swap size and available
            RAM limit restriction on both hypervisor and
            bare metal.

        Default is 'flush'.

        For details see: Documentation/admin-guide/hw-vuln/l1tf.rst

Я попробовал некоторые из этих вариантов, в итоге выбрав full,force. Но это только мой личный выбор.


Как использовать

Если вы сейчас спрашиваете, как использовать (, что редактировать ), то ответ будет:

  1. Отредактируйте следующий файл в своем любимом текстовом редакторе:

    /etc/default/grub
    
  2. Добавьте одну из опций, например позвольте мне использовать l1tf=full,force, в эту строку:

    GRUB_CMDLINE_LINUX_DEFAULT="... l1tf=full,force"
    
  3. Обновите конфигурацию загрузчика с помощью:

    sudo update-grub
    
  4. Изменения вступают в силу после перезагрузки:

    reboot --reboot
    

Результат

Если вы решите продолжить тестирование этого решения, вы должны получить аналогичные результаты:

CVE-2018-3646 aka 'Foreshadow-NG (VMM), L1 terminal fault'
* Information from the /sys interface: Mitigation: PTE Inversion; VMX: cache flushes, SMT disabled
* This system is a host running a hypervisor:  YES  (paranoid mode)
* Mitigation 1 (KVM)
  * EPT is disabled:  NO 
* Mitigation 2
  * L1D flush is supported by kernel:  YES  (found flush_l1d in /proc/cpuinfo)
  * L1D flush enabled:  YES  (unconditional flushes)
  * Hardware-backed L1D flush supported:  YES  (performance impact of the mitigation will be greatly reduced)
  * Hyper-Threading (SMT) is enabled:  NO 
> STATUS:  NOT VULNERABLE  (L1D unconditional flushing and Hyper-Threading disabled are mitigating the vulnerability)

Изображение в формате UHD можно увеличить:

L1TF--mitigated


Стивен Китт заметки

Также стоит прочитать специальнуюдокументацию ядра L1TF -, в которой подробно описаны уязвимости и способы их устранения, а также объясняется, как включать и отключать средства устранения (, включая отключение SMT)во время выполнения. , без перезагрузки или изменения конфигурации системы.

3
28.01.2020, 02:29

Теги

Похожие вопросы