[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] Re: [SeaBIOS] [PATCH 2/2] seabios: pciinit: fix overflow wh
[Qemu-devel] Re: [SeaBIOS] [PATCH 2/2] seabios: pciinit: fix overflow when bar allocation.
Mon, 26 Jul 2010 21:45:42 -0400
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
One difficulty, though, is that pmm_alloc doesn't guarentee linear
allocations, and it looks like pci_bios_init_device_bridge assumes