| Differences between
and this patch
- a/ChangeLog +11 lines
Lines 1-3 a/ChangeLog_sec1
1
2015-01-04  Michael Catanzaro  <mcatanzaro@igalia.com>
2
3
        [GTK] Add seccomp filters support
4
        https://bugs.webkit.org/show_bug.cgi?id=110014
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        Find needed compiler and linker flags for libseccomp.
9
10
        * Source/cmake/OptionsGTK.cmake:
11
1
2015-04-01  Alex Christensen  <achristensen@webkit.org>
12
2015-04-01  Alex Christensen  <achristensen@webkit.org>
2
13
3
        Progress towards CMake on Windows and Mac.
14
        Progress towards CMake on Windows and Mac.
- a/Source/WebKit2/ChangeLog +18 lines
Lines 1-5 a/Source/WebKit2/ChangeLog_sec1
1
2015-01-04  Michael Catanzaro  <mcatanzaro@igalia.com>
1
2015-01-04  Michael Catanzaro  <mcatanzaro@igalia.com>
2
2
3
        [GTK] Add seccomp filters support
4
        https://bugs.webkit.org/show_bug.cgi?id=110014
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        Based on work by Thiago Marcos P. Santos <thiago.santos@intel.com>
9
10
        * PlatformGTK.cmake: Support ENABLE_SECCOMP_FILTERS build option.
11
        * WebProcess/gtk/SeccompFiltersWebProcessGtk.cpp: Added.
12
        (WebKit::SeccompFiltersWebProcessGtk::SeccompFiltersWebProcessGtk):
13
        (WebKit::SeccompFiltersWebProcessGtk::platformInitialize):
14
        * WebProcess/gtk/SeccompFiltersWebProcessGtk.h: Added.
15
        * WebProcess/soup/WebProcessSoup.cpp:
16
        (WebKit::WebProcess::platformInitializeWebProcess): Initialize default
17
        GTK+ web process seccomp filters.
18
19
2015-01-04  Michael Catanzaro  <mcatanzaro@igalia.com>
20
3
        [GTK] Rename LIBEXECDIR to PKGLIBEXECDIR
21
        [GTK] Rename LIBEXECDIR to PKGLIBEXECDIR
4
        https://bugs.webkit.org/show_bug.cgi?id=140070
22
        https://bugs.webkit.org/show_bug.cgi?id=140070
