Skip to content

fix arm build #5142

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
#else
# error "Target architecture is unsupported by seccomp."
#endif
static const unsigned int sock_filter_policy_pidns.arm64_instr_cnt = 23;
static const unsigned int sock_filter_policy_pidns_arm64_instr_cnt = 23;

static void populate_sock_filter_policy_pidns.arm64( ulong out_cnt, struct sock_filter * out, unsigned int logfile_fd) {
static void populate_sock_filter_policy_pidns_arm64( ulong out_cnt, struct sock_filter * out, unsigned int logfile_fd) {
FD_TEST( out_cnt >= 23 );
struct sock_filter filter[23] = {
/* Check: Jump to RET_KILL_PROCESS if the script's arch != the runtime arch */
Expand Down
13 changes: 10 additions & 3 deletions src/app/shared/commands/run/run.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <sys/wait.h>
#include "generated/main_seccomp.h"
#if defined(__aarch64__)
#include "generated/pidns.arm64_seccomp.h"
#include "generated/pidns_arm64_seccomp.h"
#else
#include "generated/pidns_seccomp.h"
#endif
Expand Down Expand Up @@ -336,7 +336,14 @@ main_pid_namespace( void * _args ) {
allow_fds[ allow_fds_cnt++ ] = fds[ i ].fd; /* read end of child pipes */

struct sock_filter seccomp_filter[ 128UL ];
unsigned int instr_cnt;
#if defined(__aarch64__)
populate_sock_filter_policy_pidns_arm64( 128UL, seccomp_filter, (uint)fd_log_private_logfile_fd() );
instr_cnt = sock_filter_policy_pidns_arm64_instr_cnt;
#else
populate_sock_filter_policy_pidns( 128UL, seccomp_filter, (uint)fd_log_private_logfile_fd() );
instr_cnt = sock_filter_policy_pidns_instr_cnt;
#endif

if( FD_LIKELY( config->development.sandbox ) ) {
fd_sandbox_enter( config->uid,
Expand All @@ -350,7 +357,7 @@ main_pid_namespace( void * _args ) {
0UL,
allow_fds_cnt,
allow_fds,
sock_filter_policy_pidns_instr_cnt,
instr_cnt,
seccomp_filter );
} else {
fd_sandbox_switch_uid_gid( config->uid, config->gid );
Expand Down Expand Up @@ -783,7 +790,7 @@ run_firedancer( config_t * config,

run_firedancer_init( config, init_workspaces );

#if defined(__x86_64__)
#if defined(__x86_64__) || defined(__aarch64__)

#ifndef SYS_landlock_create_ruleset
#define SYS_landlock_create_ruleset 444
Expand Down
2 changes: 1 addition & 1 deletion src/disco/gui/fd_gui_tile.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

#include <sys/socket.h> /* SOCK_CLOEXEC, SOCK_NONBLOCK needed for seccomp filter */
#if defined(__aarch64__)
#include "generated/fd_gui_tile.arm64_seccomp.h"
#include "generated/fd_gui_tile_arm64_seccomp.h"
#else
#include "generated/fd_gui_tile_seccomp.h"
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
#else
# error "Target architecture is unsupported by seccomp."
#endif
static const unsigned int sock_filter_policy_fd_gui_tile.arm64_instr_cnt = 45;
static const unsigned int sock_filter_policy_fd_gui_tile_arm64_instr_cnt = 45;

static void populate_sock_filter_policy_fd_gui_tile.arm64( ulong out_cnt, struct sock_filter * out, unsigned int logfile_fd, unsigned int gui_socket_fd) {
static void populate_sock_filter_policy_fd_gui_tile_arm64( ulong out_cnt, struct sock_filter * out, unsigned int logfile_fd, unsigned int gui_socket_fd) {
FD_TEST( out_cnt >= 45 );
struct sock_filter filter[45] = {
/* Check: Jump to RET_KILL_PROCESS if the script's arch != the runtime arch */
Expand Down
2 changes: 1 addition & 1 deletion src/disco/metrics/fd_metric_tile.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include <string.h>

#if defined(__aarch64__)
#include "generated/fd_metric_tile.arm64_seccomp.h"
#include "generated/fd_metric_tile_arm64_seccomp.h"
#else
#include "generated/fd_metric_tile_seccomp.h"
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
#else
# error "Target architecture is unsupported by seccomp."
#endif
static const unsigned int sock_filter_policy_fd_metric_tile.arm64_instr_cnt = 45;
static const unsigned int sock_filter_policy_fd_metric_tile_arm64_instr_cnt = 45;

static void populate_sock_filter_policy_fd_metric_tile.arm64( ulong out_cnt, struct sock_filter * out, unsigned int logfile_fd, unsigned int metrics_socket_fd) {
static void populate_sock_filter_policy_fd_metric_tile_arm64( ulong out_cnt, struct sock_filter * out, unsigned int logfile_fd, unsigned int metrics_socket_fd) {
FD_TEST( out_cnt >= 45 );
struct sock_filter filter[45] = {
/* Check: Jump to RET_KILL_PROCESS if the script's arch != the runtime arch */
Expand Down
Loading