Re: [PATCH] x86/shadow: Fix UBSAN in hvm_emulate_insn_fetch

2025-04-15 Thread Teddy Astie
Le 15/04/2025 à 15:02, Andrew Cooper a écrit : > Which compiler are you using?  (Just so there's a record.  These reports > are version-sensitive.) It's GCC 14.2.0. > > Do you know precisely which condition is being hit? It occurs when booting OVMF (PVH and HVM) with HAP=0. It doesn't seem to oc

Re: [PATCH] x86/shadow: Fix UBSAN in hvm_emulate_insn_fetch

2025-04-15 Thread Andrew Cooper
On 15/04/2025 2:00 pm, Jan Beulich wrote: > On 15.04.2025 14:49, Teddy Astie wrote: >> UBSAN complains when trying memcpy with a NULL pointer even if it's going to >> copy zero bytes (which are the only cases where a NULL pointer is used). > If this really was a problem, I think we'd need to go thr

Re: [PATCH] x86/shadow: Fix UBSAN in hvm_emulate_insn_fetch

2025-04-15 Thread Andrew Cooper
On 15/04/2025 1:49 pm, Teddy Astie wrote: > UBSAN complains when trying memcpy with a NULL pointer even if it's going to > copy zero bytes (which are the only cases where a NULL pointer is used). > Fix this by only doing the memcpy if the pointer is non-NULL. Which compiler are you using?  (Just s

Re: [PATCH] x86/shadow: Fix UBSAN in hvm_emulate_insn_fetch

2025-04-15 Thread Jan Beulich
On 15.04.2025 14:49, Teddy Astie wrote: > UBSAN complains when trying memcpy with a NULL pointer even if it's going to > copy zero bytes (which are the only cases where a NULL pointer is used). If this really was a problem, I think we'd need to go through and find all instances. However, ... > Fi

[PATCH] x86/shadow: Fix UBSAN in hvm_emulate_insn_fetch

2025-04-15 Thread Teddy Astie
UBSAN complains when trying memcpy with a NULL pointer even if it's going to copy zero bytes (which are the only cases where a NULL pointer is used). Fix this by only doing the memcpy if the pointer is non-NULL. (XEN) ===