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)
Feb 17 2024, 1:01 AM
Unknown Object (File)
Jan 19 2024, 10:48 AM
Unknown Object (File)
Dec 22 2023, 9:09 PM
Unknown Object (File)
Nov 2 2023, 2:53 PM
Unknown Object (File)
Oct 27 2023, 6:14 PM
Unknown Object (File)
Sep 12 2023, 6:48 AM
Unknown Object (File)
Sep 4 2023, 2:06 AM
Unknown Object (File)
Aug 15 2023, 10:43 AM

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).