Page MenuHomeFreeBSD

Prevent unaligned access when addr_cells != size_cells.
Needs ReviewPublic

Authored by br on Feb 26 2016, 3:00 PM.
Tags
None
Referenced Files
Unknown Object (File)
Dec 26 2023, 1:55 PM
Unknown Object (File)
Dec 17 2023, 12:06 PM
Unknown Object (File)
Sep 30 2023, 7:23 PM
Unknown Object (File)
Sep 21 2023, 10:30 PM
Unknown Object (File)
Apr 20 2023, 2:27 PM
Unknown Object (File)
Dec 13 2016, 7:42 AM
Unknown Object (File)
Nov 4 2016, 7:54 PM
Unknown Object (File)
Sep 22 2016, 5:47 AM
Subscribers

Details

Reviewers
None
Group Reviewers
ARM

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

br retitled this revision from to Prevent unaligned access when addr_cells != size_cells..
br updated this object.
br edited the test plan for this revision. (Show Details)
br added a reviewer: ARM.

This feels wrong, you should be using OF_getencprop to read the data.

ian added inline comments.
sys/dev/fdt/fdt_common.c
412

For starters I agree with Andy's comment. I'm having a hard time coming up with a reason why OF_getencprop() wouldn't work and fdt_data_get() would have to be used instead.

That said, this is wrong; it only works on little-endian systems. The correct approach would be to do what OF_getencprop() does: ignore the low-quality fdtNN_to_cpu() code and just use be32toh() on each cell individually.