An error occurred fetching the project authors.
  1. 20 Jul, 2023 1 commit
  2. 10 Jul, 2023 1 commit
  3. 30 Mar, 2023 1 commit
  4. 23 Mar, 2023 2 commits
  5. 06 Mar, 2023 1 commit
  6. 11 Feb, 2023 1 commit
    • Josh Poimboeuf's avatar
      x86/entry: Fix unwinding from kprobe on PUSH/POP instruction · 37064583
      Josh Poimboeuf authored
      If a kprobe (INT3) is set on a stack-modifying single-byte instruction,
      like a single-byte PUSH/POP or a LEAVE, ORC fails to unwind past it:
      
        Call Trace:
         <TASK>
         dump_stack_lvl+0x57/0x90
         handler_pre+0x33/0x40 [kprobe_example]
         aggr_pre_handler+0x49/0x90
         kprobe_int3_handler+0xe3/0x180
         do_int3+0x3a/0x80
         exc_int3+0x7d/0xc0
         asm_exc_int3+0x35/0x40
        RIP: 0010:kernel_clone+0xe/0x3a0
        Code: cc e8 16 b2 bf 00 66 0f 1f 44 00 00 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 0f 1f 44 00 00 41 57 41 56 41 55 41 54 cc <53> 48 89 fb 48 83 ec 68 4c 8b 27 65 48 8b 04 25 28 00 00 00 48 89
        RSP: 0018:ffffc9000074fda0 EFLAGS: 00000206
        RAX: 0000000000808100 RBX: ffff888109de9d80 RCX: 0000000000000000
        RDX: 0000000000000011 RSI: ffff888109de9d80 RDI: ffffc9000074fdc8
        RBP: ffff8881019543c0 R08: ffffffff81127e30 R09: 00000000e71742a5
        R10: ffff888104764a18 R11: 0000000071742a5e R12: ffff888100078800
        R13: ffff888100126000 R14: 0000000000000000 R15: ffff888100126005
         ? __pfx_call_usermodehelper_exec_async+0x10/0x10
         ? kernel_clone+0xe/0x3a0
         ? user_mode_thread+0x5b/0x80
         ? __pfx_call_usermodehelper_exec_async+0x10/0x10
         ? call_usermodehelper_exec_work+0x77/0xb0
         ? process_one_work+0x299/0x5f0
         ? worker_thread+0x4f/0x3a0
         ? __pfx_worker_thread+0x10/0x10
         ? kthread+0xf2/0x120
         ? __pfx_kthread+0x10/0x10
         ? ret_from_fork+0x29/0x50
         </TASK>
      
      The problem is that #BP saves the pointer to the instruction immediately
      *after* the INT3, rather than to the INT3 itself.  The instruction
      replaced by the INT3 hasn't actually run, but ORC assumes otherwise and
      expects the wrong stack layout.
      
      Fix it by annotating the #BP exception as a non-signal stack frame,
      which tells the ORC unwinder to decrement the instruction pointer before
      looking up the corresponding ORC entry.
      Reported-by: default avatarChen Zhongjin <chenzhongjin@huawei.com>
      Signed-off-by: default avatarJosh Poimboeuf <jpoimboe@kernel.org>
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      Link: https://lore.kernel.org/r/baafcd3cc1abb14cb757fe081fa696012a5265ee.1676068346.git.jpoimboe@kernel.org
      37064583
  7. 12 Jan, 2023 1 commit
  8. 17 Oct, 2022 6 commits
  9. 14 Jul, 2022 1 commit
  10. 07 Jul, 2022 1 commit
    • Peter Zijlstra's avatar
      x86/entry: Move PUSH_AND_CLEAR_REGS() back into error_entry · 2c08b9b3
      Peter Zijlstra authored
      Commit
      
        ee774dac ("x86/entry: Move PUSH_AND_CLEAR_REGS out of error_entry()")
      
      moved PUSH_AND_CLEAR_REGS out of error_entry, into its own function, in
      part to avoid calling error_entry() for XenPV.
      
      However, commit
      
        7c81c0c9 ("x86/entry: Avoid very early RET")
      
      had to change that because the 'ret' was too early and moved it into
      idtentry, bloating the text size, since idtentry is expanded for every
      exception vector.
      
      However, with the advent of xen_error_entry() in commit
      
        d147553b ("x86/xen: Add UNTRAIN_RET")
      
      it became possible to remove PUSH_AND_CLEAR_REGS from idtentry, back
      into *error_entry().
      Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
      2c08b9b3
  11. 27 Jun, 2022 6 commits
  12. 20 May, 2022 1 commit
    • Peter Zijlstra's avatar
      x86/entry: Fixup objtool/ibt validation · ce656528
      Peter Zijlstra authored
      Commit
      
        47f33de4 ("x86/sev: Mark the code returning to user space as syscall gap")
      
      added a bunch of text references without annotating them, resulting in a
      spree of objtool complaints:
      
        vmlinux.o: warning: objtool: vc_switch_off_ist+0x77: relocation to !ENDBR: entry_SYSCALL_64+0x15c
        vmlinux.o: warning: objtool: vc_switch_off_ist+0x8f: relocation to !ENDBR: entry_SYSCALL_compat+0xa5
        vmlinux.o: warning: objtool: vc_switch_off_ist+0x97: relocation to !ENDBR: .entry.text+0x21ea
        vmlinux.o: warning: objtool: vc_switch_off_ist+0xef: relocation to !ENDBR: .entry.text+0x162
        vmlinux.o: warning: objtool: __sev_es_ist_enter+0x60: relocation to !ENDBR: entry_SYSCALL_64+0x15c
        vmlinux.o: warning: objtool: __sev_es_ist_enter+0x6c: relocation to !ENDBR: .entry.text+0x162
        vmlinux.o: warning: objtool: __sev_es_ist_enter+0x8a: relocation to !ENDBR: entry_SYSCALL_compat+0xa5
        vmlinux.o: warning: objtool: __sev_es_ist_enter+0xc1: relocation to !ENDBR: .entry.text+0x21ea
      
      Since these text references are used to compare against IP, and are not
      an indirect call target, they don't need ENDBR so annotate them away.
      
      Fixes: 47f33de4 ("x86/sev: Mark the code returning to user space as syscall gap")
      Reported-by: default avatarStephen Rothwell <sfr@canb.auug.org.au>
      Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
      Link: https://lore.kernel.org/r/20220520082604.GQ2578@worktop.programming.kicks-ass.net
      ce656528
  13. 19 May, 2022 1 commit
  14. 18 May, 2022 1 commit
    • Lai Jiangshan's avatar
      x86/sev: Annotate stack change in the #VC handler · c42b1451
      Lai Jiangshan authored
      In idtentry_vc(), vc_switch_off_ist() determines a safe stack to
      switch to, off of the IST stack. Annotate the new stack switch with
      ENCODE_FRAME_POINTER in case UNWINDER_FRAME_POINTER is used.
      
      A stack walk before looks like this:
      
        CPU: 0 PID: 0 Comm: swapper Not tainted 5.18.0-rc7+ #2
        Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 0.0.0 02/06/2015
        Call Trace:
         <TASK>
         dump_stack_lvl
         dump_stack
         kernel_exc_vmm_communication
         asm_exc_vmm_communication
         ? native_read_msr
         ? __x2apic_disable.part.0
         ? x2apic_setup
         ? cpu_init
         ? trap_init
         ? start_kernel
         ? x86_64_start_reservations
         ? x86_64_start_kernel
         ? secondary_startup_64_no_verify
         </TASK>
      
      and with the fix, the stack dump is exact:
      
        CPU: 0 PID: 0 Comm: swapper Not tainted 5.18.0-rc7+ #3
        Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 0.0.0 02/06/2015
        Call Trace:
         <TASK>
         dump_stack_lvl
         dump_stack
         kernel_exc_vmm_communication
         asm_exc_vmm_communication
        RIP: 0010:native_read_msr
        Code: ...
        < snipped regs >
         ? __x2apic_disable.part.0
         x2apic_setup
         cpu_init
         trap_init
         start_kernel
         x86_64_start_reservations
         x86_64_start_kernel
         secondary_startup_64_no_verify
         </TASK>
      
        [ bp: Test in a SEV-ES guest and rewrite the commit message to
          explain what exactly this does. ]
      
      Fixes: a13644f3 ("x86/entry/64: Add entry code for #VC handler")
      Signed-off-by: default avatarLai Jiangshan <jiangshan.ljs@antgroup.com>
      Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
      Acked-by: default avatarJosh Poimboeuf <jpoimboe@redhat.com>
      Link: https://lore.kernel.org/r/20220316041612.71357-1-jiangshanlai@gmail.com
      c42b1451
  15. 06 May, 2022 1 commit
  16. 03 May, 2022 6 commits
  17. 19 Apr, 2022 1 commit
  18. 15 Mar, 2022 7 commits