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

drakenclimber / libseccomp / 12700288548
88%
main: 89%

Build:
Build:
LAST BUILD BRANCH: test
DEFAULT BRANCH: main
Ran 09 Jan 2025 11:34PM 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

09 Jan 2025 11:29PM UTC coverage: 87.68% (-1.8%) from 89.454%
12700288548

push

github

drakenclimber
wip - got it working

Needs some cleanup and obviously lots of tests :)

Here's the test program I have been using:

int main(void)
{
        int rc, pfc = 0;
        scmp_filter_ctx ctx = NULL;

        ctx = seccomp_init(SCMP_ACT_ERRNO(5));
        if (ctx == NULL)
                return ENOMEM;

	fprintf(stderr, "%s:%d\n", __func__, __LINE__);
        rc = seccomp_rule_add(ctx, SCMP_ACT_ALLOW,
SCMP_SYS(rt_sigreturn), 0);
        if (rc != 0)
		goto out;
        rc = seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(exit_group),
0);
        if (rc != 0)
                goto out;
        rc = seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(write), 0);
        if (rc != 0)
                goto out;
        rc = seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(fstat), 0);
        if (rc != 0)
                goto out;
        rc = seccomp_rule_add(ctx, SCMP_ACT_ALLOW,
SCMP_SYS(clock_nanosleep), 0);
        if (rc != 0)
                goto out;

	rc = seccomp_attr_set(ctx, SCMP_FLTATR_CTL_OPTIMIZE, 2);
	if (rc != 0)
		goto out;

	rc = seccomp_attr_set(ctx, SCMP_FLTATR_CTL_KVER, SCMP_KV_4_5);
	if (rc != 0)
		goto out;

	pfc = open("filter.pfc", O_WRONLY | O_TRUNC | O_CREAT, S_IRWXU |
S_IRWXG | S_IRWXO);
	if (pfc < 0)
		goto out;

	rc = seccomp_export_pfc(ctx, pfc);
	if (rc != 0)
		goto out;

        rc = seccomp_load(ctx);
        if (rc != 0)
                goto out;

out:
	if (pfc)
		close(pfc);

	seccomp_release(ctx);
        return (rc < 0 ? -rc : rc);
}

Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>

7 of 63 new or added lines in 5 files covered. (11.11%)

91 existing lines in 2 files now uncovered.

2740 of 3125 relevant lines covered (87.68%)

288389.16 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
1
83.08
-0.09% src/gen_bpf.c
1
94.79
1.04% src/gen_pfc.c
21
85.98
-12.63% src/arch.c
33
86.79
-3.77% src/db.c

Uncovered Existing Lines

Lines Coverage ∆ File
1
94.79
1.04% src/gen_pfc.c
90
86.79
-3.77% src/db.c
Jobs
ID Job ID Ran Files Coverage
1 amd64 - 12700288548.1 09 Jan 2025 11:34PM UTC 27
87.68
GitHub Action Run
Source Files on build 12700288548
  • Tree
  • List 27
  • Changed 6
  • Source Changed 0
  • Coverage Changed 6
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • aaf1de3e on github
  • Prev Build on wip/issue11-2 (#12680703785)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc