Skip to contentSkip to conversation

scripts: headers_install: Exit with error on config leak

PATCH Superseded Siddharth Gupta 2 participants 3 messages May 1, 2020 – May 3, 2020

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scripts: headers_install: Exit with error on config leak

Misuse of CONFIG_* in UAPI headers should result in an error as it exposes configuration of different targets to userspace.

---
 scripts/headers_install.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
scripts/headers_install.sh +2 -1
index a07668a..bd6c93a 100755
@@ -109,7 +109,8 @@ do
 	done
 
 	if [ "$warn" = 1 ]; then
-		echo "warning: $INFILE: leak $c to user-space" >&2
+		echo "error: $INFILE: leak $c to user-space" >&2
+		exit 1
 	fi
 done
 
Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
#1 lore raw
Quoted 14 lines · Siddharth Gupta

Misuse of CONFIG_* in UAPI headers should result in an error as it exposes configuration of different targets to userspace.

---
 scripts/headers_install.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
scripts/headers_install.sh +0 -0
index a07668a..bd6c93a 100755

scripts/headers_install.sh do · line 115

Quoted 8 lines
scripts/headers_install.sh +2 -1
@@ -109,7 +109,8 @@ do
        done
 
        if [ "$warn" = 1 ]; then
-               echo "warning: $INFILE: leak $c to user-space" >&2
+               echo "error: $INFILE: leak $c to user-space" >&2
+               exit 1
        fi
 done

If you want to change this,
please update the comment at line 67.

Also, rename the variable $warn to
something else, $error or $leak_error, etc. ?

Signature · 2 lines
Best Regards
Masahiro Yamada
#2 lore raw

Sure I will make the recommended changes and send a v2 of the patch.

Thanks,
Siddharth

Quoted 31 lines · Masahiro Yamada
Quoted 13 lines · Siddharth Gupta

Misuse of CONFIG_* in UAPI headers should result in an error as it exposes configuration of different targets to userspace.

---
  scripts/headers_install.sh | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
scripts/headers_install.sh +0 -0
index a07668a..bd6c93a 100755

scripts/headers_install.sh do · line 115

Quoted 8 lines
scripts/headers_install.sh +2 -1
@@ -109,7 +109,8 @@ do
         done
 
         if [ "$warn" = 1 ]; then
-               echo "warning: $INFILE: leak $c to user-space" >&2
+               echo "error: $INFILE: leak $c to user-space" >&2
+               exit 1
         fi
  done

If you want to change this,
please update the comment at line 67.

Also, rename the variable $warn to
something else, $error or $leak_error, etc. ?