Received: from eggs.gnu.org ([2001:4830:134:3::10]:36295) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZzSYM-0006SE-FE for qemu-devel@nongnu.org; Thu, 19 Nov 2015 11:59:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZzSYJ-0004yY-6J for qemu-devel@nongnu.org; Thu, 19 Nov 2015 11:59:22 -0500 Received: from mx1.redhat.com ([209.132.183.28]:37617) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZzSYJ-0004yF-0i for qemu-devel@nongnu.org; Thu, 19 Nov 2015 11:59:19 -0500 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id A45668E257 for ; Thu, 19 Nov 2015 16:59:18 +0000 (UTC) From: Markus Armbruster References: <1447946948-12489-1-git-send-email-armbru@redhat.com> <564DF5AD.2040002@redhat.com> Date: Thu, 19 Nov 2015 17:59:16 +0100 In-Reply-To: <564DF5AD.2040002@redhat.com> (Eric Blake's message of "Thu, 19 Nov 2015 09:15:41 -0700") Message-ID: <87wpte0vtn.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH v2 0/4] json-streamer: Fix up code to limit nesting and size List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: qemu-devel@nongnu.org, lcapitulino@redhat.com Eric Blake writes: > On 11/19/2015 08:29 AM, Markus Armbruster wrote: >> Ugh, I almost dropped this on the floor. I think it should go into >> 2.5, and I plan to take it through my tree. If you disagree, please >> speak up. > > It sounds like a bug fix to me (avoiding core dumps due to > user-triggerable input) and on that ground, qualifies for hard freeze in > my books. > >> >> We limit nesting depth and input size to defend against input >> triggering excessive heap or stack memory use (commit 29c75dd >> json-streamer: limit the maximum recursion depth and maximum token >> count). This limiting is flawed in multiple ways. Fix it up some. >> >> Not yet fixed: this JSON parser is an absurd memory hog; see last >> patch. >> >> v2: >> * Trivially rebased, R-bys retained >> * PATCH 3: Fix a nearby comment typo [Eric] >> * PATCH 4: Simplify make_nest() slightly >> * PATCH 5: Commit message tweaked > > Hmm, when the series is only 4/4, changes to PATCH 5 are suspect :) I can't count. Subtract one from every patch number in the list above. > At any rate, the changes look correct, and minor enough that keeping my > R-b was the right thing to do. Thanks!