All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH untested] x86_32: fix extable entry for iret
@ 2019-11-07  4:41 Lai Jiangshan
  2019-11-07  4:54 ` Andy Lutomirski
  0 siblings, 1 reply; 2+ messages in thread
From: Lai Jiangshan @ 2019-11-07  4:41 UTC (permalink / raw)
  To: linux-kernel
  Cc: Lai Jiangshan, Peter Zijlstra, Andy Lutomirski, Thomas Gleixner,
	Ingo Molnar, Borislav Petkov, H. Peter Anvin, x86

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@infradead.org>
Signed-off-by: Lai Jiangshan <laijs@linux.alibaba.com>
---
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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH untested] x86_32: fix extable entry for iret
  2019-11-07  4:41 [PATCH untested] x86_32: fix extable entry for iret Lai Jiangshan
@ 2019-11-07  4:54 ` Andy Lutomirski
  0 siblings, 0 replies; 2+ messages in thread
From: Andy Lutomirski @ 2019-11-07  4:54 UTC (permalink / raw)
  To: Lai Jiangshan
  Cc: LKML, Peter Zijlstra, Andy Lutomirski, Thomas Gleixner,
	Ingo Molnar, Borislav Petkov, H. Peter Anvin, X86 ML

On Wed, Nov 6, 2019 at 8:41 PM Lai Jiangshan <laijs@linux.alibaba.com> wrote:
>
> 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.

Egads!

What happens if you run tools/testing/selftests/x86/sigreturn_32 with
and without this patch?

--Andy

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-11-07  4:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-07  4:41 [PATCH untested] x86_32: fix extable entry for iret Lai Jiangshan
2019-11-07  4:54 ` Andy Lutomirski

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.