kernel_samsung_a53x/arch
Thomas Gleixner 9ff164b71b x86/alternatives: Sync core before enabling interrupts
commit 3ea1704a92967834bf0e64ca1205db4680d04048 upstream.

text_poke_early() does:

   local_irq_save(flags);
   memcpy(addr, opcode, len);
   local_irq_restore(flags);
   sync_core();

That's not really correct because the synchronization should happen before
interrupts are re-enabled to ensure that a pending interrupt observes the
complete update of the opcodes.

It's not entirely clear whether the interrupt entry provides enough
serialization already, but moving the sync_core() invocation into interrupt
disabled region does no harm and is obviously correct.

Fixes: 6fffacb30349 ("x86/alternatives, jumplabel: Use text_poke_early() before mm_init()")
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: <stable@kernel.org>
Link: https://lore.kernel.org/r/ZT6narvE%2BLxX%2B7Be@windriver.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-11-18 12:12:01 +01:00
..
alpha Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
arc Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
arm ARM: OMAP2+: Fix null pointer dereference and memory leak in omap_soc_device_init 2024-11-18 12:11:58 +01:00
arm64 arm64: mm: Always make sw-dirty PTEs hw-dirty in pte_modify 2024-11-18 12:11:57 +01:00
c6x Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
csky Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
h8300 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hexagon Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ia64 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
m68k Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
microblaze Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mips MIPS: Loongson64: Enable DMA noncoherent support 2024-11-18 12:11:46 +01:00
nds32 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
nios2 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
openrisc Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
parisc parisc: Drop the HP-UX ENOSYM and EREMOTERELEASE error codes 2024-11-18 12:11:10 +01:00
powerpc powerpc/ftrace: Fix stack teardown in ftrace_no_trace 2024-11-18 12:11:58 +01:00
riscv riscv: fix misaligned access handling of C.SWSP and C.SDSP 2024-11-18 12:11:41 +01:00
s390 s390/vx: fix save/restore of fpu kernel context 2024-11-18 12:11:58 +01:00
sh sh: bios: Revive earlyprintk support 2024-11-18 11:43:04 +01:00
sparc sparc32: fix a braino in fault handling in csum_and_copy_..._user() 2024-11-18 10:58:31 +01:00
um Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
x86 x86/alternatives: Sync core before enabling interrupts 2024-11-18 12:12:01 +01:00
xtensa Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Kconfig Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00