Re: [Qemu-devel] [PATCH] device_tree: check device tree blob file size

2019-03-25 Thread David Gibson
On Mon, Mar 25, 2019 at 04:04:33PM +0530, P J P wrote: > Hello David, > > +-- On Mon, 25 Mar 2019, David Gibson wrote --+ > | The only inherent limit to dtb size should be 2^31-1 bytes (the format > | uses signed 32-bit ints as offsets). > > ~2GB of dtb?! Seems quite big to specify the h/w

Re: [Qemu-devel] [PATCH] device_tree: check device tree blob file size

2019-03-25 Thread Peter Maydell
On Mon, 25 Mar 2019 at 16:11, P J P wrote: > > +-- On Mon, 25 Mar 2019, Peter Maydell wrote --+ > | Noone has complained that it's too small because right now *we do not check > | against it* for the common case of "just load an external dtb". > | > | We should not be imposing an arbitrary limit

Re: [Qemu-devel] [PATCH] device_tree: check device tree blob file size

2019-03-25 Thread P J P
+-- On Mon, 25 Mar 2019, Peter Maydell wrote --+ | Noone has complained that it's too small because right now *we do not check | against it* for the common case of "just load an external dtb". | | We should not be imposing an arbitrary limit within QEMU if we don't need | to. Here, we do not

Re: [Qemu-devel] [PATCH] device_tree: check device tree blob file size

2019-03-25 Thread Peter Maydell
On Mon, 25 Mar 2019 at 10:34, P J P wrote: > IMO, generic 2MB of dtb size limit is reasonable; Considering 64KB is the max > we are seeing, plus QEMU has FDT_MAX_SIZE defined to be 0x10(~1MB), and > noone has complained that it's too small. Noone has complained that it's too small because

Re: [Qemu-devel] [PATCH] device_tree: check device tree blob file size

2019-03-25 Thread P J P
Hello David, +-- On Mon, 25 Mar 2019, David Gibson wrote --+ | The only inherent limit to dtb size should be 2^31-1 bytes (the format | uses signed 32-bit ints as offsets). ~2GB of dtb?! Seems quite big to specify the h/w that a kernel is going to run/boot on. | Indeed there shouldn't be

Re: [Qemu-devel] [PATCH] device_tree: check device tree blob file size

2019-03-24 Thread David Gibson
On Fri, Mar 22, 2019 at 09:14:53AM +, Peter Maydell wrote: > On Fri, 22 Mar 2019 at 07:38, P J P wrote: > > > > From: Prasad J Pandit > > > > Device tree blob(dtb) file can not be larger than 2MB in size.[*] > > Add check to avoid loading large dtb files in load_device_tree(), > > and

Re: [Qemu-devel] [PATCH] device_tree: check device tree blob file size

2019-03-24 Thread David Gibson
On Fri, Mar 22, 2019 at 10:30:51AM +, Peter Maydell wrote: > On Fri, 22 Mar 2019 at 10:11, P J P wrote: > > > > +-- On Fri, 22 Mar 2019, Peter Maydell wrote --+ > > | This document is specific to aarch64, but the part of > > | QEMU's device tree code being modified here is > > | architecture

Re: [Qemu-devel] [PATCH] device_tree: check device tree blob file size

2019-03-22 Thread Peter Maydell
On Fri, 22 Mar 2019 at 10:11, P J P wrote: > > +-- On Fri, 22 Mar 2019, Peter Maydell wrote --+ > | This document is specific to aarch64, but the part of > | QEMU's device tree code being modified here is > | architecture independent. > | > | Cc'ing David Gibson who will probably know if there is

Re: [Qemu-devel] [PATCH] device_tree: check device tree blob file size

2019-03-22 Thread P J P
+-- On Fri, 22 Mar 2019, Peter Maydell wrote --+ | This document is specific to aarch64, but the part of | QEMU's device tree code being modified here is | architecture independent. | | Cc'ing David Gibson who will probably know if there is | an architecture-independent limit on DTB size we

Re: [Qemu-devel] [PATCH] device_tree: check device tree blob file size

2019-03-22 Thread Peter Maydell
On Fri, 22 Mar 2019 at 07:38, P J P wrote: > > From: Prasad J Pandit > > Device tree blob(dtb) file can not be larger than 2MB in size.[*] > Add check to avoid loading large dtb files in load_device_tree(), > and potential integer(dt_size) overflow. > > [*]

[Qemu-devel] [PATCH] device_tree: check device tree blob file size

2019-03-22 Thread P J P
From: Prasad J Pandit Device tree blob(dtb) file can not be larger than 2MB in size.[*] Add check to avoid loading large dtb files in load_device_tree(), and potential integer(dt_size) overflow. [*] linux.git/tree/Documentation/arm64/booting.txt Reported-by: Kurtis Miller Signed-off-by: