* [PATCH v1 0/1] hw/xen: Avoid Avoid use of uninitialized bufioreq_evtchn
@ 2024-10-07 21:16 Edgar E. Iglesias
2024-10-07 21:16 ` [PATCH v1 1/1] hw/xen: " Edgar E. Iglesias
0 siblings, 1 reply; 3+ messages in thread
From: Edgar E. Iglesias @ 2024-10-07 21:16 UTC (permalink / raw)
To: qemu-devel
Cc: sstabellini, anthony, paul, peter.maydell, edgar.iglesias,
xen-devel
From: "Edgar E. Iglesias" <edgar.iglesias@amd.com>
This has a fix for Coverity CID 1563383 reported by Peter.
Avoid use of uninitialized bufioreq_evtchn. It should only
be used if buffered IOREQs are enabled.
Cheers,
Edgar
Edgar E. Iglesias (1):
hw/xen: Avoid use of uninitialized bufioreq_evtchn
hw/xen/xen-hvm-common.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
--
2.43.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH v1 1/1] hw/xen: Avoid use of uninitialized bufioreq_evtchn
2024-10-07 21:16 [PATCH v1 0/1] hw/xen: Avoid Avoid use of uninitialized bufioreq_evtchn Edgar E. Iglesias
@ 2024-10-07 21:16 ` Edgar E. Iglesias
2024-10-07 21:38 ` Stefano Stabellini
0 siblings, 1 reply; 3+ messages in thread
From: Edgar E. Iglesias @ 2024-10-07 21:16 UTC (permalink / raw)
To: qemu-devel
Cc: sstabellini, anthony, paul, peter.maydell, edgar.iglesias,
xen-devel, Edgar E. Iglesias
From: "Edgar E. Iglesias" <edgar.iglesias@amd.com>
Avoid use of uninitialized bufioreq_evtchn. It should only
be used if buffered IOREQs are enabled.
Resolves: Coverity CID 1563383
Reported-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@amd.com>
---
hw/xen/xen-hvm-common.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/hw/xen/xen-hvm-common.c b/hw/xen/xen-hvm-common.c
index 7d2b72853b..7ffbbfea23 100644
--- a/hw/xen/xen-hvm-common.c
+++ b/hw/xen/xen-hvm-common.c
@@ -752,9 +752,10 @@ static int xen_map_ioreq_server(XenIOState *state)
return -1;
}
- trace_xen_map_ioreq_server_buffered_io_evtchn(bufioreq_evtchn);
-
- state->bufioreq_remote_port = bufioreq_evtchn;
+ if (state->has_bufioreq) {
+ trace_xen_map_ioreq_server_buffered_io_evtchn(bufioreq_evtchn);
+ state->bufioreq_remote_port = bufioreq_evtchn;
+ }
return 0;
}
--
2.43.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v1 1/1] hw/xen: Avoid use of uninitialized bufioreq_evtchn
2024-10-07 21:16 ` [PATCH v1 1/1] hw/xen: " Edgar E. Iglesias
@ 2024-10-07 21:38 ` Stefano Stabellini
0 siblings, 0 replies; 3+ messages in thread
From: Stefano Stabellini @ 2024-10-07 21:38 UTC (permalink / raw)
To: Edgar E. Iglesias
Cc: qemu-devel, sstabellini, anthony, paul, peter.maydell,
edgar.iglesias, xen-devel
On Mon, 7 Oct 2024, Edgar E. Iglesias wrote:
> From: "Edgar E. Iglesias" <edgar.iglesias@amd.com>
>
> Avoid use of uninitialized bufioreq_evtchn. It should only
> be used if buffered IOREQs are enabled.
>
> Resolves: Coverity CID 1563383
> Reported-by: Peter Maydell <peter.maydell@linaro.org>
> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@amd.com>
Acked-by: Stefano Stabellini <sstabellini@kernel.org>
> ---
> hw/xen/xen-hvm-common.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/hw/xen/xen-hvm-common.c b/hw/xen/xen-hvm-common.c
> index 7d2b72853b..7ffbbfea23 100644
> --- a/hw/xen/xen-hvm-common.c
> +++ b/hw/xen/xen-hvm-common.c
> @@ -752,9 +752,10 @@ static int xen_map_ioreq_server(XenIOState *state)
> return -1;
> }
>
> - trace_xen_map_ioreq_server_buffered_io_evtchn(bufioreq_evtchn);
> -
> - state->bufioreq_remote_port = bufioreq_evtchn;
> + if (state->has_bufioreq) {
> + trace_xen_map_ioreq_server_buffered_io_evtchn(bufioreq_evtchn);
> + state->bufioreq_remote_port = bufioreq_evtchn;
> + }
>
> return 0;
> }
> --
> 2.43.0
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-10-07 21:39 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-07 21:16 [PATCH v1 0/1] hw/xen: Avoid Avoid use of uninitialized bufioreq_evtchn Edgar E. Iglesias
2024-10-07 21:16 ` [PATCH v1 1/1] hw/xen: " Edgar E. Iglesias
2024-10-07 21:38 ` Stefano Stabellini
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).