Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFE: SCMP_CMP with instruction_pointer #133

Closed
gatoWololo opened this issue Dec 4, 2018 · 1 comment
Closed

RFE: SCMP_CMP with instruction_pointer #133

gatoWololo opened this issue Dec 4, 2018 · 1 comment

Comments

@gatoWololo
Copy link

gatoWololo commented Dec 4, 2018

Hello!

Thank you for the amazing library.

Our current project is built on libseccomp + ptrace. We would like to selectively intercept system calls, except when called through our own function. One way to do this is by always having our system call at a known address, and having a seccomp rule which checks if instruction_pointer == OUR_ADDR.

Looking through the documentation and source code, I couldn't see a simple way. Is there a way to do this through the libseccomp API? If not, is it possible to make a call to "raw" seccomp to include this as a rule?

@pcmoore
Copy link
Member

pcmoore commented Dec 4, 2018

Hi @gatoWololo, I'm glad you are finding libseccomp helpful!

You are correct, currently it is not possible to filter based on the instruction pointer using libseccomp, but we do already have an open issue here on GitHub to track this request (#113). Please add any additional comments to that issue so we can keep all of the discussion in one place; I'm going to go ahead and close this issue.

... and yes, you can always generate your own seccomp filter using raw BPF to filter on the instruction pointer. You will lose some of the things that libseccomp does for you automatically, but you will also be able to work around this limitation.

Good luck!

@pcmoore pcmoore closed this as completed Dec 4, 2018
@pcmoore pcmoore changed the title SCMP_CMP with instruction_pointer RFE: SCMP_CMP with instruction_pointer Dec 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants