[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] make pygrub cope better with big files in guest



On Wed, 16 May 2012, Ian Campbell wrote:

On Wed, 2012-05-16 at 08:25 +0100, M A Young wrote:
On Wed, 16 May 2012, M A Young wrote:

Pygrub can use a lot of memory if the kernel or ramdisk files in a guest are
very big as it reads them into memory before writing them out again to
temporary files (these can legitimately be big for example the initrd.img
file in a Fedora 16 install is around 130MB ).

This patch allows these files to be copied in one megabyte pieces, and if it
sees any write problems it delets the files and exits. It also only reads up
to the first megabyte of configurations files for grub etc. to avoid problems
here as well (as it is a text file it should actually be much smaller).

This issue was reported by Xinli Niu in the Fedora bug report
https://bugzilla.redhat.com/show_bug.cgi?id=818412 who got it a CVE reference
CVE-2012-2625 .

I realized the first patch was flawed as I was potentially using a file
descriptor after I closed it. This is an untested correction.

I think you might want a couple of closes on datafile in here. Otherwise
it looks good to me (by inspection, I've not run it either).

Yes, that sounds like a good idea. I did test the first version of the patch for basic functionality, though not how well it would handle problem situations.

        Michael Young

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.