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 committed Mar 25, 2024
1 parent ac7a794 commit d8b3ae6
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 d8b3ae6

Please sign in to comment.