Skip to content
Commit 286c21de authored by Kevin Grandemange's avatar Kevin Grandemange Committed by Christoph Hellwig
Browse files

dma-coherent: fix integer overflow in the reserved-memory dma allocation



pageno is an int and the PAGE_SHIFT shift is done on an int,
overflowing if the memory is bigger than 2G

This can be reproduced using for example a reserved-memory of 4G

reserved-memory {
		    #address-cells = <2>;
		    #size-cells = <2>;
		    ranges;

		    reserved_dma: buffer@0 {
		        compatible = "shared-dma-pool";
		        no-map;
		        reg = <0x5 0x00000000 0x1 0x0>;
        };
};

Signed-off-by: default avatarKevin Grandemange <kevin.grandemange@allegrodvt.com>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
parent 11a48a5a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment