netblue30 / firejail

Linux namespaces and seccomp-bpf sandbox
https://firejail.wordpress.com
GNU General Public License v2.0
5.79k stars 566 forks source link

No syscall table provided in firejail on ARM64 platform #5821

Open dehuo0 opened 1 year ago

dehuo0 commented 1 year ago

Description

No syscall listed on ARM64 platform

Steps to Reproduce

When run command 'firejail --debug-syscalls' in order to get syscall list on our bcm-2xxx-rpi4 platform which is arm64 arch, there is nothing printed, but if run the same command on x86 or arm32 platforms the syscall can be listed properly. And there is same problem in firejail command about seccomp functions(for example command ' firejail --seccomp.drop=execve') on our side. I check below code in "src/lib/syscall.c", I find there is only variable 'syslist' defined for arch x86_64, i386 and arm, there is no such variable defined for arm64 arch.

_**_static const SyscallEntry syslist[] = {

if defined(__x86_64__)

// code generated using // awk '/_NR/ { print "{ \"" gensub("_NR", "", "g", $2) "\", " $3 " },"; }' < /usr/include/x86_64-linux-gnu/asm/unistd_64.h

include "../include/syscall_x86_64.h"

elif defined(i386)

// awk '/_NR/ { print "{ \"" gensub("_NR", "", "g", $2) "\", " $3 " },"; }' < /usr/include/x86_64-linux-gnu/asm/unistd_32.h

include "../include/syscall_i386.h"

elif defined(arm)

include "../include/syscall_armeabi.h"

else

warning "Please submit a syscall table for your architecture"

endif

};**

And there are only syscall table files about x86-64, i386 and arm32 provided in src/include/ as src/include/syscall_armeabi.h src/include/syscall_i386.h src/include/syscall_x86_64.h.

So my question is why firejail didn't provide syscall table for arch ARM64? Is there any risk when provide syscall table for arch arm64 in firejail? When will firejail provide syscall table for arch ARM64? If I provide the syscall table for arm64 arch privately, will it cause any potential risk for firejail?

My current firejail version is 0.9.72, but it looks there should be same issue in lasted version.

kmk3 commented 1 year ago

(Offtopic)

Please see the following links for how to format code blocks in markdown:

kmk3 commented 1 year ago

When will firejail provide syscall table for arch ARM64?

When someone opens a pull request for it and it is merged.

If I provide the syscall table for arm64 arch privately, will it cause any potential risk for firejail?

I don't think so.

dehuo0 commented 1 year ago

(Offtopic)

Please see the following links for how to format code blocks in markdown:

Thank you for reminding me.

dehuo0 commented 1 year ago

When will firejail provide syscall table for arch ARM64?

When someone opens a pull request for it and it is merged.

If I provide the syscall table for arm64 arch privately, will it cause any potential risk for firejail?

I don't think so.

Thank you for your quick reply.