Skip to content

Commit

Permalink
scripts: headers_install: Exit with error on config leak
Browse files Browse the repository at this point in the history
Misuse of CONFIG_* in UAPI headers should result in an error. These config
options can be set in userspace by the user application which includes
these headers to control the APIs and structures being used in a kernel
which supports multiple targets.

Signed-off-by: Siddharth Gupta <[email protected]>
Signed-off-by: Masahiro Yamada <[email protected]>
  • Loading branch information
Siddharth Gupta authored and masahir0y committed May 25, 2020
1 parent 0663c68 commit 5967577
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions scripts/headers_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ configs=$(sed -e '
d
' $OUTFILE)

# The entries in the following list are not warned.
# The entries in the following list do not result in an error.
# Please do not add a new entry. This list is only for existing ones.
# The list will be reduced gradually, and deleted eventually. (hopefully)
#
Expand Down Expand Up @@ -98,18 +98,19 @@ include/uapi/linux/raw.h:CONFIG_MAX_RAW_DEVS

for c in $configs
do
warn=1
leak_error=1

for ignore in $config_leak_ignores
do
if echo "$INFILE:$c" | grep -q "$ignore$"; then
warn=
leak_error=
break
fi
done

if [ "$warn" = 1 ]; then
echo "warning: $INFILE: leak $c to user-space" >&2
if [ "$leak_error" = 1 ]; then
echo "error: $INFILE: leak $c to user-space" >&2
exit 1
fi
done

Expand Down

0 comments on commit 5967577

Please sign in to comment.