From: Keith Seitz <keiths@redhat.com>
To: Andrew Burgess <aburgess@redhat.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH 2/5] gdbserver: prevent buffer overrun for QTDPsrc packet
Date: Mon, 23 Nov 2026 09:57:25 -0800 [thread overview]
Message-ID: <325ec6d6-9dc7-4da8-80ec-2a4a1794609c@redhat.com> (raw)
In-Reply-To: <xhuyfcxrv79l3.fsf@aburgess-thinkpadp1gen8.rmtgb.csb>
Hi,
On 11/23/26 9:15 AM, Andrew Burgess wrote:
> Keith Seitz <keiths@redhat.com> writes:
>>> + char *src = (char *) xmalloc (len / 2 + 1);
>>> + size_t nbytes = hex2bin (packet, (gdb_byte *) src,
>>> + static_cast<int> (len / 2));
>>> src[nbytes] = '\0';
>>
>> Just for the record, hex2bin can throw, so this can leak
>> `src', but you fix this in patch 5/5. I don't know if this is
>> worth mentioning in the commit message for someone reviewing
>> this patch in the future?
>
> I fix this in patch #5. I have added some additional text to the commit
> message to acknowledge that this bug exists, and explain that it is
> fixed in a later patch. See the updated patch below.
All LGTM. Thanks!
Reviewed-By: Keith Seitz <keiths@redhat.com>
Keith
next prev parent reply other threads:[~2026-11-23 17:57 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-16 11:10 [PATCH 0/5] gdbserver: fix buffer overflow issue in " Andrew Burgess
2026-11-16 11:10 ` [PATCH 1/5] gdbserver: clean up some older code in tracepoint.cc Andrew Burgess
2026-11-16 11:10 ` [PATCH 2/5] gdbserver: prevent buffer overrun for QTDPsrc packet Andrew Burgess
2026-11-19 19:51 ` Keith Seitz
2026-11-23 17:15 ` Andrew Burgess
2026-11-23 17:57 ` Keith Seitz [this message]
2026-11-16 11:10 ` [PATCH 3/5] gdbserver: improve packet parsing in tracepoint.cc Andrew Burgess
2026-11-16 11:10 ` [PATCH 4/5] gdbserver: don't leak trace variable names if reusing variable numbers Andrew Burgess
2026-11-16 11:10 ` [PATCH 5/5] gdbserver: use unique_xmalloc_ptr to avoid memory leaks Andrew Burgess
2026-11-19 19:52 ` [PATCH 0/5] gdbserver: fix buffer overflow issue in QTDPsrc packet Keith Seitz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=325ec6d6-9dc7-4da8-80ec-2a4a1794609c@redhat.com \
--to=keiths@redhat.com \
--cc=aburgess@redhat.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox