From d8b3ae6f330d1ece430ec703cc384cd5010cbdd3 Mon Sep 17 00:00:00 2001 From: GLVS Kiriti Date: Mon, 25 Mar 2024 21:12:56 +0530 Subject: [PATCH] User uid is set to non zero when generating the event Signed-off-by: GLVS Kiriti --- ...n_of_page_faults_handling_to_a_userspace_process.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/events/syscall/unprivileged_delegation_of_page_faults_handling_to_a_userspace_process.go b/events/syscall/unprivileged_delegation_of_page_faults_handling_to_a_userspace_process.go index a0e29d3d..eb3f2c30 100644 --- a/events/syscall/unprivileged_delegation_of_page_faults_handling_to_a_userspace_process.go +++ b/events/syscall/unprivileged_delegation_of_page_faults_handling_to_a_userspace_process.go @@ -28,7 +28,11 @@ var _ = events.Register( ) func UnprivilegedDelegationofPageFaultsHandlingtoaUserspaceProcess(h events.Helper) error { - // Create userfaultfd syscall - _, _, errNo := unix.Syscall(unix.SYS_USERFAULTFD, 0, 0, 0) - return errNo + // To make user.uid != 0 + if err := becameUser(h, "daemon"); err != nil { + return err + } + // Attempt to create userfaultfd syscall is enough + unix.Syscall(unix.SYS_USERFAULTFD, 0, 0, 0) + return nil }