]> www.infradead.org Git - users/jedix/linux-maple.git/commit
x86: Move STUFF_RSB in to the idt macro
authorKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Sat, 13 Jan 2018 03:32:23 +0000 (22:32 -0500)
committerJack Vogel <jack.vogel@oracle.com>
Sat, 27 Jan 2018 01:13:30 +0000 (17:13 -0800)
commitfd29a0e89b099bb2d7bb17a271c6382a8a4b62c5
tree4b1737876ad803ab80455172036eaa06e15bcede
parent5ef0e4601f8804442d7c21b83041838705fd62a3
x86: Move STUFF_RSB in to the idt macro

instead of it sitting in paranoid_entry or error_entry.

The idea behind the STUFF_RSB is to be done _before_
any calls are done. Which means we really want this in the idt
macro that is handled for exceptions - such as device not available,
which currently looks as so:

[Ignore the callq *0x40.. that gets converted to an 'cld']

<device_not_available>:
  nop
  nop
  nop
  callq  *0x40d0b7(%rip)        # ffffffff81b55330 <pv_irq_ops+0x30> <= patched to cld
  pushq  $0xffffffffffffffff
  sub    $0x78,%rsp
  callq  ffffffff81748ea0 <error_entry>           <=== call!
  mov    %rsp,%rdi
  xor    %esi,%esi
  callq  ffffffff81018830 <do_device_not_available>
  test   %rax,%rax
  jne    ffffffff81747f10 <dtrace_error_exit>
  jmpq   ffffffff817490a0 <error_exit>
  nopl   0x0(%rax)

By stuffing the RSB before the call to error_entry (or
paranoid_entry) we remove the chance of this becoming an attack vector.

While at it, remove the useless comment - we don't encode any frames
in UEK4.

OraBug: 27417150
Reviewed-by: Kris Van Hees <kris.van.hees@oracle.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
arch/x86/kernel/entry_64.S