libseccomp icon indicating copy to clipboard operation
libseccomp copied to clipboard

RFE: Add SCMP_ACT_TRAPX()

Open drakenclimber opened this issue 4 months ago • 3 comments

This is my first cut at addressing Issue #466. I'm open to discussion on other or better ways to handle it.

I decided to add SCMP_ACT_TRAPX() (similar to SCMP_ACT_ERRNO()) where the user can specify the lower 16 bits of the action. These lower 16 bits are then fed into the si_errno field in the siginfo structure that is sent to the signal trap handler.

With that said, this feature has been in seccomp since it was added in 2012, and no user has requested it. In fact, it looks like it was found by debugging and snooping around in the source code :). I don't think most users care about it, so I have chosen to make this invisible to users by remapping SCMP_ACT_TRAP to SCMP_ACT_TRAPX(0). When users upgrade to a version of libseccomp with this feature, everything will behave as they have before.

If a user wants to use this feature, then they'll have to specifically use the SCMP_ACT_TRAPX() action. Its usage is clearly outlined in test 63-live-trapx.c

drakenclimber avatar Aug 18 '25 20:08 drakenclimber

Continuous integration is failing because coveralls is down... again :(

drakenclimber avatar Aug 18 '25 20:08 drakenclimber

Continuous integration is failing because coveralls is down... again :(

Coveralls seems to be up at the moment so let's try to re-run that failed CI job ...

pcmoore avatar Aug 30 '25 15:08 pcmoore

Coverage Status

coverage: 89.049% (+0.003%) from 89.046% when pulling 85eca321838b6d66a44ffd5760fc45c91602aa4b on drakenclimber:issue466 into 9b9ea8e7a173b96e59fb21e8d461365110e7b4ef on seccomp:main.

coveralls avatar Sep 02 '25 14:09 coveralls