5

Some Linux system calls (such as execve, openat) have string type arguments. But the comparison function SCMP_CMP provided by seccomp seems to be comparing two pointers. So how can I limit files that can be opened by a process to a specific dir using seccomp? Is there a way for users to provide a general comparison function?

  • Hmm, why do some people suggest this question doesn't fit here, given the fact that seccomp is built in the Linux kernel... – Cyker Jan 2 at 19:58
  • Ho hum, I would have thought this to be on-topic, based on the "C API and system interfaces" point in the help page, and the fact that it's specific to an OS that matches the description "Unix & Linux". But apparently the consensus on the discussion in meta is that interfaces like that aren't on-topic since "only programmers see them". – ilkkachu Jan 2 at 20:28
  • In any case, there's even a tag for seccomp on stackoverflow, so chances are there's someone there who knows something about it. – ilkkachu Jan 2 at 20:31
  • According to this talk (at the 8 minute mark) from a few months ago, pointer dereferencing in seccomp bpf is not yet possible, but is being worked on. – Mark Plotnick Jan 3 at 21:55
  • One issue with trying to read process memory as a security check is that there's a TOCTOU race if you have multiple threads or shared/ mmapped memory. – Mark Plotnick Jan 3 at 22:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.