Re: [PATCH] target/i386: fix NULL pointer dereference in legacy-cache=off handling

Zhao Liu <[email protected]>
Newsgroups org.nongnu.qemu-trivial,org.nongnu.qemu-devel
Message-ID <[email protected]>
On Thu, Mar 05, 2026 at 11:04:31AM +0500, Sergei Heifetz wrote:
> Date: Thu,  5 Mar 2026 11:04:31 +0500
> From: Sergei Heifetz <[email protected]>
> Subject: [PATCH] target/i386: fix NULL pointer dereference in
>  legacy-cache=off handling
> X-Mailer: git-send-email 2.34.1
> 
> The check that xcc->model is not NULL occurs after it is dereferenced
> inside x86_cpu_get_versioned_cache_info(), so something like
> `-cpu host,legacy-cache=off` leads to a segfault rather than an error.
> This patch fixes that.
> 
> Fixes: cca0a000d06f897411a8a ("target/i386: allow versioned CPUs to specify new cache_info")
> Signed-off-by: Sergei Heifetz <[email protected]>
> ---
>  target/i386/cpu.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)

Reviewed-by: Zhao Liu <[email protected]>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.