• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

saschagrunert / libseccomp / 36861025587
89%
main: %

Build:
Build:
LAST BUILD BRANCH: bpf-load-syscall-first-emitted
DEFAULT BRANCH: main
Ran 01 Oct 2026 12:23PM UTC
Jobs 1
Files 27
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

01 Oct 2026 12:17PM UTC coverage: 88.677%. First build
36861025587

push

github

saschagrunert
bpf: load the syscall number in the first syscall that is emitted

_gen_bpf_syscalls() emits the instruction that loads the syscall number
only in the block of the head of the sorted syscall list, and the loop
skips the head when it is a pseudo-syscall (since the filter stopped
carrying pseudo-syscalls in v2.5.0, see #252). The block of every other
syscall of that architecture then compares against whatever the
accumulator holds after the architecture check, no rule matches, and
every call gets the default action.

The head is the syscall with the highest priority, which is one without
conditions, so this takes a filter in which every unconditional rule
names a syscall the architecture lacks. It needs the number to be loaded
by the syscall blocks rather than by the architecture block, which is
every architecture except a lone x86_64 or x32, and a pseudo-syscall
rule stored for the architecture, which the multiplexing architectures
(x86, 32-bit MIPS, ppc, ppc64, s390, sh, m68k) drop at seccomp_rule_add
time. With a permissive default action every denying rule of the
affected architecture is disabled. Container runtimes pass such filters
from user configuration: an unconditional rule on socketcall next to a
conditional one on socket, loaded for x86_64 and x32 together or for
aarch64, is enough.

Reproducer, on x86_64 with libseccomp 2.5.5 or 2.6.1:

	ctx = seccomp_init(SCMP_ACT_ALLOW);
	seccomp_arch_add(ctx, SCMP_ARCH_X32);
	seccomp_rule_add(ctx, SCMP_ACT_ERRNO(EPERM), SCMP_SYS(socket), 1,
			 SCMP_A0(SCMP_CMP_EQ, AF_VSOCK));
	seccomp_rule_add(ctx, SCMP_ACT_ERRNO(EPERM), SCMP_SYS(socketcall), 0);
	seccomp_load(ctx);
	socket(AF_VSOCK, SOCK_STREAM, 0);	/* succeeds, expected EPERM */

The exported BPF has no "ld [0]" after the x86_64 architecture check.
Without SCMP_ARCH_X32 the lone x86_64 block loads the number itself and
the call fails with EPERM.

Load the number in the first syscall that is not skipped instead of in
the head. The new test 65-sim-pseud... (continued)

3 of 3 new or added lines in 1 file covered. (100.0%)

3156 of 3559 relevant lines covered (88.68%)

256094.05 hits per line

Jobs
ID Job ID Ran Files Coverage
1 amd64 - 36861025587.1 01 Oct 2026 12:23PM UTC 27
88.68
GitHub Action Run
Source Files on build 36861025587
  • Tree
  • List 27
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 29e7b2f7 on github
  • Next Build on bpf-load-syscall-first-emitted (#36862496068)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc