Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: d939960fe8b12868072f09000c2a8ae6c8f8cd9d
      
https://github.com/WebKit/WebKit/commit/d939960fe8b12868072f09000c2a8ae6c8f8cd9d
  Author: Chris Dumez <[email protected]>
  Date:   2026-01-16 (Fri, 16 Jan 2026)

  Changed paths:
    M Source/WebKit/NetworkProcess/storage/CacheStorageDiskStore.cpp
    M Source/WebKit/NetworkProcess/storage/CacheStorageDiskStore.h

  Log Message:
  -----------
  Crash under WTF::Persistence::Decoder::operator>>
https://bugs.webkit.org/show_bug.cgi?id=305539
rdar://155698666

Reviewed by Sihui Liu.

We sometimes crash in memcpySpan() in WTF::Persistence::Decoder::operator>>
when decoding data that was just mmap'd from disk. The crash log seems to
indicate the crash is due to apfs rejecting the read due to file protection.

To try and prevent this issue, I am updating CacheStorageDiskStore to rely
on `FileSystem::isSafeToUseMemoryMapForPath()` to determine if it is safe
to mmap or not. If not, we fall back to calling `FileSystem::readEntireFile()`.

* Source/WebKit/NetworkProcess/storage/CacheStorageDiskStore.cpp:
(WebKit::CacheStorageDiskStore::SafeFileData::span const):
(WebKit::CacheStorageDiskStore::SafeFileData::convertToSharedBuffer):
(WebKit::CacheStorageDiskStore::SafeFileData::operator bool const):
(WebKit::CacheStorageDiskStore::SafeFileData::read):
(WebKit::CacheStorageDiskStore::readRecordFromFileData):
(WebKit::CacheStorageDiskStore::readAllRecordInfosInternal):
(WebKit::CacheStorageDiskStore::readRecordsInternal):
* Source/WebKit/NetworkProcess/storage/CacheStorageDiskStore.h:

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



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

Reply via email to