Skip to content

Commit

Permalink
fix(driver/bpf): report correct args of getresuid syscall
Browse files Browse the repository at this point in the history
Signed-off-by: Roberto Scolaro <[email protected]>
  • Loading branch information
therealbobo committed Mar 27, 2024
1 parent a9a9c99 commit ef83d54
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion driver/SCHEMA_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.19.2
2.19.3
9 changes: 6 additions & 3 deletions driver/bpf/fillers.h
Original file line number Diff line number Diff line change
Expand Up @@ -4019,7 +4019,8 @@ FILLER(sys_getresuid_and_gid_x, true)
* ruid
*/
idp = (uint32_t *)bpf_syscall_get_argument(data, 0);
id = _READ(*idp);
if (bpf_probe_read_user(&id, sizeof(idp), (void *)idp))
return PPM_FAILURE_INVALID_USER_MEMORY;

res = bpf_push_u32_to_ring(data, id);
CHECK_RES(res);
Expand All @@ -4028,7 +4029,8 @@ FILLER(sys_getresuid_and_gid_x, true)
* euid
*/
idp = (uint32_t *)bpf_syscall_get_argument(data, 1);
id = _READ(*idp);
if (bpf_probe_read_user(&id, sizeof(idp), (void *)idp))
return PPM_FAILURE_INVALID_USER_MEMORY;

res = bpf_push_u32_to_ring(data, id);
CHECK_RES(res);
Expand All @@ -4037,7 +4039,8 @@ FILLER(sys_getresuid_and_gid_x, true)
* suid
*/
idp = (uint32_t *)bpf_syscall_get_argument(data, 2);
id = _READ(*idp);
if (bpf_probe_read_user(&id, sizeof(idp), (void *)idp))
return PPM_FAILURE_INVALID_USER_MEMORY;

return bpf_push_u32_to_ring(data, id);
}
Expand Down

0 comments on commit ef83d54

Please sign in to comment.