[PATCH untested] x86_32: fix extable entry for iret

From: Lai Jiangshan
Date: Wed Nov 06 2019 - 23:41:29 EST


3c88c692c287(x86/stackframe/32: Provide consistent pt_regs)
added code after label .Lirq_return and before 'iret', an instruction
which should be expected to be found in the extable when there is
an exception on it. But the extable entry stores the address of
.Lirq_return not the new address of 'iret', which disables
the corresponding fixup. This patch fixes the extable entry
by using a new label.

CC: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
Signed-off-by: Lai Jiangshan <laijs@xxxxxxxxxxxxxxxxx>
---
Purely accidently found, untested.

arch/x86/entry/entry_32.S | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/x86/entry/entry_32.S b/arch/x86/entry/entry_32.S
index f83ca5aa8b77..f62aa6655cfb 100644
--- a/arch/x86/entry/entry_32.S
+++ b/arch/x86/entry/entry_32.S
@@ -1081,6 +1081,7 @@ restore_all:
* when returning from IPI handler and when returning from
* scheduler to user-space.
*/
+.Lirq_return_ex:
INTERRUPT_RETURN

restore_all_kernel:
@@ -1118,7 +1119,7 @@ ENTRY(iret_exc )

jmp common_exception
.previous
- _ASM_EXTABLE(.Lirq_return, iret_exc)
+ _ASM_EXTABLE(.Lirq_return_ex, iret_exc)
ENDPROC(entry_INT80_32)

.macro FIXUP_ESPFIX_STACK
--
2.20.1