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
F161137461: D10720.diff
Tue, Jun 30, 9:23 PM
F161094457: D10720.id28783.diff
Tue, Jun 30, 12:26 PM
Unknown Object (File)
Sat, Jun 27, 4:37 PM
Unknown Object (File)
Mon, Jun 22, 8:12 PM
Unknown Object (File)
Mon, Jun 22, 12:11 AM
Unknown Object (File)
May 28 2026, 6:01 PM
Unknown Object (File)
May 28 2026, 6:01 PM
Unknown Object (File)
May 26 2026, 7:30 AM

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 Skipped
Unit
Tests Skipped

Event Timeline

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

sys/arm/mv/mv_common.c
2158

if (tuples > nitems(cpu_win_tbl)) {

2196

if (t >= nitems(cpu_win_tbl)) {

Switched to nitems, thanks for the suggestion.

This revision was automatically updated to reflect the committed changes.