Page MenuHomeFreeBSD

Fix memory corruption while configuring CPU windows on Marvell SoCs
ClosedPublic

Authored by mw_semihalf.com on May 14 2017, 12:58 AM.
Tags
Referenced Files
Unknown Object (File)
Sat, Apr 6, 10:28 PM
Unknown Object (File)
Thu, Mar 28, 5:38 PM
Unknown Object (File)
Thu, Mar 28, 10:21 AM
Unknown Object (File)
Feb 18 2024, 7:35 AM
Unknown Object (File)
Jan 29 2024, 8:38 PM
Unknown Object (File)
Jan 15 2024, 3:04 PM
Unknown Object (File)
Dec 22 2023, 11:02 PM
Unknown Object (File)
Dec 18 2023, 4:30 PM

Details

Summary

Resolving CPU windows from localbus entry caused buffer overflow
and memory corruption. Fix wrong indexing and ensure the index
does not exceed table size.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

I think it is easier to use nitems() here.

sys/arm/mv/mv_common.c
2158 ↗(On Diff #28320)

if (tuples > nitems(cpu_win_tbl)) {

2196 ↗(On Diff #28320)

if (t >= nitems(cpu_win_tbl)) {

Switched to nitems, thanks for the suggestion.

This revision was automatically updated to reflect the committed changes.