Page MenuHomeFreeBSD

stand: Avoid unaligned access in smbios code
ClosedPublic

Authored by imp on Apr 25 2023, 4:25 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 15 2024, 1:21 AM
Unknown Object (File)
Mar 15 2024, 1:20 AM
Unknown Object (File)
Mar 15 2024, 1:20 AM
Unknown Object (File)
Mar 15 2024, 1:20 AM
Unknown Object (File)
Mar 11 2024, 9:48 AM
Unknown Object (File)
Jan 14 2024, 9:36 AM
Unknown Object (File)
Dec 26 2023, 2:11 PM
Unknown Object (File)
Dec 20 2023, 2:08 AM
Subscribers

Details

Summary

This code was written on x86 where unaligned accesses were
easy. However, in some environments fault on unaligned access, so use
memcpy instead of dereferencing unaligned pointers.

Sponsored by: Netflix

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

imp requested review of this revision.Apr 25 2023, 4:25 AM
diizzy added inline comments.
stand/libsa/smbios.c
100

unalgined --> unaligned

Better comments on why we use memcpy, also add a note this data is LE, so add
the leXtoh macros for it, though they will be no-ops on all FreeBSD's supported
platforms.

This revision was not accepted when it landed; it landed in state Needs Review.May 1 2023, 9:29 PM
This revision was automatically updated to reflect the committed changes.