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

Disallow running Graphene as root #2654

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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