[webkit-changes] [WebKit/WebKit] f73ebb: [libpas][PGM] PGM allocations should respect minim...

Dan Hecht noreply at github.com
Thu Jan 23 19:49:30 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: f73ebb626eaa3d3426f082e65aadfdc560844b76
      https://github.com/WebKit/WebKit/commit/f73ebb626eaa3d3426f082e65aadfdc560844b76
  Author: Dan Hecht <dan.hecht at apple.com>
  Date:   2025-01-23 (Thu, 23 Jan 2025)

  Changed paths:
    M Source/bmalloc/libpas/src/libpas/pas_probabilistic_guard_malloc_allocator.c
    M Source/bmalloc/libpas/src/test/PGMTests.cpp

  Log Message:
  -----------
  [libpas][PGM] PGM allocations should respect minimum alignment
https://bugs.webkit.org/show_bug.cgi?id=286429
rdar://143439034

Reviewed by Keith Miller.

PGM allocations need to be aligned. When 'right_align==false', allocations
are aligned to the page boundary, so there is no problem in that case.

However, when 'right_align==true', the returned allocation starts at
'size' bytes prior to a page boundary. When 'size' is some unaligned
amount, this causes the allocation to be unaligned.

Various places in JSC assume the alignment of all byte buffers regardless
of their sizes (which is a valid assumption since malloc memory must be aligned
for any type) in order to use the low bits to store metadata. So this bug causes
various issues in JSC when one of these odd sized byte buffers is allocated
in PGM mode.

* Source/bmalloc/libpas/src/libpas/pas_probabilistic_guard_malloc_allocator.c:
(pas_probabilistic_guard_malloc_allocate):
* Source/bmalloc/libpas/src/test/PGMTests.cpp:
(std::checkMalloc):
(std::testPGMSingleAlloc):
(std::testPGMMultipleAlloc):
(std::testPGMRealloc):
(std::testPGMMetaData):
(std::testPGMErrors):
(std::testPGMMetadataVectorManagement):
(std::testPGMMetadataVectorManagementFewDeallocations):
(std::testPGMMetadataDoubleFreeBehavior):
(std::testPGMMetadataVectorManagementRehash):

Canonical link: https://commits.webkit.org/289327@main



To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications


More information about the webkit-changes mailing list