Skip to content

Commit

Permalink
[CWS] ebpfless: fix open ret == 0 case (#27886)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulcacheux authored Jul 24, 2024
1 parent a6f2368 commit 143fa1d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/security/ptracer/fim_handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -1173,7 +1173,7 @@ func handleNameToHandleAtRet(tracer *Tracer, process *Process, msg *ebpfless.Sys
}

func handleOpensRet(tracer *Tracer, process *Process, msg *ebpfless.SyscallMsg, regs syscall.PtraceRegs, _ bool) error {
if ret := tracer.ReadRet(regs); msg.Open != nil && ret > 0 {
if ret := tracer.ReadRet(regs); msg.Open != nil && ret >= 0 {
process.Res.Fd[int32(ret)] = msg.Open.Filename
}
return nil
Expand Down

0 comments on commit 143fa1d

Please sign in to comment.