(n *seccomp.Notif)
| 268 | } |
| 269 | |
| 270 | func (e *Engine) handle(n *seccomp.Notif) { |
| 271 | handler := process.Handlers[n.Syscall] |
| 272 | if handler == nil { |
| 273 | slog.Error(fmt.Sprintf("no handler found for %s", syscalls.GetName(n.Syscall))) |
| 274 | return |
| 275 | } |
| 276 | |
| 277 | p := e.getProcess(n.PID) |
| 278 | |
| 279 | switch err := handler(p, n); { |
| 280 | case err == nil: |
| 281 | case errors.Is(err, seccomp.ErrCancelled): |
| 282 | // The target's syscall was probably interrupted by a signal. We |
| 283 | // don't need to do anything more here. |
| 284 | default: |
| 285 | slog.Error(fmt.Sprintf("critical error in handling %s", syscalls.GetName(n.Syscall)), "notif", n, "proc", p, "err", err) |
| 286 | } |
| 287 | } |
| 288 | |
| 289 | // Start receives and handles intercepted syscalls until all processes exit. |
| 290 | func (e *Engine) Start() { |
no test coverage detected