File tree Expand file tree Collapse file tree 3 files changed +24
-0
lines changed Expand file tree Collapse file tree 3 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -1030,6 +1030,12 @@ config WARN_EXPERIMENTAL
10301030 Print a warning when the Kconfig tree is parsed if any experimental
10311031 features are enabled.
10321032
1033+ config NOT_SECURE
1034+ bool
1035+ help
1036+ Symbol to be selected by a feature to inidicate that feature is
1037+ not secure.
1038+
10331039config TAINT
10341040 bool
10351041 help
Original file line number Diff line number Diff line change @@ -93,6 +93,8 @@ def main():
9393 if kconf .syms .get ('WARN_EXPERIMENTAL' , kconf .y ).tri_value == 2 :
9494 check_experimental (kconf )
9595
96+ check_not_secure (kconf )
97+
9698 # Hack: Force all symbols to be evaluated, to catch warnings generated
9799 # during evaluation. Wait till the end to write the actual output files, so
98100 # that we don't generate any output if there are warnings-turned-errors.
@@ -266,6 +268,16 @@ def check_experimental(kconf):
266268 selector_name = split_expr (selector , AND )[0 ].name
267269 warn (f'Experimental symbol { selector_name } is enabled.' )
268270
271+ def check_not_secure (kconf ):
272+ not_secure = kconf .syms .get ('NOT_SECURE' )
273+ dep_expr = kconf .n if not_secure is None else not_secure .rev_dep
274+
275+ if dep_expr is not kconf .n :
276+ selectors = [s for s in split_expr (dep_expr , OR ) if expr_value (s ) == 2 ]
277+ for selector in selectors :
278+ selector_name = split_expr (selector , AND )[0 ].name
279+ warn (f'Not secure symbol { selector_name } is enabled.' )
280+
269281
270282def promptless (sym ):
271283 # Returns True if 'sym' has no prompt. Since the symbol might be defined in
Original file line number Diff line number Diff line change @@ -69,6 +69,12 @@ config WARN_DEPRECATED
6969 Print a warning when the Kconfig tree is parsed if any deprecated
7070 features are enabled.
7171
72+ config NOT_SECURE
73+ bool
74+ help
75+ Symbol to be selected by a feature to inidicate that feature is
76+ not secure.
77+
7278rsource "images/Kconfig"
7379
7480menu "Build options"
You can’t perform that action at this time.
0 commit comments