5
23
- a/Source/WebKit2/PlatformGTK.cmake +21 lines
Lines 9-17 configure_file(webkit2gtk-web-extension.pc.in ${WebKit2WebExtension_PKGCONFIG_FI a/Source/WebKit2/PlatformGTK.cmake_sec1
9
9
10
add_definitions(-DBUILDING_WEBKIT)
10
add_definitions(-DBUILDING_WEBKIT)
11
add_definitions(-DWEBKIT2_COMPILATION)
11
add_definitions(-DWEBKIT2_COMPILATION)
12
add_definitions(-DLIBEXECDIR="${CMAKE_INSTALL_FULL_LIBEXECDIR}")
12
add_definitions(-DPKGLIBEXECDIR="${LIBEXEC_INSTALL_DIR}")
13
add_definitions(-DPKGLIBEXECDIR="${LIBEXEC_INSTALL_DIR}")
13
add_definitions(-DPACKAGE_LOCALE_DIR="${CMAKE_INSTALL_FULL_LOCALEDIR}")
14
add_definitions(-DPACKAGE_LOCALE_DIR="${CMAKE_INSTALL_FULL_LOCALEDIR}")
14
add_definitions(-DLIBDIR="${LIB_INSTALL_DIR}")
15
add_definitions(-DLIBDIR="${LIB_INSTALL_DIR}")
16
add_definitions(-DDATADIR="${CMAKE_INSTALL_FULL_DATADIR}")
15
17
16
set(WebKit2_USE_PREFIX_HEADER ON)
18
set(WebKit2_USE_PREFIX_HEADER ON)
17
19
Lines 326-331 list(APPEND WebKit2_SOURCES a/Source/WebKit2/PlatformGTK.cmake_sec2
326
    WebProcess/WebPage/gtk/WebPageGtk.cpp
328
    WebProcess/WebPage/gtk/WebPageGtk.cpp
327
    WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp
329
    WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp
328
330
331
    WebProcess/gtk/SeccompFiltersWebProcessGtk.cpp
332
    WebProcess/gtk/SeccompFiltersWebProcessGtk.h
329
    WebProcess/gtk/WebGtkExtensionManager.cpp
333
    WebProcess/gtk/WebGtkExtensionManager.cpp
330
    WebProcess/gtk/WebGtkInjectedBundleMain.cpp
334
    WebProcess/gtk/WebGtkInjectedBundleMain.cpp
331
    WebProcess/gtk/WebProcessMainGtk.cpp
335
    WebProcess/gtk/WebProcessMainGtk.cpp
Lines 451-456 list(APPEND WebKit2_INCLUDE_DIRECTORIES a/Source/WebKit2/PlatformGTK.cmake_sec3
451
    "${WEBKIT2_DIR}/Shared/Downloads/soup"
455
    "${WEBKIT2_DIR}/Shared/Downloads/soup"
452
    "${WEBKIT2_DIR}/Shared/Plugins/unix"
456
    "${WEBKIT2_DIR}/Shared/Plugins/unix"
453
    "${WEBKIT2_DIR}/Shared/gtk"
457
    "${WEBKIT2_DIR}/Shared/gtk"
458
    "${WEBKIT2_DIR}/Shared/linux"
459
    "${WEBKIT2_DIR}/Shared/linux/SeccompFilters"
454
    "${WEBKIT2_DIR}/Shared/soup"
460
    "${WEBKIT2_DIR}/Shared/soup"
455
    "${WEBKIT2_DIR}/Shared/unix"
461
    "${WEBKIT2_DIR}/Shared/unix"
456
    "${WEBKIT2_DIR}/UIProcess/API/C/cairo"
462
    "${WEBKIT2_DIR}/UIProcess/API/C/cairo"
Lines 531-536 list(APPEND WebKit2_LIBRARIES a/Source/WebKit2/PlatformGTK.cmake_sec4
531
)
537
)
532
endif ()
538
endif ()
533
539
540
if (ENABLE_SECCOMP_FILTERS)
541
    list(APPEND WebKit2_LIBRARIES
542
        ${LIBSECCOMP_LIBRARIES}
543
    )
544
    list(APPEND WebKit2_INCLUDE_DIRECTORIES
545
        ${LIBSECCOMP_INCLUDE_DIRS}
546
    )
547
548
    # If building with WebKit jhbuild (not GNOME jhbuild), add the root build
549
    # directory to the filesystem access policy.
550
    if (IS_DIRECTORY ${CMAKE_SOURCE_DIR}/WebKitBuild/DependenciesGTK)
551
        add_definitions(-DSOURCE_DIR=\"${CMAKE_SOURCE_DIR}\")
552
    endif ()
553
endif ()
554
534
ADD_WHOLE_ARCHIVE_TO_LIBRARIES(WebKit2_LIBRARIES)
555
ADD_WHOLE_ARCHIVE_TO_LIBRARIES(WebKit2_LIBRARIES)
535
556
536
set(WebKit2_MARSHAL_LIST ${WEBKIT2_DIR}/UIProcess/API/gtk/webkit2marshal.list)
557
set(WebKit2_MARSHAL_LIST ${WEBKIT2_DIR}/UIProcess/API/gtk/webkit2marshal.list)
- a/Source/WebKit2/WebProcess/gtk/SeccompFiltersWebProcessGtk.cpp +70 lines
Line 0 a/Source/WebKit2/WebProcess/gtk/SeccompFiltersWebProcessGtk.cpp_sec1
1
/*
2
 * Copyright (C) 2013 Intel Corporation. All rights reserved.
3
 * Copyright (C) 2014 Igalia S.L.
4
 *
5
 * Redistribution and use in source and binary forms, with or without
6
 * modification, are permitted provided that the following conditions
7
 * are met:
8
 * 1. Redistributions of source code must retain the above copyright
9
 *    notice, this list of conditions and the following disclaimer.
10
 * 2. Redistributions in binary form must reproduce the above copyright
11
 *    notice, this list of conditions and the following disclaimer in the
12
 *    documentation and/or other materials provided with the distribution.
13
 *
14
 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
15
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
16
 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
17
 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
18
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
19
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
20
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
21
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
22
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
23
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
24
 * THE POSSIBILITY OF SUCH DAMAGE.
25
 */
26
27
#include "config.h"
28
#include "SeccompFiltersWebProcessGtk.h"
29
30
#if ENABLE(SECCOMP_FILTERS)
31
32
#include "SeccompBroker.h"
33
#include "WebProcessCreationParameters.h"
34
#include <glib.h>
35
#include <sys/types.h>
36
#include <unistd.h>
37
38
namespace WebKit {
39
40
SeccompFiltersWebProcessGtk::SeccompFiltersWebProcessGtk(const WebProcessCreationParameters& parameters)
41
    : SeccompFilters(Allow)
42
{
43
    m_policy.addDefaultWebProcessPolicy(parameters);
44
}
45
46
void SeccompFiltersWebProcessGtk::platformInitialize()
47
{
48
    // TODO: We should block all the syscalls and whitelist
49
    // what we need + trap what should be handled by the broker.
50
    addRule("open", Trap);
51
    addRule("openat", Trap);
52
    addRule("creat", Trap);
53
54
#if USE(GSTREAMER)
55
    m_policy.addDirectoryPermission(String::fromUTF8(g_get_user_cache_dir()) + "/gstreamer-1.0", SyscallPolicy::ReadAndWrite);
56
    m_policy.addDirectoryPermission(String::fromUTF8(g_get_user_data_dir()) + "/gstreamer-1.0", SyscallPolicy::ReadAndWrite);
57
    m_policy.addDirectoryPermission(String::fromUTF8(LIBEXECDIR) + "/gstreamer-1.0", SyscallPolicy::Read);
58
#endif
59
60
    m_policy.addDirectoryPermission(String::fromUTF8(g_get_user_data_dir()) + "/gvfs-metadata", SyscallPolicy::ReadAndWrite);
61
62
    // For libXau
63
    m_policy.addDirectoryPermission(ASCIILiteral("/run/gdm"), SyscallPolicy::Read);
64
65
    SeccompBroker::launchProcess(this, m_policy);
66
}
67
68
} // namespace WebKit
69
70
#endif // ENABLE(SECCOMP_FILTERS)
- a/Source/WebKit2/WebProcess/gtk/SeccompFiltersWebProcessGtk.h +52 lines
Line 0 a/Source/WebKit2/WebProcess/gtk/SeccompFiltersWebProcessGtk.h_sec1
1
/*
2
 * Copyright (C) 2013 Intel Corporation. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions
6
 * are met:
7
 * 1. Redistributions of source code must retain the above copyright
8
 *    notice, this list of conditions and the following disclaimer.
9
 * 2. Redistributions in binary form must reproduce the above copyright
10
 *    notice, this list of conditions and the following disclaimer in the
11
 *    documentation and/or other materials provided with the distribution.
12
 *
13
 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
14
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
15
 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16
 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
17
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
19
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
23
 * THE POSSIBILITY OF SUCH DAMAGE.
24
 */
25
26
#ifndef SeccompFiltersWebProcessGtk_h
27
#define SeccompFiltersWebProcessGtk_h
28
29
#if ENABLE(SECCOMP_FILTERS)
30
31
#include "SeccompFilters.h"
32
#include "SyscallPolicy.h"
33
34
namespace WebKit {
35
36
class WebProcessCreationParameters;
37
38
class SeccompFiltersWebProcessGtk : public SeccompFilters {
39
public:
40
    SeccompFiltersWebProcessGtk(const WebProcessCreationParameters&);
41
42
private:
43
    virtual void platformInitialize();
44
45
    SyscallPolicy m_policy;
46
};
47
48
} // namespace WebKit
49
50
#endif // ENABLE(SECCOMP_FILTERS)
51
52
#endif // SeccompFiltersWebProcessGtk_h
- a/Source/WebKit2/WebProcess/soup/WebProcessSoup.cpp +4 lines
Lines 29-34 a/Source/WebKit2/WebProcess/soup/WebProcessSoup.cpp_sec1
29
29
30
#if PLATFORM(EFL)
30
#if PLATFORM(EFL)
31
#include "SeccompFiltersWebProcessEfl.h"
31
#include "SeccompFiltersWebProcessEfl.h"
32
#elif PLATFORM(GTK)
33
#include "SeccompFiltersWebProcessGtk.h"
32
#endif
34
#endif
33
35
34
#include "CertificateInfo.h"
36
#include "CertificateInfo.h"
Lines 145-150 void WebProcess::platformInitializeWebProcess(WebProcessCreationParameters&& par a/Source/WebKit2/WebProcess/soup/WebProcessSoup.cpp_sec2
145
    {
147
    {
146
#if PLATFORM(EFL)
148
#if PLATFORM(EFL)
147
        SeccompFiltersWebProcessEfl seccompFilters(parameters);
149
        SeccompFiltersWebProcessEfl seccompFilters(parameters);
150
#elif PLATFORM(GTK)
151
        SeccompFiltersWebProcessGtk seccompFilters(parameters);
148
#endif
152
#endif
149
        seccompFilters.initialize();
153
        seccompFilters.initialize();
150
    }
154
    }
- a/Source/cmake/OptionsGTK.cmake +4 lines
Lines 404-409 if (ENABLE_FTL_JIT) a/Source/cmake/OptionsGTK.cmake_sec1
404
    set(HAVE_LLVM ON)
404
    set(HAVE_LLVM ON)
405
endif ()
405
endif ()
406
406
407
if (ENABLE_SECCOMP_FILTERS)
408
    find_package(LibSeccomp REQUIRED)
409
endif ()
410
407
set(CPACK_SOURCE_GENERATOR TBZ2)
411
set(CPACK_SOURCE_GENERATOR TBZ2)
408
412
409
set(DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR ${DERIVED_SOURCES_DIR}/webkitdom)
413
set(DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR ${DERIVED_SOURCES_DIR}/webkitdom)
- a/Tools/ChangeLog +11 lines
Lines 1-3 a/Tools/ChangeLog_sec1
1
2015-01-04  Michael Catanzaro  <mcatanzaro@igalia.com>
2
3
        [GTK] Add seccomp filters support
4
        https://bugs.webkit.org/show_bug.cgi?id=110014
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        Add libseccomp to jhbuild modulesets.
9
10
        * gtk/jhbuild.modules:
11
1
2015-04-01  Brent Fulgham  <bfulgham@apple.com>
12
2015-04-01  Brent Fulgham  <bfulgham@apple.com>
2
13
3
        [Win] Run test-webkitpy as part of EWS (just like we do on other platforms)
14
        [Win] Run test-webkitpy as part of EWS (just like we do on other platforms)
- a/Tools/gtk/jhbuild.modules -1 / +7 lines
Lines 31-36 a/Tools/gtk/jhbuild.modules_sec1
31
      <dep package="xserver"/>
31
      <dep package="xserver"/>
32
      <dep package="mesa"/>
32
      <dep package="mesa"/>
33
      <dep package="openwebrtc"/>
33
      <dep package="openwebrtc"/>
34
      <dep package="libseccomp"/>
34
    </dependencies>
35
    </dependencies>
35
  </metamodule>
36
  </metamodule>
36
37
Lines 60-65 a/Tools/gtk/jhbuild.modules_sec2
60
      href="http://download.savannah.gnu.org/releases/"/>
61
      href="http://download.savannah.gnu.org/releases/"/>
61
  <repository type="git" name="freedesktop-git"
62
  <repository type="git" name="freedesktop-git"
62
      href="http://anongit.freedesktop.org/git"/>
63
      href="http://anongit.freedesktop.org/git"/>
64
  <repository type="tarball" name="sourceforge.net"
65
      href="http://sourceforge.net/projects/"/>
63
66
64
  <autotools id="cairo"
67
  <autotools id="cairo"
65
             autogenargs="--enable-gl=yes --enable-egl=yes --enable-glx=yes ac_cv_func_rsvg_pixbuf_from_file=no --disable-lto"
68
             autogenargs="--enable-gl=yes --enable-egl=yes --enable-glx=yes ac_cv_func_rsvg_pixbuf_from_file=no --disable-lto"
Lines 116-121 a/Tools/gtk/jhbuild.modules_sec3
116
             md5sum="f5898b29bbfd70502831a212d9249d10"/>
119
             md5sum="f5898b29bbfd70502831a212d9249d10"/>
117
  </autotools>
120
  </autotools>
118
121
122
  <autotools id="libseccomp" autogen-sh="./autogen.sh; ./configure">
123
    <branch repo="github.com" module="seccomp/libseccomp.git" tag="v2.2.0"/>
124
  </autotools>
125
119
  <autotools id="gdk-pixbuf" autogen-sh="configure"
126
  <autotools id="gdk-pixbuf" autogen-sh="configure"
120
             autogenargs="--disable-introspection">
127
             autogenargs="--disable-introspection">
121
    <dependencies>
128
    <dependencies>
122
- 

Return to Bug 110014