Skip to content

Commit da72e3d

Browse files
authored
Merge pull request #49 from otargowski/seccomp-poll
Allow poll and similiar syscalls, update cmake configs
2 parents deed83e + f7cdf95 commit da72e3d

File tree

4 files changed

+17
-1
lines changed

4 files changed

+17
-1
lines changed

CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
CMAKE_MINIMUM_REQUIRED(VERSION 3.0)
1+
CMAKE_MINIMUM_REQUIRED(VERSION 3.0...4.1)
2+
PROJECT(sio2jail)
23

34
INCLUDE(${CMAKE_ROOT}/Modules/ExternalProject.cmake)
45
INCLUDE(${CMAKE_ROOT}/Modules/GNUInstallDirs.cmake)

external/libseccomp.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ IF((NOT DEFINED LIBSECCOMP_BUILD_OWN AND (NOT EXISTS "${libseccomp_LIB_PATH}" OR
6161
ExternalProject_Add(seccomp_project
6262
URL https://github.com/seccomp/libseccomp/releases/download/v2.5.4/libseccomp-2.5.4.tar.gz
6363
URL_HASH SHA256=d82902400405cf0068574ef3dc1fe5f5926207543ba1ae6f8e7a1576351dcbdb
64+
DOWNLOAD_EXTRACT_TIMESTAMP TRUE
6465

6566
CONFIGURE_COMMAND
6667
CFLAGS=${EXTRA_FLAGS} CXXFLAGS=${EXTRA_FLAGS} <SOURCE_DIR>/configure

external/libtclap.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ IF((NOT DEFINED LIBTCLAP_BUILD_OWN AND NOT EXISTS "${libtclap_INC_PATH}") OR LIB
1616
ExternalProject_Add(libtclap_project
1717
URL https://netcologne.dl.sourceforge.net/project/tclap/tclap-1.2.2.tar.gz
1818
URL_HASH SHA256=f5013be7fcaafc69ba0ce2d1710f693f61e9c336b6292ae4f57554f59fde5837
19+
DOWNLOAD_EXTRACT_TIMESTAMP TRUE
1920

2021
CONFIGURE_COMMAND
2122
<SOURCE_DIR>/configure --prefix=<INSTALL_DIR>

src/seccomp/policy/DefaultPolicy.cc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,19 @@ void DefaultPolicy::addInputOutputRules() {
134134
// Allow reading from any file descriptor
135135
allowSyscalls({"read", "readv", "dup", "fcntl", "fcntl64", "pread64"});
136136

137+
// Allow monitoring any file descriptor
138+
allowSyscalls(
139+
{"poll",
140+
"ppoll",
141+
"epoll_create",
142+
"epoll_create1",
143+
"epoll_ctl",
144+
"epoll_pwait",
145+
"epoll_pwait2",
146+
"epoll_wait",
147+
"select",
148+
"pselect6"});
149+
137150
rules_.emplace_back(SeccompRule("ioctl", action::ActionErrno(ENOTTY)));
138151

139152
// Allow seeking any file other than stdin/stdou/stderr

0 commit comments

Comments
 (0)