qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] Re: [SeaBIOS] [PATCH 2/2] seabios: pciinit: fix overflow wh


From: Isaku Yamahata
Subject: [Qemu-devel] Re: [SeaBIOS] [PATCH 2/2] seabios: pciinit: fix overflow when bar allocation.
Date: Tue, 27 Jul 2010 18:11:39 +0900
User-agent: Mutt/1.5.19 (2009-01-05)

On Mon, Jul 26, 2010 at 09:45:42PM -0400, Kevin O'Connor wrote:
> On Mon, Jul 26, 2010 at 02:02:46PM +0900, Isaku Yamahata wrote:
> > When allocating bar, overflow can occur.
> > So add overflow check and don't allocate bar if overflowed.
> > Overflow check is ugly, but necessary.
> > Another suggested way is to change related variables u64 from u32
> > thus overflow can't occur because the related value are all u32 addressable.
> > Anyway even with u64, it is necessary to the resulted value > max_u32.
> 
> I wonder if we could create malloc zones for this and then use
> pmm_alloc.  The pmm_alloc function already handles overflow and
> alignments.
> 
> One difficulty, though, is that pmm_alloc doesn't guarentee linear
> allocations, and it looks like pci_bios_init_device_bridge assumes
> this.

Yes, contiguous allocation is necessary for bridge filtering.
Anyway I'll give pmm_malloc() a try and see what can be done.
-- 
yamahata



reply via email to

[Prev in Thread] Current Thread [Next in Thread]