Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F105784967
D10720.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
902 B
Referenced Files
None
Subscribers
None
D10720.diff
View Options
Index: head/sys/arm/mv/mv_common.c
===================================================================
--- head/sys/arm/mv/mv_common.c
+++ head/sys/arm/mv/mv_common.c
@@ -2269,6 +2269,12 @@
entry_size = tuple_size / sizeof(pcell_t);
cpu_wins_no = tuples;
+ /* Check range */
+ if (tuples > nitems(cpu_win_tbl)) {
+ debugf("too many tuples to fit into cpu_win_tbl\n");
+ return (ENOMEM);
+ }
+
for (i = 0, t = 0; t < tuples; i += entry_size, t++) {
cpu_win_tbl[t].target = 1;
cpu_win_tbl[t].attr = fdt32_to_cpu(ranges[i + 1]);
@@ -2301,6 +2307,12 @@
if (fdt_regsize(node, &sram_base, &sram_size) != 0)
return (EINVAL);
+ /* Check range */
+ if (t >= nitems(cpu_win_tbl)) {
+ debugf("cannot fit CESA tuple into cpu_win_tbl\n");
+ return (ENOMEM);
+ }
+
cpu_win_tbl[t].target = MV_WIN_CESA_TARGET;
#ifdef SOC_MV_ARMADA38X
cpu_win_tbl[t].attr = MV_WIN_CESA_ATTR(0);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Dec 21, 4:11 PM (19 h, 25 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15542987
Default Alt Text
D10720.diff (902 B)
Attached To
Mode
D10720: Fix memory corruption while configuring CPU windows on Marvell SoCs
Attached
Detach File
Event Timeline
Log In to Comment