qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] fix gdbserver_state pointer validation


From: Alex Bennée
Subject: Re: [Qemu-devel] [PATCH] fix gdbserver_state pointer validation
Date: Mon, 09 Jul 2018 16:42:14 +0100
User-agent: mu4e 1.1.0; emacs 26.1.50

stephane duverger <address@hidden> writes:

> Hi,
>
> This is a small patch to gdbstub rather insignificant at first sight:
> fix null pointer dereference. It actually allows to take benefit of
> gdb features (breakpoints/sstep) internally (ie. special purpose
> board) without connecting a gdb client to the Qemu instance gdbserver
> stub.

There don't seem to be any other patches attached? I would NACK a patch
that isn't actually used in-tree. I would also like to see how this
would be used because we certainly have different paths for KVM and TCG
break-point emulation that don't need to go through the gdbstub to
achieve what they are doing.

>
> Regards,
>
> Signed-off-by: Stephane Duverger <address@hidden>
> ---
>  gdbstub.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/gdbstub.c b/gdbstub.c
> index d6ab95006c..788fd625ab 100644
> --- a/gdbstub.c
> +++ b/gdbstub.c
> @@ -1412,6 +1412,9 @@ static int gdb_handle_packet(GDBState *s, const char 
> *line_buf)
>
>  void gdb_set_stop_cpu(CPUState *cpu)
>  {
> +    if (!gdbserver_state) {
> +        return;
> +    }
>      gdbserver_state->c_cpu = cpu;
>      gdbserver_state->g_cpu = cpu;
>  }


--
Alex Bennée



reply via email to

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