Skip to content

Commit

Permalink
User uid is set to non zero when generating the event
Browse files Browse the repository at this point in the history
Signed-off-by: GLVS Kiriti <[email protected]>
  • Loading branch information
GLVSKiriti authored and poiana committed Apr 3, 2024
1 parent 8a7d857 commit 786ea1c
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit 786ea1c

Please sign in to comment.