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

BUG: misleading name of test 18-sim-basic_whitelist #35

Closed
diekmann opened this issue Apr 27, 2016 · 3 comments
Closed

BUG: misleading name of test 18-sim-basic_whitelist #35

diekmann opened this issue Apr 27, 2016 · 3 comments
Labels
Milestone

Comments

@diekmann
Copy link

Hi,

I was reading tests/18-sim-basic_whitelist.c.

If I understand it correctly, it does the following:

  • Disallow some read, write, close, and rt_sigreturn syscalls (only if they act on stdin, stdout, stderr).
  • Allow everything else (in particular, reading/writing to any other file descriptor is allowed)

This is not whitelisting, this is blacklisting.

Should the file be renamed? Should all KILLs and ACCEPTs be swapped to achieve whitelisting?

It would be nice to have a true whitelisting example, since this is the strongly recommended use of seccomp.

@pcmoore pcmoore added the bug label Apr 27, 2016
@pcmoore pcmoore added this to the v2.4 milestone Apr 27, 2016
@pcmoore pcmoore changed the title Misleading name of test 18-sim-basic_whitelist BUG: misleading name of test 18-sim-basic_whitelist Apr 27, 2016
@pcmoore
Copy link
Member

pcmoore commented Apr 27, 2016

Yes, it should probably be renamed, but to be honest, the name of these isn't very important, the content of the test is what matters.

@diekmann
Copy link
Author

diekmann commented Apr 29, 2016

Enhancement suggestion: It would be nice to additionally have a whitelisting test. Test cases tend to be used by developers as reference or code example. 👍

I just found a library (not written by me) which had basically the same bug. It meant to do whitelisting with seccomp but actually did blacklisting. I cannot tell whether this was an independent bug or maybe subconsciously induced by this test case.

By the way: do you want me to delete this comment and open a separate issue for this?

@pcmoore
Copy link
Member

pcmoore commented Jun 2, 2016

Merged in 5e0a33f, thanks @lucab!

@pcmoore pcmoore closed this as completed Jun 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants