8000 unotify: break out of SECCOMP_IOCTL_NOTIF_SEND retry loop on success and handle POLLERR/POLLNVAL by phenomenon0 · Pull Request #421 · google/nsjail · GitHub
[go: up one dir, main page]

Skip to content

unotify: break out of SECCOMP_IOCTL_NOTIF_SEND retry loop on success and handle POLLERR/POLLNVAL - #421

Open
phenomenon0 wants to merge 1 commit into
google:masterfrom
phenomenon0:fix-unotify-ioctl-loop
Open

phenomenon0 wants to merge 1 commit into
google:masterfrom
phenomenon0:fix-unotify-ioctl-loop

Conversation

@phenomenon0
Copy link
Copy Markdown

Summary

Fixes two bugs in unotify/unotify.cc:

  1. In threadMain(), the for (;;) retry loop around ioctl(unotif_fd, SECCOMP_IOCTL_NOTIF_SEND, &resp) lacked a break when ioctl() == 0, causing every traced syscall to issue a duplicate SECCOMP_IOCTL_NOTIF_SEND for the same resp.id (which immediately failed in the kernel with EINPROGRESS).
  2. Checks pfd.revents & (POLLHUP | POLLERR | POLLNVAL) instead of exact equality pfd.revents == POLLHUP so the poll loop does not spin when POLLERR or POLLNVAL accompanies hangup without POLLIN.

Verification

  • Compiled unotify/unotify.o with g++ -std=c++20 -O2 -Wall: 0 errors, 0 warnings.

…and handle POLLERR/POLLNVAL

Signed-off-by: phenomenon0 <jethro.adeniran@gmail.com>
@phenomenon0
phenomenon0 force-pushed the fix-unotify-ioctl-loop branch from 90aa493 to 3a88865 Compare December 5, 2026 18:55

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0