Skip to content

RFE: add notification support#155

Merged
pcmoore merged 4 commits intoseccomp:masterfrom
pcmoore:working-notify
May 3, 2019
Merged

RFE: add notification support#155
pcmoore merged 4 commits intoseccomp:masterfrom
pcmoore:working-notify

Conversation

@pcmoore
Copy link
Member

@pcmoore pcmoore commented May 2, 2019

This PR takes @tych0's original patch, adds the necessary Python support, sorts out some corner cases, and cleans up the API a bit. @tych0 I left your sign-off on the main patch and the test patch as they inherited a large chunk of your code, please let me know if that's okay.

@pcmoore pcmoore added this to the v2.5 milestone May 2, 2019
@pcmoore pcmoore requested a review from drakenclimber May 2, 2019 00:18
@tych0
Copy link
Contributor

tych0 commented May 2, 2019

+1, sounds good to me

@drakenclimber
Copy link
Member

I can help look through this tomorrow. Thanks @pcmoore and @tych0

@pcmoore
Copy link
Member Author

pcmoore commented May 2, 2019

@drakenclimber thanks, although check the comments before you start - I'm currently arm wrestling with the old build environment in Travis.

@pcmoore pcmoore force-pushed the working-notify branch 2 times, most recently from cb55b4a to a54ae28 Compare May 2, 2019 01:11
@pcmoore
Copy link
Member Author

pcmoore commented May 2, 2019

Okay, it looks like the old header file problem is fixed now.

@coveralls
Copy link

coveralls commented May 2, 2019

Coverage Status

Coverage decreased (-2.2%) to 89.794% when pulling 78497a5 on pcmoore:working-notify into d390eda on seccomp:master.

Copy link
Member

@drakenclimber drakenclimber left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the code looks pretty good. I had a few comments that may be worth addressing, but nothing earth shattering. The tests were properly passed/skipped on my machine based upon the kernel I had running.

pcmoore added 2 commits May 2, 2019 19:29
This patch is heavily based on an earlier patchset by Tycho
Andersen.  I took Tycho's patch and incorporated the requested changes
from the review, fixed some corner case bugs, and simplified the API
a bit.

Kernel 5.0 includes the new user notification return code. Here's all the
infrastructure to handle that.

The idea behind the user notification return code is that the filter stops
the syscall, and forwards it to a "listener fd" that is created when
installing a filter. Then then some userspace task can listen and process
events accordingly by taking some (or no) action in userspace, and then
returning a value from the command.

Signed-off-by: Tycho Andersen <tycho@tycho.ws>
Signed-off-by: Paul Moore <paul@paul-moore.com>
The kernel explicitly disallows setting both TSYNC and NEW_LISTENER
at the same time, so catch this and block it in libseccomp.

Signed-off-by: Paul Moore <paul@paul-moore.com>
Copy link
Member

@drakenclimber drakenclimber left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had one tiny nitpick. The rest looks good to me, and I verified that the tests behaved as expected on my machine. Nice work, @pcmoore. Thanks!

pcmoore added 2 commits May 3, 2019 19:25
Here is the desciption from the main commit:

  "Kernel 5.0 includes the new user notification return code. Here's
   all the infrastructure to handle that.

   The idea behind the user notification return code is that the
   filter stops the syscall, and forwards it to a "listener fd" that
   is created when installing a filter. Then then some userspace task
   can listen and process events accordingly by taking some (or no)
   action in userspace, and then returning a value from the command."

Signed-off-by: Paul Moore <paul@paul-moore.com>
Some of this was taken from Tycho's original patch.

Signed-off-by: Tycho Andersen <tycho@tycho.ws>
Signed-off-by: Paul Moore <paul@paul-moore.com>
@pcmoore pcmoore merged commit 78497a5 into seccomp:master May 3, 2019
@pcmoore
Copy link
Member Author

pcmoore commented May 3, 2019

Closing this out now, all the patches have been merged into the master branch. Thanks @tych0 and @drakenclimber.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants