Page MenuHomeFreeBSD

Fix cross-endian ELF note file / memory conversion
ClosedPublic

Authored by emaste on Dec 2 2014, 8:19 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Nov 14, 11:38 AM
Unknown Object (File)
Oct 5 2024, 12:25 AM
Unknown Object (File)
Oct 3 2024, 5:02 PM
Unknown Object (File)
Sep 30 2024, 9:18 PM
Unknown Object (File)
Sep 26 2024, 1:50 PM
Unknown Object (File)
Sep 23 2024, 8:42 PM
Unknown Object (File)
Sep 21 2024, 2:00 AM
Unknown Object (File)
Sep 8 2024, 4:27 PM

Details

Summary

The problem was identified in r273443 but the fix was applied to the wrong place. The sizes are in native order after swapping for the file to memory case, and before swapping in the memory to file case.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

emaste retitled this revision from to Fix cross-endian ELF note file / memory conversion.
emaste updated this object.
emaste edited the test plan for this revision. (Show Details)
emaste added reviewers: marcel, adrian.
emaste added a subscriber: Unknown Object (MLST).
adrian edited edge metadata.
This revision is now accepted and ready to land.Dec 2 2014, 8:25 PM

The first part of the diff is wrong because ROUNDUP2 is called *after* the bytes are swapped. That's exactly the thing you can't do that was fixed by my commit. The second part is correct in that it fixes exactly this problem.

In D1257#6, @marcel wrote:

The first part of the diff is wrong because ROUNDUP2 is called *after* the bytes are swapped.

ROUNDUP2 has to be called with the values in native endianness, which is after swapping in the file-to-memory case.

brooks added a reviewer: brooks.

Ah yes. The first part is in the reader. One needs to swap first.

emaste updated this revision to Diff 2609.

Closed by commit rS275430 (authored by @emaste).