Florian Fainelli
30dc2effc7
ARM: 9216/1: Fix MAX_DMA_ADDRESS overflow
...
[ Upstream commit fb0fd3469e ]
Commit 26f09e9b3a ("mm/memblock: add memblock memory allocation apis")
added a check to determine whether arm_dma_zone_size is exceeding the
amount of kernel virtual address space available between the upper 4GB
virtual address limit and PAGE_OFFSET in order to provide a suitable
definition of MAX_DMA_ADDRESS that should fit within the 32-bit virtual
address space. The quantity used for comparison was off by a missing
trailing 0, leading to MAX_DMA_ADDRESS to be overflowing a 32-bit
quantity.
This was caught thanks to CONFIG_DEBUG_VIRTUAL on the bcm2711 platform
where we define a dma_zone_size of 1GB and we have a PAGE_OFFSET value
of 0xc000_0000 (CONFIG_VMSPLIT_3G) leading to MAX_DMA_ADDRESS being
0x1_0000_0000 which overflows the unsigned long type used throughout
__pa() and then __virt_addr_valid(). Because the virtual address passed
to __virt_addr_valid() would now be 0, the function would loudly warn
and flood the kernel log, thus making the platform unable to boot
properly.
Fixes: 26f09e9b3a ("mm/memblock: add memblock memory allocation apis")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com >
Reviewed-by: Linus Walleij <linus.walleij@linaro.org >
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2022-08-03 12:03:55 +02:00
..
2021-02-01 19:44:30 +00:00
2022-07-21 21:24:16 +02:00
2020-08-06 10:57:30 +02:00
2021-04-23 11:33:50 +02:00
2022-07-12 16:35:08 +02:00
2019-06-25 19:49:18 +02:00
2021-01-21 17:42:46 +00:00
2019-06-19 17:09:07 +02:00
2009-12-12 13:08:14 +01:00
2022-03-11 12:22:35 +01:00
2021-05-26 13:20:50 +02:00
2015-03-27 22:20:45 +00:00
2019-02-01 22:05:50 +00:00
2018-07-30 11:45:53 +01:00
2017-11-02 11:10:55 +01:00
2019-06-19 17:09:55 +02:00
2021-05-07 00:26:34 -07:00
2019-06-19 17:09:55 +02:00
2020-10-25 14:51:49 -07:00
2021-09-03 09:58:13 -07:00
2017-11-02 11:10:55 +01:00
2020-08-20 15:45:16 -04:00
2020-03-21 15:23:54 +01:00
2021-05-26 13:20:50 +02:00
2017-11-02 11:10:55 +01:00
2020-03-21 15:24:03 +01:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2021-06-28 14:04:24 -07:00
2019-01-02 10:37:05 +00:00
2017-11-02 11:10:55 +01:00
2019-06-05 17:36:37 +02:00
2017-11-02 11:10:55 +01:00
2020-06-30 11:59:48 +02:00
2021-08-20 11:39:28 +01:00
2020-09-25 06:15:32 +02:00
2020-10-06 07:07:05 +02:00
2020-10-06 07:07:05 +02:00
2022-08-03 12:03:55 +02:00
2019-06-19 17:09:55 +02:00
2019-10-10 22:23:19 +01:00
2017-11-02 11:10:55 +01:00
2019-05-30 11:29:52 -07:00
2022-01-05 12:42:34 +01:00
2020-12-22 13:34:27 -08:00
2017-11-02 11:10:55 +01:00
2017-12-17 22:14:21 +00:00
2008-08-02 21:32:35 +01:00
2017-11-02 11:10:55 +01:00
2019-06-19 17:09:55 +02:00
2020-12-22 13:34:27 -08:00
2020-05-12 19:34:52 +03:00
2019-06-05 17:37:06 +02:00
2021-08-04 13:30:04 +02:00
2021-06-07 12:56:20 +01:00
2020-05-07 00:41:47 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2021-08-10 12:16:07 +01:00
2020-11-23 10:31:05 +01:00
2020-12-04 23:35:34 +01:00
2019-06-05 17:37:06 +02:00
2020-06-03 20:09:46 -07:00
2019-11-15 22:21:08 +00:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2021-03-31 09:16:55 +01:00
2017-11-02 11:10:55 +01:00
2020-10-25 14:51:49 -07:00
2021-06-07 12:56:20 +01:00
2022-05-18 10:26:56 +02:00
2017-11-02 11:10:55 +01:00
2020-11-23 10:31:05 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2020-10-27 12:11:08 +00:00
2020-10-27 12:11:10 +00:00
2020-12-29 15:36:49 -08:00
2021-02-05 10:23:29 +00:00
2021-03-09 10:25:35 +00:00
2018-05-19 11:53:46 +01:00
2020-10-27 12:11:51 +00:00
2018-10-17 13:14:33 -07:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2019-06-19 17:09:55 +02:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2021-08-10 12:17:25 +01:00
2020-10-26 16:45:06 +01:00
2017-11-16 12:50:35 -08:00
2021-06-07 12:56:20 +01:00
2020-09-25 00:36:41 +09:00
2018-05-19 11:53:46 +01:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2020-03-18 12:27:04 +01:00
2019-05-30 11:26:41 -07:00
2019-05-21 11:28:39 +02:00
2019-06-19 17:09:55 +02:00
2019-06-05 17:37:06 +02:00
2019-06-19 17:09:55 +02:00
2020-04-10 15:36:21 -07:00
2021-03-11 16:17:52 +01:00
2017-11-02 11:10:55 +01:00
2019-10-27 21:14:40 +00:00
2020-07-30 13:01:04 -07:00
2019-06-19 17:09:55 +02:00
2021-07-01 11:06:03 -07:00
2019-06-19 17:09:55 +02:00
2019-06-05 17:37:06 +02:00
2020-12-22 13:34:27 -08:00
2019-06-05 17:37:06 +02:00
2019-06-05 17:37:06 +02:00
2021-07-08 11:48:22 -07:00
2019-06-19 17:09:55 +02:00
2020-06-09 09:39:14 -07:00
2021-06-07 12:55:30 +01:00
2019-05-30 11:26:41 -07:00
2019-06-19 17:09:55 +02:00
2022-02-01 17:26:59 +01:00
2019-06-19 17:09:55 +02:00
2020-10-27 12:10:59 +00:00
2019-05-30 11:26:41 -07:00
2019-06-03 15:49:07 +02:00
2022-07-21 21:24:12 +02:00
2020-11-20 11:16:34 -08:00
2020-03-24 10:56:05 +00:00
2018-05-08 14:50:42 +02:00
2021-04-18 19:15:11 +01:00
2020-10-25 14:51:49 -07:00
2017-11-02 11:10:55 +01:00
2020-11-23 10:31:05 -06:00
2017-11-02 11:10:55 +01:00
2017-11-16 14:05:12 -08:00
2019-02-01 21:44:10 +00:00
2020-10-25 14:51:49 -07:00
2017-11-02 11:10:55 +01:00
2022-03-16 14:23:42 +01:00
2017-11-02 11:10:55 +01:00
2021-03-22 02:45:52 +01:00
2018-12-12 13:20:07 -08:00
2017-11-02 11:10:55 +01:00
2020-10-27 12:11:06 +00:00
2019-02-26 11:32:54 +00:00
2017-11-02 11:10:55 +01:00
2019-12-08 14:37:32 +01:00
2021-05-26 13:20:50 +02:00
2021-08-20 11:39:26 +01:00
2017-11-02 11:10:55 +01:00
2021-06-13 18:16:48 +01:00
2020-10-25 14:51:49 -07:00
2017-11-02 11:10:55 +01:00
2021-09-09 13:25:49 -07:00
2019-06-19 17:09:55 +02:00
2022-05-30 09:29:14 +02:00
2020-10-13 18:38:31 -07:00
2021-06-29 10:53:52 -07:00
2017-11-02 11:10:55 +01:00
2020-10-08 17:17:27 +02:00
2020-06-09 09:39:10 -07:00
2021-08-20 11:39:27 +01:00
2022-02-01 17:26:59 +01:00
2021-08-04 13:30:04 +02:00
2021-08-20 11:39:28 +01:00
2019-07-11 10:09:44 -07:00
2020-06-09 09:39:10 -07:00
2019-06-19 17:09:55 +02:00
2017-11-02 11:10:55 +01:00
2019-02-01 21:44:19 +00:00
2019-11-15 22:21:12 +00:00
2018-03-24 14:27:49 +00:00
2020-04-23 10:50:26 +09:00
2020-07-21 16:33:39 +01:00
2020-07-21 16:33:39 +01:00
2017-11-02 11:10:55 +01:00
2020-03-24 10:56:05 +00:00
2019-12-10 10:12:55 +01:00
2022-03-11 12:22:35 +01:00
2017-11-02 11:10:55 +01:00
2019-06-19 17:09:55 +02:00