From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43899) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XEDws-0003Xb-3W for qemu-devel@nongnu.org; Mon, 04 Aug 2014 04:48:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XEDwn-0004uX-F8 for qemu-devel@nongnu.org; Mon, 04 Aug 2014 04:48:54 -0400 Received: from mx1.redhat.com ([209.132.183.28]:2985) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XEDwn-0004uT-7g for qemu-devel@nongnu.org; Mon, 04 Aug 2014 04:48:49 -0400 Date: Mon, 4 Aug 2014 09:48:44 +0100 From: "Richard W.M. Jones" Message-ID: <20140804084844.GR1302@redhat.com> References: <1406994332-24716-1-git-send-email-rjones@redhat.com> <1406994332-24716-2-git-send-email-rjones@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [PATCH v4] aarch64: Allow -kernel option to take a gzip-compressed kernel. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Crosthwaite Cc: Peter Maydell , "qemu-devel@nongnu.org Developers" On Mon, Aug 04, 2014 at 09:05:39AM +1000, Peter Crosthwaite wrote: > On Sun, Aug 3, 2014 at 1:45 AM, Richard W.M. Jones wrote: > > + max_bytes = UBOOT_MAX_GUNZIP_BYTES; > > Why does u-boot's maximum size limit apply here? We need some maximum to prevent people uploading a kernel (perhaps from an untrusted source) which is some sort of malicious gzip file that expands to a huge size. In this case the u-boot limit is 64 MB which is larger than most possible kernels, so it seemed like a reasonable limit to choose. You're right there is no connection to u-boot, except that both the -kernel option and u-boot have similar concerns with maximum kernel size, and presumably the u-boot limit is battle-tested. I'll split the patch into two and send v5 soon. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://libguestfs.org