From: Jason Wang <jasowang@redhat.com>
To: Eric Blake <eblake@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>,
qemu-devel@nongnu.org
Cc: armbru@redhat.com
Subject: Re: [PATCH] net: validate that ids are well formed
Date: Tue, 2 Mar 2021 13:55:44 +0800 [thread overview]
Message-ID: <e816f66e-742f-af78-3636-20bc2dec3644@redhat.com> (raw)
In-Reply-To: <06f16114-3795-3379-ed5c-9fc1f799c90a@redhat.com>
On 2021/3/1 11:07 下午, Eric Blake wrote:
> On 3/1/21 8:56 AM, Paolo Bonzini wrote:
>> When a network or network device is created from the command line or HMP,
>> QemuOpts ensures that the id passes the id_wellformed check. However,
>> QMP skips this:
>>
>> $ qemu-system-x86_64 -qmp stdio -S -nic user,id=123/456
>> qemu-system-x86_64: -nic user,id=123/456: Parameter id expects an identifier
>> Identifiers consist of letters, digits, -, ., _, starting with a letter.
>>
>> $ qemu-system-x86_64 -qmp stdio -S
>> {"execute":"qmp_capabilities"}
>> {"return": {}}
>> {"execute":"netdev_add", "arguments": {"type": "user", "id": "123/456"}}
>> {"return": {}}
>>
>> After:
>>
>> $ qemu-system-x86_64 -qmp stdio -S
>> {"execute":"qmp_capabilities"}
>> {"return": {}}
>> {"execute":"netdev_add", "arguments": {"type": "user", "id": "123/456"}}
>> {"error": {"class": "GenericError", "desc": "Parameter "id" expects an identifier"}}
>>
>> Validity checks should be performed always at the bottom of the call chain,
>> because QMP skips all the steps above. Do this for the network subsystem.
>>
>> Cc: Jason Wang <jasowang@redhat.com>
>> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
>> ---
>> net/net.c | 12 ++++++++++++
>> 1 file changed, 12 insertions(+)
> Reviewed-by: Eric Blake <eblake@redhat.com>
Queued.
Thanks
>
prev parent reply other threads:[~2021-03-02 6:02 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-01 14:56 [PATCH] net: validate that ids are well formed Paolo Bonzini
2021-03-01 15:07 ` Eric Blake
2021-03-02 5:55 ` Jason Wang [this message]
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=e816f66e-742f-af78-3636-20bc2dec3644@redhat.com \
--to=jasowang@redhat.com \
--cc=armbru@redhat.com \
--cc=eblake@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.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;
as well as URLs for NNTP newsgroup(s).