Skip to content
This repository has been archived by the owner on Jan 20, 2022. It is now read-only.

Commit

Permalink
Disallow running Graphene as root
Browse files Browse the repository at this point in the history
Signed-off-by: Borys Popławski <borysp@invisiblethingslab.com>
  • Loading branch information
boryspoplawski committed Aug 18, 2021
1 parent 398727e commit 02c9419
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Runtime/pal_loader
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@ then
exit 1
fi

if [ "00" -eq "0$(id -u 2>/dev/null)" ]
then
if tail /proc/kallsyms 2>/dev/null | grep -q ffff
then
echo "Please don't run Graphene as root!" >&2
exit 1
fi
fi

PAL_CMD=@PAL_CMD@
LIBPAL_PATH=@LIBPAL_PATH@
HOST_PAL_PATH=@HOST_PAL_PATH@
Expand Down

0 comments on commit 02c9419

Please sign in to comment.