Skip to content

Commit

Permalink
Merge branch 'rebuild'
Browse files Browse the repository at this point in the history
  • Loading branch information
rootmos committed Nov 14, 2023
2 parents d253b88 + bea0d49 commit 5644ce6
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 16 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/build-test.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: Build and test
on: [ push ]
on:
push:
schedule:
- cron: "* * 7 * *"

jobs:
ubuntu:
Expand Down
13 changes: 6 additions & 7 deletions hnode/filter.bpf
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,9 @@ jeq #$__NR_dup2, good
jeq #$__NR_readlink, good

jne #$__NR_mmap, mmap_end
ld [$$offsetof(struct seccomp_data, args[4])$$]
jne #-1, bad
ld [$$offsetof(struct seccomp_data, args[2])$$]
jset #$PROT_EXEC, bad
ld [$$offsetof(struct seccomp_data, args[3])$$]
jeq #$$(MAP_PRIVATE|MAP_ANONYMOUS)$$, good
jeq #$$(MAP_PRIVATE|MAP_ANONYMOUS|MAP_STACK)$$, good
jeq #$$(MAP_PRIVATE|MAP_ANONYMOUS|MAP_NORESERVE)$$, good
jmp bad
jmp good
mmap_end:

# NB: this allows PROT_EXEC
Expand Down Expand Up @@ -86,6 +80,7 @@ jeq #$__NR_capget, good
jeq #$__NR_epoll_create1, good
jeq #$__NR_epoll_ctl, good
jeq #$__NR_epoll_wait, good
jeq #$__NR_epoll_pwait, good

jeq #$__NR_pipe2, good
jeq #$__NR_eventfd2, good
Expand All @@ -102,6 +97,10 @@ jeq #$__NR_clone3, good
jeq #$__NR_rseq, good
jeq #$__NR_set_robust_list, good

# TODO
jeq #$__NR_io_uring_setup, good
jeq #$__NR_io_uring_enter, good

jeq #$__NR_tgkill, good
jeq #$__NR_exit, good
jeq #$__NR_exit_group, good
Expand Down
6 changes: 3 additions & 3 deletions hnode/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ int main(int argc, char* argv[])
if(more) continue;

debug("emit before exit");
#if (NODE_MAJOR_VERSION == 19)
#if (NODE_MAJOR_VERSION >= 19)
node::EmitProcessBeforeExit(env.get());
#elif (NODE_MAJOR_VERSION == 12)
node::EmitBeforeExit(env.get());
Expand All @@ -278,7 +278,7 @@ int main(int argc, char* argv[])
}

debug("emit exit");
#if (NODE_MAJOR_VERSION == 19)
#if (NODE_MAJOR_VERSION >= 19)
exit_code = node::EmitProcessExit(env.get()).FromJust();
#elif (NODE_MAJOR_VERSION == 12)
exit_code = node::EmitExit(env.get());
Expand Down Expand Up @@ -312,7 +312,7 @@ int main(int argc, char* argv[])
v8::V8::Dispose();

debug("dispose platform");
#if (NODE_MAJOR_VERSION == 19)
#if (NODE_MAJOR_VERSION >= 19)
v8::V8::DisposePlatform();
node::TearDownOncePerProcess();
#elif (NODE_MAJOR_VERSION == 12)
Expand Down
10 changes: 5 additions & 5 deletions hpython/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,21 +114,21 @@ int main(int argc, char* argv[])

seccomp_apply_filter();

wchar_t *pgr = Py_DecodeLocale(argv[0], NULL);
CHECK_NOT(pgr, NULL, "Py_DecodeLocale(%s)", argv[0]);
Py_SetProgramName(pgr);
PyMem_RawFree(pgr);

PyPreConfig preconfig;
PyPreConfig_InitIsolatedConfig(&preconfig);
PyStatus s = Py_PreInitialize(&preconfig);
CHECK_PYTHON(s, "Py_PreInitialize");

PyConfig config;
PyConfig_InitIsolatedConfig(&config);

config.program_name = Py_DecodeLocale(argv[0], NULL);
CHECK_NOT(config.program_name, NULL, "Py_DecodeLocale(%s)", argv[0]);

s = Py_InitializeFromConfig(&config);
CHECK_PYTHON(s, "Py_InitializeFromConfig");
PyConfig_Clear(&config);
PyMem_RawFree(config.program_name);

debug("opening input file: %s", o.input);
FILE* f = fopen(o.input, "r");
Expand Down

0 comments on commit 5644ce6

Please sign in to comment.