Skip to content

RFE: move arch/ABI syscall mapping tables into a common location #207

@pcmoore

Description

@pcmoore

Currently updating the internal libseccomp syscall tables is a pain largely because the mapping information is spread across multiple files (e.g. "arch-*-syscalls.c"). I would like to propose we move all of the syscall mapping information into a common file which can then be used to generate the per-arch definitions at build time.

My current thought is to create a new CSV formatted file similar to the limited example below:

syscall,x86,x86_64,aarch64
read,3,0,63
write,4,1,64

Maintaining this file (e.g. adding new syscalls and/or ABIs over time) should be relatively easy due to the number of tools/scripts available for working with CSV files and generating a per-ABI syscall table (arch-X-syscalls.h?) from the CSV should be easy enough. There are some complications for some ABIs which have a fixed offset, e.g. x32/arm/mips/etc., but that should be easy enough to solve with a __SCMP_NR_BASE prefix similar to what we do today.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions