Skip to content

Commit

Permalink
Fix ENOENT errors from ioctl on the seccomp fd
Browse files Browse the repository at this point in the history
seccomp/libseccomp#302

Signed-off-by: Alban Crequy <alban@kinvolk.io>
  • Loading branch information
alban committed Nov 13, 2020
1 parent 0b4240c commit ec7f75d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pkg/agent/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"fmt"
"net"
"os"
"syscall"

"github.com/opencontainers/runtime-spec/specs-go"
libseccomp "github.com/seccomp/libseccomp-golang"
Expand Down Expand Up @@ -91,6 +92,10 @@ func notifHandler(reg *registry.Registry, seccompFile *os.File) {
for {
req, err := libseccomp.NotifReceive(fd)
if err != nil {
if err == syscall.ENOENT {
fmt.Printf("Seccomp fd#%d: handling of new notification could not start\n", fd)
continue
}
fmt.Printf("Error in NotifReceive(): %s\n", err)
return
}
Expand Down Expand Up @@ -126,6 +131,10 @@ func notifHandler(reg *registry.Registry, seccompFile *os.File) {
}

if err = libseccomp.NotifRespond(fd, resp); err != nil {
if err == syscall.ENOENT {
fmt.Printf("Seccomp fd#%d: handling of %s could not be finished\n", fd, syscallName)
continue
}
fmt.Printf("Error in notification response: %s\n", err)
return
}
Expand Down

0 comments on commit ec7f75d

Please sign in to comment.