From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57292) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZrmZa-00049h-No for qemu-devel@nongnu.org; Thu, 29 Oct 2015 08:44:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZrmZV-0006MJ-LI for qemu-devel@nongnu.org; Thu, 29 Oct 2015 08:44:54 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53447) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZrmZV-0006Lj-E2 for qemu-devel@nongnu.org; Thu, 29 Oct 2015 08:44:49 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id C0659C0B591B for ; Thu, 29 Oct 2015 12:44:45 +0000 (UTC) From: Markus Armbruster Date: Thu, 29 Oct 2015 13:44:39 +0100 Message-Id: <1446122683-2355-1-git-send-email-armbru@redhat.com> Subject: [Qemu-devel] [PATCH 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: qemu-devel@nongnu.org Cc: lcapitulino@redhat.com 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. Markus Armbruster (4): json-streamer: Apply nesting limit more sanely json-streamer: Don't crash when input exceeds nesting limit check-qjson: Add test for JSON nesting depth limit json-streamer: Limit number of tokens in addition to total size qobject/json-streamer.c | 7 ++++--- tests/check-qjson.c | 29 +++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 3 deletions(-) -- 2.4.3