"Michael S. Tsirkin" <m...@redhat.com> writes: > On Sat, Nov 09, 2024 at 12:03:14AM +0100, s...@redhat.com wrote: >> From: Sergio Lopez <s...@redhat.com> >> >> In x86_load_linux(), we were using a stack-allocated array as data for >> fw_cfg_add_bytes(). Since the latter just takes a reference to the >> pointer instead of copying the data, it can happen that the contents >> have been overridden by the time the guest attempts to access them. >> >> Instead of using the stack-allocated array, allocate some memory from >> the heap, copy the contents of the array, and use it for fw_cfg. >> >> Signed-off-by: Sergio Lopez <s...@redhat.com> > > Wow. How did this ever work? >
I guess, for quite a while, we were just lucky that memory region wasn't touched by the time the FW in the guest uses it (possibly helped by the fact this happens very early in the VM lifetime). In recent versions/builds this is no longer the case. Sergio.