Skip to content

Commit

Permalink
kbuild: check for leaked CONFIG_ symbols to userspace
Browse files Browse the repository at this point in the history
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
  • Loading branch information
Sam Ravnborg committed Jan 2, 2009
1 parent 46b8af5 commit 7e557a2
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion scripts/headers_check.pl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#
# 2) It is checked that prototypes does not use "extern"
#
# 3) TODO: check for leaked CONFIG_ symbols
# 3) Check for leaked CONFIG_ symbols

use strict;

Expand All @@ -36,6 +36,7 @@
$lineno++;
check_include();
check_prototypes();
check_config();
}
close FH;
}
Expand Down Expand Up @@ -64,3 +65,11 @@ sub check_prototypes
printf STDERR "$filename:$lineno: extern's make no sense in userspace\n";
}
}

sub check_config
{
if ($line =~ m/[^a-zA-Z0-9_]+CONFIG_([a-zA-Z0-9]+)[^a-zA-Z0-9]/) {
printf STDERR "$filename:$lineno: leaks CONFIG_$1 to userspace where it is not valid\n";
}
}

0 comments on commit 7e557a2

Please sign in to comment.