Skip to content

Commit

Permalink
fix: delete syscall data on socket dup (aquasecurity#1720)
Browse files Browse the repository at this point in the history
if dup failed, we returned without deleting syscall data from map.
  • Loading branch information
roikol authored May 2, 2022
1 parent 7bf266c commit ecf7a95
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/ebpf/c/tracee.bpf.c
Original file line number Diff line number Diff line change
Expand Up @@ -2577,7 +2577,7 @@ int sys_dup_exit_tail(void *ctx)

if (sys->ret < 0) {
// dup failed
return 0;
goto out;
}

if (sys->id == SYS_DUP) {
Expand All @@ -2592,9 +2592,9 @@ int sys_dup_exit_tail(void *ctx)
send_socket_dup(&data, sys->args.args[0], sys->args.args[1]);
}

out:
// delete syscall data before return
bpf_map_delete_elem(&syscall_data_map, &data.context.host_tid);

return 0;
}

Expand Down

0 comments on commit ecf7a95

Please sign in to comment.