[webkit-changes] [WebKit/WebKit] 129308: [WTF] Open files with O_CLOEXEC by default to avoi...
Olivier Blin
noreply at github.com
Thu Oct 3 09:02:03 PDT 2024
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 12930853a9a4aeb949671ea580852caecaa4eeb4
https://github.com/WebKit/WebKit/commit/12930853a9a4aeb949671ea580852caecaa4eeb4
Author: Olivier Blin <olivier.blin at softathome.com>
Date: 2024-10-03 (Thu, 03 Oct 2024)
Changed paths:
M Source/WTF/wtf/cocoa/FileSystemCocoa.mm
M Source/WTF/wtf/posix/FileSystemPOSIX.cpp
Log Message:
-----------
[WTF] Open files with O_CLOEXEC by default to avoid file handles leak
https://bugs.webkit.org/show_bug.cgi?id=277734
Reviewed by Michael Catanzaro.
FileSystemPOSIX opens files without the O_CLOEXEC file in openFile()
and openTemporaryFile().
This can cause file handles to be leaked to subprocess.
For example, if the UIProcess opens content rules files from the
ContentRuleListStore class before the NetworkProcess is spawned, the
content rules file handles are leaked to the NetworkProcess.
It does not seem useful to open files without O_CLOEXEC.
Also fix FileSystemCocoa for createTemporaryZipArchive().
* Source/WTF/wtf/posix/FileSystemPOSIX.cpp:
(WTF::FileSystemImpl::openFile):
(WTF::FileSystemImpl::openTemporaryFile):
* Source/WTF/wtf/cocoa/FileSystemCocoa.mm:
(WTF::FileSystemImpl::createTemporaryZipArchive):
(WTF::FileSystemImpl::openTemporaryFile):
Canonical link: https://commits.webkit.org/284612@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