From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59899) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1brhf7-0002KP-Qh for qemu-devel@nongnu.org; Wed, 05 Oct 2016 04:34:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1brhf5-0006kZ-S8 for qemu-devel@nongnu.org; Wed, 05 Oct 2016 04:34:48 -0400 Date: Wed, 5 Oct 2016 04:34:36 -0400 (EDT) From: =?utf-8?Q?Marc-Andr=C3=A9?= Lureau Message-ID: <1707587810.501720.1475656476659.JavaMail.zimbra@redhat.com> In-Reply-To: <871szv1a5i.fsf@dusky.pond.sub.org> References: <20160922203927.28241-1-marcandre.lureau@redhat.com> <20160922203927.28241-3-marcandre.lureau@redhat.com> <87twcy4sr5.fsf@dusky.pond.sub.org> <871szv1a5i.fsf@dusky.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v4 2/3] qapi: fix crash when a parameter is missing List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: =?utf-8?Q?Marc-Andr=C3=A9?= Lureau , qemu-devel@nongnu.org, paolo bonzini , qemu-stable@nongnu.org Hi Markus ----- Original Message ----- > Markus Armbruster writes: >=20 > > Marc-Andr=C3=A9 Lureau writes: > > > >> Calling: > >> > >> { "execute": "qom-set", > >> "arguments": { "path": "/machine", "property": "rtc-time" } } > >> > >> Will crash with: > >> > >> qapi/qapi-visit-core.c:277: visit_type_any: Assertion `!err !=3D !*obj= ' > >> failed > > > > This is actually a recent regression. Let's add "Broken in commit > > 5c678ee." Can do on commit. > > > >> Clear the obj and return an error. > >> > >> The patch also fixes a similar potential crash in qmp_input_type_null(= ) > >> by checking qmp_input_get_object() returned a valid qobj. > >> > >> Signed-off-by: Marc-Andr=C3=A9 Lureau > >> Reviewed-by: Eric Blake >=20 > I'd like to rephrase like this, if it's all right with you: >=20 > qapi: Fix crash when 'any' or 'null' parameter is missing >=20 > Unlike the other visit methods, visit_type_any() and visit_type_null(= ) > neglect to check whether qmp_input_get_object() succeeded. They cras= h > when it fails. Reproducer: >=20 > { "execute": "qom-set", > "arguments": { "path": "/machine", "property": "rtc-time" } } >=20 > Will crash with: >=20 > qapi/qapi-visit-core.c:277: visit_type_any: Assertion `!err !=3D !*ob= j' > failed >=20 > Broken in commit 5c678ee. Fix by adding the missing error checks. >=20 > Also: > Reviewed-by: Markus Armbruster Looks good to me, thanks >=20