From: Markus Armbruster <armbru@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: Patrick Venture <venture@google.com>,
peter.maydell@linaro.org, qemu-devel@nongnu.org,
Peter Foley <pefoley@google.com>
Subject: Re: [PATCH] util/keyval: fix msan findings
Date: Sat, 01 Mar 2025 08:14:21 +0100 [thread overview]
Message-ID: <87frjxcjea.fsf@pond.sub.org> (raw)
In-Reply-To: <fc1f2750-f4c7-419f-b667-301fb0bb2edf@redhat.com> (Paolo Bonzini's message of "Sat, 1 Mar 2025 07:12:29 +0100")
Paolo Bonzini <pbonzini@redhat.com> writes:
> On 2/28/25 22:20, Patrick Venture wrote:
>> From: Peter Foley <pefoley@google.com>
>> e.g.
>> qemu: Uninitialized value was created by an allocation of 'key_in_cur.i' in the stack frame
>> qemu: #0 0xaaaac49f489c in keyval_parse_one third_party/qemu/util/keyval.c:190:5
>> Signed-off-by: Peter Foley <pefoley@google.com>
>> Signed-off-by: Patrick Venture <venture@google.com>
>
> This is not a fix, since there's no bug to fix. It's just the tool complaining about something it can't reason on.
>
> Paolo
The code is designed to read @keyval_in_cur only in non-first iterations
of the loop. The previous iteration assigned to it then.
The two lines you quoted don't make sense to me. Is this the full
report you got? If not, show us the full report, please. Ideally with
a reproducer.
>> ---
>> util/keyval.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>> diff --git a/util/keyval.c b/util/keyval.c
>> index a70629a481..f33c64079d 100644
>> --- a/util/keyval.c
>> +++ b/util/keyval.c
>> @@ -187,7 +187,7 @@ static const char *keyval_parse_one(QDict *qdict, const char *params,
>> {
>> const char *key, *key_end, *val_end, *s, *end;
>> size_t len;
>> - char key_in_cur[128];
>> + char key_in_cur[128] = {};
Suspect overkill. Would "" do?
>> QDict *cur;
>> int ret;
>> QObject *next;
next prev parent reply other threads:[~2025-03-01 7:15 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-28 21:20 [PATCH] util/keyval: fix msan findings Patrick Venture
2025-03-01 6:12 ` Paolo Bonzini
2025-03-01 7:14 ` Markus Armbruster [this message]
2025-03-03 16:32 ` Peter Foley
2025-03-03 18:51 ` Paolo Bonzini
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=87frjxcjea.fsf@pond.sub.org \
--to=armbru@redhat.com \
--cc=pbonzini@redhat.com \
--cc=pefoley@google.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=venture@google.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.