Check that a kconfig option value is sane
authorAlexander Popov <alex.popov@linux.com>
Sun, 19 Jun 2022 20:45:41 +0000 (23:45 +0300)
committerAlexander Popov <alex.popov@linux.com>
Sun, 19 Jun 2022 20:45:41 +0000 (23:45 +0300)
kconfig_hardened_check/__init__.py

index ac2d6f65847662ca9d4f96ad96cb67102190c8d2..58d82f2b015f51dd4d54871907154f63351ee1ca 100644 (file)
@@ -784,6 +784,8 @@ def parse_kconfig_file(parsed_options, fname):
 
             if opt_is_on.match(line):
                 option, value = line.split('=', 1)
+                if value == 'is not set':
+                    sys.exit('[!] ERROR: bad enabled kconfig option "{}"'.format(line))
             elif opt_is_off.match(line):
                 option, value = line[2:].split(' ', 1)
                 if value != 'is not set':