Changeset 187547 in webkit
- Timestamp:
- Jul 29, 2015, 8:52:27 AM (10 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r187544 r187547 1 2015-07-29 Michael Catanzaro <mcatanzaro@igalia.com> 2 3 [Seccomp] Further improvements to default web process policy 4 https://bugs.webkit.org/show_bug.cgi?id=142987 5 6 Provide various helper functions to allow more flexible construction of 7 filesystem access policies. 8 9 Reviewed by Žan Doberšek. 10 11 Improve the policy. Also, remove ifdefs to reduce potential for breakage in non-default 12 configurations. 13 14 * Shared/linux/SeccompFilters/SyscallPolicy.cpp: 15 (WebKit::SyscallPolicy::addDefaultWebProcessPolicy): 16 1 17 2015-07-29 Chris Dumez <cdumez@apple.com> 2 18 -
trunk/Source/WebKit2/Shared/linux/SeccompFilters/SyscallPolicy.cpp
r187190 r187547 31 31 #include "PluginSearchPath.h" 32 32 #include "WebProcessCreationParameters.h" 33 #include "XDGBaseDirectory.h" 33 34 #include <libgen.h> 34 35 #include <string.h> … … 152 153 addDirectoryPermission(ASCIILiteral("/"), NotAllowed); 153 154 154 // S hared libraries, plugins and fonts.155 // System library directories 155 156 addDirectoryPermission(ASCIILiteral("/lib"), Read); 156 157 addDirectoryPermission(ASCIILiteral("/lib32"), Read); … … 159 160 addDirectoryPermission(ASCIILiteral("/usr/lib32"), Read); 160 161 addDirectoryPermission(ASCIILiteral("/usr/lib64"), Read); 162 addDirectoryPermission(ASCIILiteral("/usr/local/lib"), Read); 163 addDirectoryPermission(ASCIILiteral("/usr/local/lib32"), Read); 164 addDirectoryPermission(ASCIILiteral("/usr/local/lib64"), Read); 165 addDirectoryPermission(ASCIILiteral(LIBDIR), Read); 166 167 // System data directories 161 168 addDirectoryPermission(ASCIILiteral("/usr/share"), Read); 162 163 // Support for alternative install prefixes, e.g. /usr/local. 169 addDirectoryPermission(ASCIILiteral("/usr/local/share"), Read); 164 170 addDirectoryPermission(ASCIILiteral(DATADIR), Read); 165 addDirectoryPermission(ASCIILiteral(LIBDIR), Read); 166 167 // Plugin search path 171 172 // NPAPI plugins 168 173 for (String& path : pluginsDirectories()) 169 174 addDirectoryPermission(path, Read); … … 171 176 // SSL Certificates. 172 177 addDirectoryPermission(ASCIILiteral("/etc/ssl/certs"), Read); 173 174 // Fontconfig cache.175 addDirectoryPermission(ASCIILiteral("/etc/fonts"), Read);176 addDirectoryPermission(ASCIILiteral("/var/cache/fontconfig"), Read);177 178 178 179 // Audio devices, random number generators, etc. … … 221 222 addDirectoryPermission("/run/user/" + String::number(getuid()), ReadAndWrite); 222 223 223 // Needed by WebKit's memory pressure handler 224 // Needed by WebKit's memory pressure handler. 224 225 addFilePermission(ASCIILiteral("/sys/fs/cgroup/memory/memory.pressure_level"), Read); 225 226 addFilePermission(ASCIILiteral("/sys/fs/cgroup/memory/cgroup.event_control"), Read); 226 227 227 char* homeDir = getenv("HOME"); 228 if (homeDir) { 229 // X11 connection token. 230 addFilePermission(String::fromUTF8(homeDir) + "/.Xauthority", Read); 231 } 228 // X11 connection token. 229 addFilePermission(userHomeDirectory() + "/.Xauthority", Read); 232 230 233 231 // MIME type resolution. 234 char* dataHomeDir = getenv("XDG_DATA_HOME"); 235 if (dataHomeDir) 236 addDirectoryPermission(String::fromUTF8(dataHomeDir) + "/mime", Read); 237 else if (homeDir) 238 addDirectoryPermission(String::fromUTF8(homeDir) + "/.local/share/mime", Read); 239 240 #if ENABLE(WEBGL) || ENABLE(ACCELERATED_2D_CANVAS) 241 // Needed on most non-Debian distros by libxshmfence <= 1.1, or newer 242 // libxshmfence with older kernels (linux <= 3.16), for DRI3 shared memory. 243 // FIXME Try removing this permission when we can rely on a newer libxshmfence. 244 // See http://code.google.com/p/chromium/issues/detail?id=415681 245 addDirectoryPermission(ASCIILiteral("/var/tmp"), ReadAndWrite); 246 247 // Optional Mesa DRI configuration file 248 addFilePermission(ASCIILiteral("/etc/drirc"), Read); 249 if (homeDir) 250 addFilePermission(String::fromUTF8(homeDir) + "/.drirc", Read); 251 252 // Mesa uses udev. 232 addDirectoryPermission(userDataDirectory() + "/mime", Read); 233 234 // Needed by NVIDIA proprietary graphics driver. 235 addDirectoryPermission(userHomeDirectory() + "/.nv", ReadAndWrite); 236 237 // Needed by udev. 253 238 addDirectoryPermission(ASCIILiteral("/etc/udev"), Read); 254 239 addDirectoryPermission(ASCIILiteral("/run/udev"), Read); … … 256 241 addDirectoryPermission(ASCIILiteral("/sys/class"), Read); 257 242 addDirectoryPermission(ASCIILiteral("/sys/devices"), Read); 258 #endif 259 260 // Needed by NVIDIA proprietary graphics driver 261 if (homeDir) 262 addDirectoryPermission(String::fromUTF8(homeDir) + "/.nv", ReadAndWrite); 243 244 // PulseAudio 245 addFilePermission(ASCIILiteral("/etc/asound.conf"), Read); 246 addDirectoryPermission(userConfigDirectory() + "/.pulse", Read); 247 addDirectoryPermission(userHomeDirectory() + "/.pulse", Read); 248 249 // Mesa 250 addFilePermission(ASCIILiteral("/etc/drirc"), Read); 251 addFilePermission(userHomeDirectory() + "/.drirc", Read); 252 addFilePermission(ASCIILiteral("/sys/fs/selinux/booleans/allow_execmem"), Read); 253 254 // GStreamer 255 addDirectoryPermission(String::fromUTF8(LIBEXECDIR) + "/gstreamer-1.0", Read); 256 addDirectoryPermission(userDataDirectory() + "/gstreamer-1.0", Read); 257 addDirectoryPermission(userCacheDirectory() + "/gstreamer-1.0", ReadAndWrite); 258 addDirectoryPermission(userHomeDirectory() + "/.frei0r-1", ReadAndWrite); 259 if (char* gstreamerPluginDirectory = getenv("GST_PLUGIN_PATH_1_0")) 260 addDirectoryPermission(gstreamerPluginDirectory, Read); 261 if (char* gstreamerRegistryFile = getenv("GST_REGISTRY_1_0")) 262 addFilePermission(gstreamerRegistryFile, ReadAndWrite); 263 264 // Fontconfig 265 addDirectoryPermission(userCacheDirectory() + "/fontconfig", ReadAndWrite); 266 addDirectoryPermission(userConfigDirectory() + "/fontconfig", Read); 267 addDirectoryPermission(userConfigDirectory() + "/fonts", Read); 268 addDirectoryPermission(userDataDirectory() + "/fonts", Read); 269 addDirectoryPermission(userHomeDirectory() + "/fontconfig", Read); 270 addDirectoryPermission(userHomeDirectory() + "/.fonts", Read); 271 addDirectoryPermission(ASCIILiteral("/etc/fonts"), Read); 272 addDirectoryPermission(ASCIILiteral("/var/cache/fontconfig"), Read); 263 273 264 274 #if ENABLE(DEVELOPER_MODE) && defined(SOURCE_DIR) … … 266 276 // from the build root directory and they also need access to layout test 267 277 // files. 268 char* sourceDir = canonicalize_file_name(SOURCE_DIR); 269 if (sourceDir) { 270 addDirectoryPermission(String::fromUTF8(sourceDir), SyscallPolicy::ReadAndWrite); 271 free(sourceDir); 272 } 278 addDirectoryPermission(String::fromUTF8(SOURCE_DIR), SyscallPolicy::ReadAndWrite); 273 279 #endif 274 280 }
Note:
See TracChangeset
for help on using the changeset viewer.