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)
Tue, May 21, 9:20 PM
Unknown Object (File)
Tue, May 14, 2:15 AM
Unknown Object (File)
Mon, May 13, 6:51 AM
Unknown Object (File)
Wed, May 1, 9:58 PM
Unknown Object (File)
Mon, Apr 29, 10:06 PM
Unknown Object (File)
Sat, Apr 27, 3:54 PM
Unknown Object (File)
Fri, Apr 26, 1:35 PM
Unknown Object (File)
Thu, Apr 25, 7:58 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 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.