Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 77ee6ae99343f8819e9b1f12fffa4beac050f2bb
      
https://github.com/WebKit/WebKit/commit/77ee6ae99343f8819e9b1f12fffa4beac050f2bb
  Author: Chris Dumez <[email protected]>
  Date:   2026-06-09 (Tue, 09 Jun 2026)

  Changed paths:
    M Source/WebKit/NetworkProcess/storage/OriginStorageManager.cpp

  Log Message:
  -----------
  Background Fetch and Cache Storage share a single resolved-path member
https://bugs.webkit.org/show_bug.cgi?id=316612

Reviewed by Youenn Fablet.

OriginStorageManager::StorageBucket::resolvedBackgroundFetchStoragePath() reads
from and writes to m_resolvedCacheStoragePath instead of its own member. The
two storage types resolve to different on-disk subdirectories
("CacheStorage" vs "BackgroundFetchStorage") via typeStoragePath(), but both
accessors cache through one field, so whichever method runs first wins:

  - If Background Fetch is touched first, the field is populated with the
    BackgroundFetchStorage path, and the subsequent resolvedCacheStoragePath()
    short-circuits at its `!m_resolvedCacheStoragePath.isNull()` check and
    returns the Background Fetch path. CacheStorageManager is then constructed
    pointing at the wrong directory, and the Standard-level migration that
    moves m_customCacheStoragePath into the new location is silently skipped.

  - If Cache Storage is touched first, resolvedBackgroundFetchStoragePath()
    finds the field non-null and returns the CacheStorage path, so
    BackgroundFetchStoreManager writes its records into the Cache Storage
    directory.

Either way, one of the two features ends up reading and writing files in the
other feature's on-disk directory.

Fix by giving Background Fetch its own m_resolvedBackgroundFetchStoragePath
member, mirroring the pattern used for IDB and LocalStorage.

* Source/WebKit/NetworkProcess/storage/OriginStorageManager.cpp:
(WebKit::OriginStorageManager::StorageBucket::resolvedBackgroundFetchStoragePath):

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



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

Reply via email to