mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-24 18:32:28 -05:00
fa8507d1ce
Taking a reference or a pointer to a value that's not aligned properly is undefined behavior. While `[[gnu::packed]]` ensures that reads from and writes to fields of packed structs is a safe operation, the information about the reduced alignment is lost when creating pointers to these values. Weirdly enough, GCC's undefined behavior sanitizer doesn't flag these, even though the doc of `-Waddress-of-packed-member` says that it usually leads to UB. In contrast, x86_64 Clang does flag these, which renders the 64-bit kernel unable to boot. For now, the `address-of-packed-member` warning will only be enabled in the kernel, as it is absolutely crucial there because of KUBSAN, but might get excessively noisy for the userland in the future. Also note that we can't append to `CMAKE_CXX_FLAGS` like we do for other flags in the kernel, because flags added via `add_compile_options` come after these, so the `-Wno-address-of-packed-member` in the root would cancel it out. |
||
---|---|---|
.. | ||
AddressSpace.cpp | ||
AddressSpace.h | ||
AllocationStrategy.h | ||
AnonymousVMObject.cpp | ||
AnonymousVMObject.h | ||
InodeVMObject.cpp | ||
InodeVMObject.h | ||
MappedROM.h | ||
MemoryManager.cpp | ||
MemoryManager.h | ||
PageDirectory.cpp | ||
PageDirectory.h | ||
PageFaultResponse.h | ||
PhysicalPage.cpp | ||
PhysicalPage.h | ||
PhysicalRegion.cpp | ||
PhysicalRegion.h | ||
PhysicalZone.cpp | ||
PhysicalZone.h | ||
PrivateInodeVMObject.cpp | ||
PrivateInodeVMObject.h | ||
ProcessPagingScope.cpp | ||
ProcessPagingScope.h | ||
Region.cpp | ||
Region.h | ||
RingBuffer.cpp | ||
RingBuffer.h | ||
ScatterGatherList.cpp | ||
ScatterGatherList.h | ||
SharedInodeVMObject.cpp | ||
SharedInodeVMObject.h | ||
TypedMapping.h | ||
VirtualRange.cpp | ||
VirtualRange.h | ||
VirtualRangeAllocator.cpp | ||
VirtualRangeAllocator.h | ||
VMObject.cpp | ||
VMObject.h |