qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] hw/i386/elfboot: allocate "header" in heap


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH] hw/i386/elfboot: allocate "header" in heap
Date: Mon, 18 Nov 2024 13:37:59 +0100
User-agent: Mozilla Thunderbird

On 8/11/24 23:03, slp@redhat.com wrote:
From: Sergio Lopez <slp@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 <slp@redhat.com>
---
  hw/i386/x86-common.c | 5 ++++-
  1 file changed, 4 insertions(+), 1 deletion(-)

Patch queued to hw-misc, thanks.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]