]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
UBUNTU: SAUCE: rfi-flush: Refactor the macros so the nops are defined once
authorMichael Ellerman <mpe@ellerman.id.au>
Sun, 7 Jan 2018 11:02:02 +0000 (22:02 +1100)
committerMarcelo Henrique Cerri <marcelo.cerri@canonical.com>
Thu, 11 Jan 2018 20:35:25 +0000 (18:35 -0200)
CVE-2017-5754

BugLink: http://bugs.launchpad.net/bugs/1742772
To avoid a bug like the previous commit ever happening again, put the
nops in a single place.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Marcelo Henrique Cerri <marcelo.cerri@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
arch/powerpc/include/asm/exception-64s.h

index dd4b299a7fb5b996536bac021eb53e4984abface..fc7103d8e835240d6cb1f22855bdb77463d85e27 100644 (file)
 #define EX_R3          EX_DAR
 
 /*
- * The nop instruction allows a secure memory protection instruction to be
- * inserted with the rfi flush fixup.
+ * The nop instructions allow us to insert one or more instructions to flush the
+ * L1-D cache when return to userspace or a guest.
  */
-#define PREPARE_RFI_TO_USER                                            \
-       RFI_FLUSH_FIXUP_SECTION;                                        \
-       nop;                                                            \
-       nop;                                                            \
-       nop
-
-#define PREPARE_RFI_TO_GUEST                                           \
+#define RFI_FLUSH_SLOT                                                 \
        RFI_FLUSH_FIXUP_SECTION;                                        \
        nop;                                                            \
        nop;                                                            \
 
 #define RFI_TO_USER                                                    \
        CHECK_TARGET_MSR_PR(SPRN_SRR1, 1);                              \
-       PREPARE_RFI_TO_USER;                                            \
+       RFI_FLUSH_SLOT;                                                 \
        rfid;                                                           \
        b       rfi_flush_fallback
 
 #define RFI_TO_USER_OR_KERNEL                                          \
-       PREPARE_RFI_TO_USER;                                            \
+       RFI_FLUSH_SLOT;                                                 \
        rfid;                                                           \
        b       rfi_flush_fallback
 
 #define RFI_TO_GUEST                                                   \
-       PREPARE_RFI_TO_GUEST;                                           \
+       RFI_FLUSH_SLOT;                                                 \
        rfid;                                                           \
        b       rfi_flush_fallback
 
 
 #define HRFI_TO_USER                                                   \
        CHECK_TARGET_MSR_PR(SPRN_HSRR1, 1);                             \
-       PREPARE_RFI_TO_USER;                                            \
+       RFI_FLUSH_SLOT;                                                 \
        hrfid;                                                          \
        b       hrfi_flush_fallback
 
 #define HRFI_TO_USER_OR_KERNEL                                         \
-       PREPARE_RFI_TO_USER;                                            \
+       RFI_FLUSH_SLOT;                                                 \
        hrfid;                                                          \
        b       hrfi_flush_fallback
 
 #define HRFI_TO_GUEST                                                  \
-       PREPARE_RFI_TO_GUEST;                                           \
+       RFI_FLUSH_SLOT;                                                 \
        hrfid;                                                          \
        b       hrfi_flush_fallback
 
 #define HRFI_TO_UNKNOWN                                                        \
-       RFI_FLUSH_FIXUP_SECTION;                                        \
-       nop;                                                            \
-       nop;                                                            \
-       nop;                                                            \
+       RFI_FLUSH_SLOT;                                                 \
        hrfid;                                                          \
        b       hrfi_flush_fallback