Re: [PATCH v2 2/2] xen/x86: Livepatch: support patching CET-enhanced functions

2022-03-08 Thread Doebel, Bjoern
On 08.03.22 09:07, Jan Beulich wrote: CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you can confirm the sender and know the content is safe. On 07.03.2022 22:13, Bjoern Doebel wrote: @@ -159,7 +200,11 @@ void noinline arch_l

Re: [PATCH v2 2/2] xen/x86: Livepatch: support patching CET-enhanced functions

2022-03-08 Thread Jan Beulich
On 07.03.2022 22:13, Bjoern Doebel wrote: > @@ -159,7 +200,11 @@ void noinline arch_livepatch_apply(struct livepatch_func > *func) > */ > void noinline arch_livepatch_revert(const struct livepatch_func *func) > { > -memcpy(func->old_addr, func->opaque, livepatch_insn_len(func)); > +str

[PATCH v2 2/2] xen/x86: Livepatch: support patching CET-enhanced functions

2022-03-07 Thread Bjoern Doebel
Xen enabled CET for supporting architectures. The control flow aspect of CET expects functions that can be called indirectly (i.e., via function pointers) to start with an ENDBR64 instruction. Otherwise a control flow exception is raised. This expectation breaks livepatching flows because we patch