Re: [PATCH] x86: add boundary check for 32bit res before expand e820 resource to alignment -v2

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

 



* Yinghai Lu <yinghai@xxxxxxxxxx> wrote:

> +#define MAX_RESOURCE_SIZE ((resource_size_t)-1)

> +		end = round_up(start, ram_alignment(start)) - 1;
> +		if (end > MAX_RESOURCE_SIZE)
> +			end = MAX_RESOURCE_SIZE;

As Andrew noted it, this should probably have a comment along the 
lines of:

		/*
		 * Clip entries that go beyond our maximum resource 
		 * awareness limit to the max. If we accepted them
		 * blindly we'd get random rounding artifacts and a 
		 * possibly messed up resource tree and boot 
		 * failures:
		 */
		if (end > MAX_RESOURCE_SIZE)
			end = MAX_RESOURCE_SIZE;

	Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux