Skip to content

Commit

Permalink
core: lpae: fix 'idx' boundary check in core_mmu_entry_to_finer_grain…
Browse files Browse the repository at this point in the history
…ed()

Table entry index, 'idx', was checked for [0, tbl_info->num_entries],
while it should be [0, tbl_info->num_entries[.

Signed-off-by: Izik Dubnov <[email protected]>
Reviewed-by: Etienne Carriere <[email protected]>
Reviewed-by: Jens Wiklander <[email protected]>
  • Loading branch information
Izik Dubnov authored and jforissier committed Sep 8, 2021
1 parent 39ef71a commit 2ac1236
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/arch/arm/mm/core_mmu_lpae.c
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,7 @@ bool core_mmu_entry_to_finer_grained(struct core_mmu_table_info *tbl_info,
#endif
assert(prtn);

if (tbl_info->level >= 3 || idx > tbl_info->num_entries)
if (tbl_info->level >= 3 || idx >= tbl_info->num_entries)
return false;

entry = (uint64_t *)tbl_info->table + idx;
Expand Down

0 comments on commit 2ac1236

Please sign in to comment.