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 <[email protected]>
  • Loading branch information
boryspoplawski committed Aug 18, 2021
1 parent 398727e commit ee08211
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Runtime/pal_loader
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,16 @@ then
exit 1
fi

if [ -z "$I_AM_AWARE_OF_CONSEQUENCES_AND_I_WONT_SUBMIT_GRAPHENE_REPORTS_WITH_THIS_ENABLED" ] && \
[ "$(id -u 2>/dev/null)" == "0" ]
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 ee08211

Please sign in to comment.