Skip to content

Commit

Permalink
cleanup(driver/bpf): use _READ_USER helper
Browse files Browse the repository at this point in the history
Signed-off-by: Roberto Scolaro <[email protected]>
  • Loading branch information
therealbobo authored and poiana committed Mar 27, 2024
1 parent a5546b6 commit 2528afa
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions driver/bpf/fillers.h
Original file line number Diff line number Diff line change
Expand Up @@ -4019,8 +4019,7 @@ FILLER(sys_getresuid_and_gid_x, true)
* ruid
*/
idp = (uint32_t *)bpf_syscall_get_argument(data, 0);
if (bpf_probe_read_user(&id, sizeof(idp), (void *)idp))
return PPM_FAILURE_INVALID_USER_MEMORY;
id = _READ_USER(*idp);

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

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

return bpf_push_u32_to_ring(data, id);
}
Expand Down

0 comments on commit 2528afa

Please sign in to comment.