Page MenuHomeFreeBSD

Use unsigned intptr_t type for framebuffer addresses
ClosedPublic

Authored by jhibbits on Dec 2 2017, 1:48 AM.

Details

Summary

Some architectures (powerpc Book-E) have a vm_paddr_t larger than intptr_t.
Casting from the intptr_t to vm_paddr_t causes sign extension, leading to a
potentially invalid address.

This was seen when running X on a PowerPC P1022 machine, which mapped the
backing framebuffer at 0xc1800000. When mmap()d by X, this yielded an invalid
address of 0xffffffffc1800000, or, as the hardware would see it, 0xfc1800000.

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

jhibbits created this revision.Dec 2 2017, 1:48 AM
ray accepted this revision.Dec 5 2017, 11:03 PM

Correct. Thank you!

This revision is now accepted and ready to land.Dec 5 2017, 11:03 PM
This revision was automatically updated to reflect the committed changes.