diff options
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/Makefile.gcc-plugins | 2 | ||||
-rw-r--r-- | scripts/Makefile.kasan | 5 | ||||
-rwxr-xr-x | scripts/checkpatch.pl | 51 | ||||
-rwxr-xr-x | scripts/decode_stacktrace.sh | 9 | ||||
-rwxr-xr-x | scripts/dtc/dtx_diff | 13 | ||||
-rw-r--r-- | scripts/gcc-plugins/Kconfig | 62 | ||||
-rw-r--r-- | scripts/gcc-plugins/structleak_plugin.c | 36 | ||||
-rw-r--r-- | scripts/gdb/linux/constants.py.in | 12 | ||||
-rw-r--r-- | scripts/gdb/linux/proc.py | 12 | ||||
-rwxr-xr-x | scripts/kernel-doc | 2 | ||||
-rwxr-xr-x | scripts/leaking_addresses.pl | 9 | ||||
-rw-r--r-- | scripts/mod/devicetable-offsets.c | 6 | ||||
-rw-r--r-- | scripts/mod/file2alias.c | 47 | ||||
-rwxr-xr-x | scripts/spdxcheck.py | 8 | ||||
-rw-r--r-- | scripts/spelling.txt | 69 | ||||
-rwxr-xr-x | scripts/ver_linux | 6 |
16 files changed, 276 insertions, 73 deletions
diff --git a/scripts/Makefile.gcc-plugins b/scripts/Makefile.gcc-plugins index 35042d96cf5d..5f7df50cfe7a 100644 --- a/scripts/Makefile.gcc-plugins +++ b/scripts/Makefile.gcc-plugins @@ -15,6 +15,8 @@ gcc-plugin-$(CONFIG_GCC_PLUGIN_SANCOV) += sancov_plugin.so gcc-plugin-$(CONFIG_GCC_PLUGIN_STRUCTLEAK) += structleak_plugin.so gcc-plugin-cflags-$(CONFIG_GCC_PLUGIN_STRUCTLEAK_VERBOSE) \ += -fplugin-arg-structleak_plugin-verbose +gcc-plugin-cflags-$(CONFIG_GCC_PLUGIN_STRUCTLEAK_BYREF) \ + += -fplugin-arg-structleak_plugin-byref gcc-plugin-cflags-$(CONFIG_GCC_PLUGIN_STRUCTLEAK_BYREF_ALL) \ += -fplugin-arg-structleak_plugin-byref-all gcc-plugin-cflags-$(CONFIG_GCC_PLUGIN_STRUCTLEAK) \ diff --git a/scripts/Makefile.kasan b/scripts/Makefile.kasan index 6deabedc67fc..6410bd22fe38 100644 --- a/scripts/Makefile.kasan +++ b/scripts/Makefile.kasan @@ -27,14 +27,9 @@ else $(call cc-param,asan-globals=1) \ $(call cc-param,asan-instrumentation-with-call-threshold=$(call_threshold)) \ $(call cc-param,asan-stack=$(CONFIG_KASAN_STACK)) \ - $(call cc-param,asan-use-after-scope=1) \ $(call cc-param,asan-instrument-allocas=1) endif -ifdef CONFIG_KASAN_EXTRA -CFLAGS_KASAN += $(call cc-option, -fsanitize-address-use-after-scope) -endif - endif # CONFIG_KASAN_GENERIC ifdef CONFIG_KASAN_SW_TAGS diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index b737ca9d7204..5b756278df13 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -61,7 +61,7 @@ my $codespellfile = "/usr/share/codespell/dictionary.txt"; my $conststructsfile = "$D/const_structs.checkpatch"; my $typedefsfile = ""; my $color = "auto"; -my $allow_c99_comments = 1; +my $allow_c99_comments = 1; # Can be overridden by --ignore C99_COMMENT_TOLERANCE sub help { my ($exitcode) = @_; @@ -466,6 +466,16 @@ our $logFunctions = qr{(?x: seq_vprintf|seq_printf|seq_puts )}; +our $allocFunctions = qr{(?x: + (?:(?:devm_)? + (?:kv|k|v)[czm]alloc(?:_node|_array)? | + kstrdup(?:_const)? | + kmemdup(?:_nul)?) | + (?:\w+)?alloc_skb(?:ip_align)? | + # dev_alloc_skb/netdev_alloc_skb, et al + dma_alloc_coherent +)}; + our $signature_tags = qr{(?xi: Signed-off-by:| Co-developed-by:| @@ -1011,6 +1021,7 @@ if ($git) { } my $vname; +$allow_c99_comments = !defined $ignore_type{"C99_COMMENT_TOLERANCE"}; for my $filename (@ARGV) { my $FILE; if ($git) { @@ -3037,6 +3048,14 @@ sub process { $comment = '..'; } +# check SPDX comment style for .[chsS] files + if ($realfile =~ /\.[chsS]$/ && + $rawline =~ /SPDX-License-Identifier:/ && + $rawline !~ /^\+\s*\Q$comment\E\s*/) { + WARN("SPDX_LICENSE_TAG", + "Improper SPDX comment style for '$realfile', please use '$comment' instead\n" . $herecurr); + } + if ($comment !~ /^$/ && $rawline !~ /^\+\Q$comment\E SPDX-License-Identifier: /) { WARN("SPDX_LICENSE_TAG", @@ -3054,6 +3073,14 @@ sub process { # check we are in a valid source file if not then ignore this hunk next if ($realfile !~ /\.(h|c|s|S|sh|dtsi|dts)$/); +# check for using SPDX-License-Identifier on the wrong line number + if ($realline != $checklicenseline && + $rawline =~ /\bSPDX-License-Identifier:/ && + substr($line, @-, @+ - @-) eq "$;" x (@+ - @-)) { + WARN("SPDX_LICENSE_TAG", + "Misplaced SPDX-License-Identifier tag - use line $checklicenseline instead\n" . $herecurr); + } + # line length limit (with some exclusions) # # There are a few types of lines that may extend beyond $max_line_length: @@ -5545,7 +5572,8 @@ sub process { my ($s, $c) = ctx_statement_block($linenr - 3, $realcnt, 0); # print("line: <$line>\nprevline: <$prevline>\ns: <$s>\nc: <$c>\n\n\n"); - if ($s =~ /(?:^|\n)[ \+]\s*(?:$Type\s*)?\Q$testval\E\s*=\s*(?:\([^\)]*\)\s*)?\s*(?:devm_)?(?:[kv][czm]alloc(?:_node|_array)?\b|kstrdup|kmemdup|(?:dev_)?alloc_skb)/) { + if ($s =~ /(?:^|\n)[ \+]\s*(?:$Type\s*)?\Q$testval\E\s*=\s*(?:\([^\)]*\)\s*)?\s*$allocFunctions\s*\(/ && + $s !~ /\b__GFP_NOWARN\b/ ) { WARN("OOM_MESSAGE", "Possible unnecessary 'out of memory' message\n" . $hereprev); } @@ -6196,8 +6224,8 @@ sub process { } } -# check for pointless casting of kmalloc return - if ($line =~ /\*\s*\)\s*[kv][czm]alloc(_node){0,1}\b/) { +# check for pointless casting of alloc functions + if ($line =~ /\*\s*\)\s*$allocFunctions\b/) { WARN("UNNECESSARY_CASTS", "unnecessary cast may hide bugs, see http://c-faq.com/malloc/mallocnocast.html\n" . $herecurr); } @@ -6205,7 +6233,7 @@ sub process { # alloc style # p = alloc(sizeof(struct foo), ...) should be p = alloc(sizeof(*p), ...) if ($perl_version_ok && - $line =~ /\b($Lval)\s*\=\s*(?:$balanced_parens)?\s*([kv][mz]alloc(?:_node)?)\s*\(\s*(sizeof\s*\(\s*struct\s+$Lval\s*\))/) { + $line =~ /\b($Lval)\s*\=\s*(?:$balanced_parens)?\s*((?:kv|k|v)[mz]alloc(?:_node)?)\s*\(\s*(sizeof\s*\(\s*struct\s+$Lval\s*\))/) { CHK("ALLOC_SIZEOF_STRUCT", "Prefer $3(sizeof(*$1)...) over $3($4...)\n" . $herecurr); } @@ -6368,19 +6396,6 @@ sub process { } } -# check for bool bitfields - if ($sline =~ /^.\s+bool\s*$Ident\s*:\s*\d+\s*;/) { - WARN("BOOL_BITFIELD", - "Avoid using bool as bitfield. Prefer bool bitfields as unsigned int or u<8|16|32>\n" . $herecurr); - } - -# check for bool use in .h files - if ($realfile =~ /\.h$/ && - $sline =~ /^.\s+bool\s*$Ident\s*(?::\s*d+\s*)?;/) { - CHK("BOOL_MEMBER", - "Avoid using bool structure members because of possible alignment issues - see: https://lkml.org/lkml/2017/11/21/384\n" . $herecurr); - } - # check for semaphores initialized locked if ($line =~ /^.\s*sema_init.+,\W?0\W?\)/) { WARN("CONSIDER_COMPLETION", diff --git a/scripts/decode_stacktrace.sh b/scripts/decode_stacktrace.sh index 98a7d63a723e..bcdd45df3f51 100755 --- a/scripts/decode_stacktrace.sh +++ b/scripts/decode_stacktrace.sh @@ -37,6 +37,13 @@ parse_symbol() { symbol=${symbol#\(} symbol=${symbol%\)} + # Strip segment + local segment + if [[ $symbol == *:* ]] ; then + segment=${symbol%%:*}: + symbol=${symbol#*:} + fi + # Strip the symbol name so that we could look it up local name=${symbol%+*} @@ -84,7 +91,7 @@ parse_symbol() { code=${code//$'\n'/' '} # Replace old address with pretty line numbers - symbol="$name ($code)" + symbol="$segment$name ($code)" } decode_code() { diff --git a/scripts/dtc/dtx_diff b/scripts/dtc/dtx_diff index 8c4fbad2055e..0d8572008729 100755 --- a/scripts/dtc/dtx_diff +++ b/scripts/dtc/dtx_diff @@ -21,6 +21,7 @@ Usage: diff DTx_1 and DTx_2 + --annotate synonym for -T -f print full dts in diff (--unified=99999) -h synonym for --help -help synonym for --help @@ -28,6 +29,7 @@ Usage: -s SRCTREE linux kernel source tree is at path SRCTREE (default is current directory) -S linux kernel source tree is at root of current git repo + -T Annotate output .dts with input source file and line (-T -T for more details) -u unsorted, do not sort DTx @@ -174,6 +176,7 @@ compile_to_dts() { # ----- start of script +annotate="" cmd_diff=0 diff_flags="-u" dtx_file_1="" @@ -208,6 +211,14 @@ while [ $# -gt 0 ] ; do shift ;; + -T | --annotate ) + if [ "${annotate}" = "" ] ; then + annotate="-T" + elif [ "${annotate}" = "-T" ] ; then + annotate="-T -T" + fi + shift + ;; -u ) dtc_sort="" shift @@ -327,7 +338,7 @@ cpp_flags="\ DTC="\ ${DTC} \ -i ${srctree}/scripts/dtc/include-prefixes \ - -O dts -qq -f ${dtc_sort} -o -" + -O dts -qq -f ${dtc_sort} ${annotate} -o -" # ----- do the diff or decompile diff --git a/scripts/gcc-plugins/Kconfig b/scripts/gcc-plugins/Kconfig index d45f7f36b859..74271dba4f94 100644 --- a/scripts/gcc-plugins/Kconfig +++ b/scripts/gcc-plugins/Kconfig @@ -67,27 +67,59 @@ config GCC_PLUGIN_LATENT_ENTROPY * https://pax.grsecurity.net/ config GCC_PLUGIN_STRUCTLEAK - bool "Force initialization of variables containing userspace addresses" - # Currently STRUCTLEAK inserts initialization out of live scope of - # variables from KASAN point of view. This leads to KASAN false - # positive reports. Prohibit this combination for now. - depends on !KASAN_EXTRA + bool "Zero initialize stack variables" help - This plugin zero-initializes any structures containing a - __user attribute. This can prevent some classes of information - exposures. - - This plugin was ported from grsecurity/PaX. More information at: + While the kernel is built with warnings enabled for any missed + stack variable initializations, this warning is silenced for + anything passed by reference to another function, under the + occasionally misguided assumption that the function will do + the initialization. As this regularly leads to exploitable + flaws, this plugin is available to identify and zero-initialize + such variables, depending on the chosen level of coverage. + + This plugin was originally ported from grsecurity/PaX. More + information at: * https://grsecurity.net/ * https://pax.grsecurity.net/ -config GCC_PLUGIN_STRUCTLEAK_BYREF_ALL - bool "Force initialize all struct type variables passed by reference" +choice + prompt "Coverage" depends on GCC_PLUGIN_STRUCTLEAK - depends on !COMPILE_TEST + default GCC_PLUGIN_STRUCTLEAK_BYREF_ALL help - Zero initialize any struct type local variable that may be passed by - reference without having been initialized. + This chooses the level of coverage over classes of potentially + uninitialized variables. The selected class will be + zero-initialized before use. + + config GCC_PLUGIN_STRUCTLEAK_USER + bool "structs marked for userspace" + help + Zero-initialize any structures on the stack containing + a __user attribute. This can prevent some classes of + uninitialized stack variable exploits and information + exposures, like CVE-2013-2141: + https://git.kernel.org/linus/b9e146d8eb3b9eca + + config GCC_PLUGIN_STRUCTLEAK_BYREF + bool "structs passed by reference" + help + Zero-initialize any structures on the stack that may + be passed by reference and had not already been + explicitly initialized. This can prevent most classes + of uninitialized stack variable exploits and information + exposures, like CVE-2017-1000410: + https://git.kernel.org/linus/06e7e776ca4d3654 + + config GCC_PLUGIN_STRUCTLEAK_BYREF_ALL + bool "anything passed by reference" + help + Zero-initialize any stack variables that may be passed + by reference and had not already been explicitly + initialized. This is intended to eliminate all classes + of uninitialized stack variable exploits and information + exposures. + +endchoice config GCC_PLUGIN_STRUCTLEAK_VERBOSE bool "Report forcefully initialized variables" diff --git a/scripts/gcc-plugins/structleak_plugin.c b/scripts/gcc-plugins/structleak_plugin.c index 10292f791e99..e89be8f5c859 100644 --- a/scripts/gcc-plugins/structleak_plugin.c +++ b/scripts/gcc-plugins/structleak_plugin.c @@ -16,6 +16,7 @@ * Options: * -fplugin-arg-structleak_plugin-disable * -fplugin-arg-structleak_plugin-verbose + * -fplugin-arg-structleak_plugin-byref * -fplugin-arg-structleak_plugin-byref-all * * Usage: @@ -26,7 +27,6 @@ * $ gcc -fplugin=./structleak_plugin.so test.c -O2 * * TODO: eliminate redundant initializers - * increase type coverage */ #include "gcc-common.h" @@ -37,13 +37,18 @@ __visible int plugin_is_GPL_compatible; static struct plugin_info structleak_plugin_info = { - .version = "201607271510vanilla", + .version = "20190125vanilla", .help = "disable\tdo not activate plugin\n" - "verbose\tprint all initialized variables\n", + "byref\tinit structs passed by reference\n" + "byref-all\tinit anything passed by reference\n" + "verbose\tprint all initialized variables\n", }; +#define BYREF_STRUCT 1 +#define BYREF_ALL 2 + static bool verbose; -static bool byref_all; +static int byref; static tree handle_user_attribute(tree *node, tree name, tree args, int flags, bool *no_add_attrs) { @@ -118,6 +123,7 @@ static void initialize(tree var) gimple_stmt_iterator gsi; tree initializer; gimple init_stmt; + tree type; /* this is the original entry bb before the forced split */ bb = single_succ(ENTRY_BLOCK_PTR_FOR_FN(cfun)); @@ -148,11 +154,15 @@ static void initialize(tree var) if (verbose) inform(DECL_SOURCE_LOCATION(var), "%s variable will be forcibly initialized", - (byref_all && TREE_ADDRESSABLE(var)) ? "byref" - : "userspace"); + (byref && TREE_ADDRESSABLE(var)) ? "byref" + : "userspace"); /* build the initializer expression */ - initializer = build_constructor(TREE_TYPE(var), NULL); + type = TREE_TYPE(var); + if (AGGREGATE_TYPE_P(type)) + initializer = build_constructor(type, NULL); + else + initializer = fold_convert(type, integer_zero_node); /* build the initializer stmt */ init_stmt = gimple_build_assign(var, initializer); @@ -184,13 +194,13 @@ static unsigned int structleak_execute(void) if (!auto_var_in_fn_p(var, current_function_decl)) continue; - /* only care about structure types */ - if (TREE_CODE(type) != RECORD_TYPE && TREE_CODE(type) != UNION_TYPE) + /* only care about structure types unless byref-all */ + if (byref != BYREF_ALL && TREE_CODE(type) != RECORD_TYPE && TREE_CODE(type) != UNION_TYPE) continue; /* if the type is of interest, examine the variable */ if (TYPE_USERSPACE(type) || - (byref_all && TREE_ADDRESSABLE(var))) + (byref && TREE_ADDRESSABLE(var))) initialize(var); } @@ -232,8 +242,12 @@ __visible int plugin_init(struct plugin_name_args *plugin_info, struct plugin_gc verbose = true; continue; } + if (!strcmp(argv[i].key, "byref")) { + byref = BYREF_STRUCT; + continue; + } if (!strcmp(argv[i].key, "byref-all")) { - byref_all = true; + byref = BYREF_ALL; continue; } error(G_("unknown option '-fplugin-arg-%s-%s'"), plugin_name, argv[i].key); diff --git a/scripts/gdb/linux/constants.py.in b/scripts/gdb/linux/constants.py.in index 7aad82406422..d3319a80788a 100644 --- a/scripts/gdb/linux/constants.py.in +++ b/scripts/gdb/linux/constants.py.in @@ -37,12 +37,12 @@ import gdb /* linux/fs.h */ -LX_VALUE(MS_RDONLY) -LX_VALUE(MS_SYNCHRONOUS) -LX_VALUE(MS_MANDLOCK) -LX_VALUE(MS_DIRSYNC) -LX_VALUE(MS_NOATIME) -LX_VALUE(MS_NODIRATIME) +LX_VALUE(SB_RDONLY) +LX_VALUE(SB_SYNCHRONOUS) +LX_VALUE(SB_MANDLOCK) +LX_VALUE(SB_DIRSYNC) +LX_VALUE(SB_NOATIME) +LX_VALUE(SB_NODIRATIME) /* linux/mount.h */ LX_VALUE(MNT_NOSUID) diff --git a/scripts/gdb/linux/proc.py b/scripts/gdb/linux/proc.py index 0aebd7565b03..2f01a958eb22 100644 --- a/scripts/gdb/linux/proc.py +++ b/scripts/gdb/linux/proc.py @@ -114,11 +114,11 @@ def info_opts(lst, opt): return opts -FS_INFO = {constants.LX_MS_SYNCHRONOUS: ",sync", - constants.LX_MS_MANDLOCK: ",mand", - constants.LX_MS_DIRSYNC: ",dirsync", - constants.LX_MS_NOATIME: ",noatime", - constants.LX_MS_NODIRATIME: ",nodiratime"} +FS_INFO = {constants.LX_SB_SYNCHRONOUS: ",sync", + constants.LX_SB_MANDLOCK: ",mand", + constants.LX_SB_DIRSYNC: ",dirsync", + constants.LX_SB_NOATIME: ",noatime", + constants.LX_SB_NODIRATIME: ",nodiratime"} MNT_INFO = {constants.LX_MNT_NOSUID: ",nosuid", constants.LX_MNT_NODEV: ",nodev", @@ -184,7 +184,7 @@ values of that process namespace""" fstype = superblock['s_type']['name'].string() s_flags = int(superblock['s_flags']) m_flags = int(vfs['mnt']['mnt_flags']) - rd = "ro" if (s_flags & constants.LX_MS_RDONLY) else "rw" + rd = "ro" if (s_flags & constants.LX_SB_RDONLY) else "rw" gdb.write( "{} {} {} {}{}{} 0 0\n" diff --git a/scripts/kernel-doc b/scripts/kernel-doc index c5333d251985..3350e498b4ce 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -1474,7 +1474,7 @@ sub push_parameter($$$$) { if (!defined $parameterdescs{$param} && $param !~ /^#/) { $parameterdescs{$param} = $undescribed; - if (show_warnings($type, $declaration_name)) { + if (show_warnings($type, $declaration_name) && $param !~ /\./) { print STDERR "${file}:$.: warning: Function parameter or member '$param' not described in '$declaration_name'\n"; ++$warnings; diff --git a/scripts/leaking_addresses.pl b/scripts/leaking_addresses.pl index 6a897788f5a7..ef9e5b2a1614 100755 --- a/scripts/leaking_addresses.pl +++ b/scripts/leaking_addresses.pl @@ -97,7 +97,7 @@ Options: --32-bit Scan 32-bit kernel. --page-offset-32-bit=o Page offset (for 32-bit kernel 0xABCD1234). -d, --debug Display debugging output. - -h, --help, --version Display this help and exit. + -h, --help Display this help and exit. Scans the running kernel for potential leaking addresses. @@ -108,7 +108,6 @@ EOM GetOptions( 'd|debug' => \$debug, 'h|help' => \$help, - 'version' => \$help, 'o|output-raw=s' => \$output_raw, 'i|input-raw=s' => \$input_raw, 'suppress-dmesg' => \$suppress_dmesg, @@ -231,7 +230,7 @@ sub get_kernel_config_option my $tmp_file = "/tmp/tmpkconf"; if (system("gunzip < /proc/config.gz > $tmp_file")) { - dprint "$0: system(gunzip < /proc/config.gz) failed\n"; + dprint("system(gunzip < /proc/config.gz) failed\n"); return ""; } else { @config_files = ($tmp_file); @@ -243,7 +242,7 @@ sub get_kernel_config_option } foreach my $file (@config_files) { - dprint("parsing config file: %s\n", $file); + dprint("parsing config file: $file\n"); $value = option_from_file($option, $file); if ($value ne "") { last; @@ -502,7 +501,7 @@ sub walk next; } - dprint "parsing: $path\n"; + dprint("parsing: $path\n"); timed_parse_file($path); } } diff --git a/scripts/mod/devicetable-offsets.c b/scripts/mod/devicetable-offsets.c index 293004499b4d..054405b90ba4 100644 --- a/scripts/mod/devicetable-offsets.c +++ b/scripts/mod/devicetable-offsets.c @@ -225,5 +225,11 @@ int main(void) DEVID_FIELD(typec_device_id, svid); DEVID_FIELD(typec_device_id, mode); + DEVID(tee_client_device_id); + DEVID_FIELD(tee_client_device_id, uuid); + + DEVID(wmi_device_id); + DEVID_FIELD(wmi_device_id, guid_string); + return 0; } diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c index a37af7d71973..e17a29ae2e97 100644 --- a/scripts/mod/file2alias.c +++ b/scripts/mod/file2alias.c @@ -37,6 +37,10 @@ typedef unsigned char __u8; typedef struct { __u8 b[16]; } uuid_le; +typedef struct { + __u8 b[16]; +} uuid_t; +#define UUID_STRING_LEN 36 /* Big exception to the "don't include kernel headers into userspace, which * even potentially has different endianness and word sizes, since @@ -50,6 +54,9 @@ struct devtable { int (*do_entry)(const char *filename, void *symval, char *alias); }; +/* Size of alias provided to do_entry functions */ +#define ALIAS_SIZE 500 + /* Define a variable f that holds the value of field f of struct devid * based at address m. */ @@ -1287,6 +1294,42 @@ static int do_typec_entry(const char *filename, void *symval, char *alias) return 1; } +/* Looks like: tee:uuid */ +static int do_tee_entry(const char *filename, void *symval, char *alias) +{ + DEF_FIELD(symval, tee_client_device_id, uuid); + + sprintf(alias, "tee:%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x", + uuid.b[0], uuid.b[1], uuid.b[2], uuid.b[3], uuid.b[4], + uuid.b[5], uuid.b[6], uuid.b[7], uuid.b[8], uuid.b[9], + uuid.b[10], uuid.b[11], uuid.b[12], uuid.b[13], uuid.b[14], + uuid.b[15]); + + add_wildcard(alias); + return 1; +} + +/* Looks like: wmi:guid */ +static int do_wmi_entry(const char *filename, void *symval, char *alias) +{ + int len; + DEF_FIELD_ADDR(symval, wmi_device_id, guid_string); + + if (strlen(*guid_string) != UUID_STRING_LEN) { + warn("Invalid WMI device id 'wmi:%s' in '%s'\n", + *guid_string, filename); + return 0; + } + + len = snprintf(alias, ALIAS_SIZE, WMI_MODULE_PREFIX "%s", *guid_string); + if (len < 0 || len >= ALIAS_SIZE) { + warn("Could not generate all MODULE_ALIAS's in '%s'\n", + filename); + return 0; + } + return 1; +} + /* Does namelen bytes of name exactly match the symbol? */ static bool sym_is(const char *name, unsigned namelen, const char *symbol) { @@ -1303,7 +1346,7 @@ static void do_table(void *symval, unsigned long size, struct module *mod) { unsigned int i; - char alias[500]; + char alias[ALIAS_SIZE]; device_id_check(mod->name, device_id, size, id_size, symval); /* Leave last one: it's the terminator. */ @@ -1357,6 +1400,8 @@ static const struct devtable devtable[] = { {"fslmc", SIZE_fsl_mc_device_id, do_fsl_mc_entry}, {"tbsvc", SIZE_tb_service_id, do_tbsvc_entry}, {"typec", SIZE_typec_device_id, do_typec_entry}, + {"tee", SIZE_tee_client_device_id, do_tee_entry}, + {"wmi", SIZE_wmi_device_id, do_wmi_entry}, }; /* Create MODULE_ALIAS() statements. diff --git a/scripts/spdxcheck.py b/scripts/spdxcheck.py index e559c6294c39..4fe392e507fb 100755 --- a/scripts/spdxcheck.py +++ b/scripts/spdxcheck.py @@ -175,7 +175,13 @@ class id_parser(object): self.lines_checked += 1 if line.find("SPDX-License-Identifier:") < 0: continue - expr = line.split(':')[1].replace('*/', '').strip() + expr = line.split(':')[1].strip() + # Remove trailing comment closure + if line.strip().endswith('*/'): + expr = expr.rstrip('*/').strip() + # Special case for SH magic boot code files + if line.startswith('LIST \"'): + expr = expr.rstrip('\"').strip() self.parse(expr) self.spdx_valid += 1 # diff --git a/scripts/spelling.txt b/scripts/spelling.txt index 517d0c3f83df..86b87332b9e5 100644 --- a/scripts/spelling.txt +++ b/scripts/spelling.txt @@ -10,6 +10,8 @@ abandonning||abandoning abigious||ambiguous abitrate||arbitrate +abnornally||abnormally +abnrormal||abnormal abord||abort aboslute||absolute abov||above @@ -107,6 +109,7 @@ ambigious||ambiguous amoung||among amout||amount amplifer||amplifier +amplifyer||amplifier an union||a union an user||a user an userspace||a userspace @@ -145,6 +148,7 @@ artillary||artillery asign||assign asser||assert assertation||assertion +assertting||asserting assiged||assigned assigment||assignment assigments||assignments @@ -168,6 +172,8 @@ attachement||attachment attched||attached attemps||attempts attemping||attempting +attepmpt||attempt +attnetion||attention attruibutes||attributes authentification||authentication automaticaly||automatically @@ -217,6 +223,7 @@ boardcast||broadcast borad||board boundry||boundary brievely||briefly +broadcase||broadcast broadcat||broadcast bufufer||buffer cacluated||calculated @@ -234,6 +241,7 @@ cancle||cancel capabilites||capabilities capabilty||capability capabitilies||capabilities +capablity||capability capatibilities||capabilities capapbilities||capabilities caputure||capture @@ -274,6 +282,7 @@ clared||cleared closeing||closing clustred||clustered coexistance||coexistence +colescing||coalescing collapsable||collapsible colorfull||colorful comand||command @@ -290,6 +299,7 @@ comsumer||consumer comsuming||consuming compability||compatibility compaibility||compatibility +comparsion||comparison compatability||compatibility compatable||compatible compatibiliy||compatibility @@ -303,6 +313,7 @@ completly||completely complient||compliant componnents||components compoment||component +comppatible||compatible compres||compress compresion||compression comression||compression @@ -368,6 +379,8 @@ decsribed||described decription||description dectected||detected defailt||default +deferal||deferral +deffered||deferred defferred||deferred definate||definite definately||definitely @@ -400,6 +413,7 @@ descritptor||descriptor desctiptor||descriptor desriptor||descriptor desriptors||descriptors +desination||destination destionation||destination destoried||destroyed destory||destroy @@ -426,7 +440,9 @@ diffrent||different differenciate||differentiate diffrentiate||differentiate difinition||definition +dimention||dimension dimesions||dimensions +dispalying||displaying diplay||display directon||direction direectly||directly @@ -442,6 +458,7 @@ disbled||disabled disconnet||disconnect discontinous||discontinuous disharge||discharge +disnabled||disabled dispertion||dispersion dissapears||disappears distiction||distinction @@ -456,6 +473,7 @@ dorp||drop dosen||doesn downlad||download downlads||downloads +droped||dropped druing||during dynmaic||dynamic eanable||enable @@ -471,6 +489,7 @@ elementry||elementary eletronic||electronic embeded||embedded enabledi||enabled +enble||enable enchanced||enhanced encorporating||incorporating encrupted||encrypted @@ -479,6 +498,9 @@ encryptio||encryption endianess||endianness enhaced||enhanced enlightnment||enlightenment +enqueing||enqueuing +entires||entries +entites||entities entrys||entries enocded||encoded enterily||entirely @@ -498,6 +520,8 @@ etsbalishment||establishment excecutable||executable exceded||exceeded excellant||excellent +execeeded||exceeded +execeeds||exceeds exeed||exceed existance||existence existant||existent @@ -506,6 +530,7 @@ exlcude||exclude exlcusive||exclusive exmaple||example expecially||especially +experies||expires explicite||explicit explicitely||explicitly explict||explicit @@ -521,6 +546,7 @@ extracter||extractor faield||failed falied||failed faild||failed +failded||failed failer||failure faill||fail failied||failed @@ -540,6 +566,7 @@ fetaure||feature fetaures||features fileystem||filesystem fimware||firmware +firmare||firmware firware||firmware finanize||finalize findn||find @@ -574,6 +601,7 @@ funtions||functions furthur||further futhermore||furthermore futrue||future +gauage||gauge gaurenteed||guaranteed generiously||generously genereate||generate @@ -645,6 +673,7 @@ independed||independent indiate||indicate indicat||indicate inexpect||inexpected +inferface||interface infomation||information informatiom||information informations||information @@ -662,14 +691,17 @@ initialiazation||initialization initializiation||initialization initialze||initialize initialzed||initialized +initialzing||initializing initilization||initialization initilize||initialize inofficial||unofficial inrerface||interface insititute||institute +instace||instance instal||install instanciate||instantiate instanciated||instantiated +insufficent||insufficient inteface||interface integreated||integrated integrety||integrity @@ -684,6 +716,8 @@ intermittant||intermittent internel||internal interoprability||interoperability interuupt||interrupt +interupt||interrupt +interupts||interrupts interrface||interface interrrupt||interrupt interrup||interrupt @@ -699,11 +733,14 @@ intialization||initialization intialized||initialized intialize||initialize intregral||integral +intrerrupt||interrupt intrrupt||interrupt intterrupt||interrupt intuative||intuitive inavlid||invalid invaid||invalid +invaild||invalid +invailid||invalid invald||invalid invalde||invalid invalide||invalid @@ -712,6 +749,7 @@ invalud||invalid invididual||individual invokation||invocation invokations||invocations +ireelevant||irrelevant irrelevent||irrelevant isnt||isn't isssue||issue @@ -747,6 +785,7 @@ loobpack||loopback loosing||losing losted||lost machinary||machinery +maibox||mailbox maintainance||maintenance maintainence||maintenance maintan||maintain @@ -758,14 +797,19 @@ managable||manageable managment||management mangement||management manoeuvering||maneuvering +manufaucturing||manufacturing mappping||mapping matchs||matches mathimatical||mathematical mathimatic||mathematic mathimatics||mathematics +maximium||maximum maxium||maximum mechamism||mechanism meetign||meeting +memeory||memory +memmber||member +memoery||memory ment||meant mergable||mergeable mesage||message @@ -779,6 +823,7 @@ migrateable||migratable milliseonds||milliseconds minium||minimum minimam||minimum +miniumum||minimum minumum||minimum misalinged||misaligned miscelleneous||miscellaneous @@ -839,6 +884,7 @@ occurence||occurrence occure||occurred occured||occurred occuring||occurring +offser||offset offet||offset offloded||offloaded omited||omitted @@ -855,6 +901,7 @@ optmizations||optimizations orientatied||orientated orientied||oriented orignal||original +originial||original otherise||otherwise ouput||output oustanding||outstanding @@ -874,6 +921,7 @@ packege||package packge||package packtes||packets pakage||package +paket||packet pallette||palette paln||plan paramameters||parameters @@ -886,6 +934,8 @@ paramters||parameters parmaters||parameters particuarly||particularly particularily||particularly +partion||partition +partions||partitions partiton||partition pased||passed passin||passing @@ -897,10 +947,12 @@ peice||piece pendantic||pedantic peprocessor||preprocessor perfoming||performing +peripherial||peripheral permissons||permissions peroid||period persistance||persistence persistant||persistent +phoneticly||phonetically plalform||platform platfoem||platform platfrom||platform @@ -915,6 +967,7 @@ posible||possible positon||position possibilites||possibilities powerfull||powerful +pramater||parameter preamle||preamble preample||preamble preapre||prepare @@ -976,6 +1029,7 @@ psudo||pseudo psuedo||pseudo psychadelic||psychedelic pwoer||power +queing||queuing quering||querying randomally||randomly raoming||roaming @@ -1004,6 +1058,7 @@ refering||referring refernces||references refernnce||reference refrence||reference +registed||registered registerd||registered registeration||registration registeresd||registered @@ -1018,6 +1073,7 @@ regulamentations||regulations reigstration||registration releated||related relevent||relevant +reloade||reload remoote||remote remore||remote removeable||removable @@ -1036,19 +1092,23 @@ requried||required requst||request reregisteration||reregistration reseting||resetting +reseved||reserved reseverd||reserved resizeable||resizable resouce||resource resouces||resources resoures||resources responce||response +resrouce||resource ressizes||resizes ressource||resource ressources||resources restesting||retesting +resumbmitting||resubmitting retransmited||retransmitted retreived||retrieved retreive||retrieve +retreiving||retrieving retrive||retrieve retuned||returned reudce||reduce @@ -1120,6 +1180,7 @@ sleeped||slept softwares||software speach||speech specfic||specific +specfield||specified speciefied||specified specifc||specific specifed||specified @@ -1142,7 +1203,10 @@ staion||station standardss||standards standartization||standardization standart||standard +standy||standby +stardard||standard staticly||statically +statuss||status stoped||stopped stoping||stopping stoppped||stopped @@ -1227,12 +1291,14 @@ tipically||typically timeing||timing timout||timeout tmis||this +toogle||toggle torerable||tolerable traking||tracking tramsmitted||transmitted tramsmit||transmit tranasction||transaction tranfer||transfer +transcevier||transceiver transciever||transceiver transferd||transferred transfered||transferred @@ -1267,6 +1333,7 @@ unfortunatelly||unfortunately unifiy||unify uniterrupted||uninterrupted unintialized||uninitialized +unitialized||uninitialized unkmown||unknown unknonw||unknown unknow||unknown @@ -1291,7 +1358,9 @@ unsuccessfull||unsuccessful unsuported||unsupported untill||until unuseful||useless +unvalid||invalid upate||update +upsupported||unsupported usefule||useful usefull||useful usege||usage diff --git a/scripts/ver_linux b/scripts/ver_linux index a6c728db05ce..810e608baa24 100755 --- a/scripts/ver_linux +++ b/scripts/ver_linux @@ -13,6 +13,8 @@ BEGIN { system("uname -a") printf("\n") + vernum = "[0-9]+([.]?[0-9]+)+" + printversion("GNU C", version("gcc -dumpversion")) printversion("GNU Make", version("make --version")) printversion("Binutils", version("ld -v")) @@ -34,7 +36,7 @@ BEGIN { while (getline <"/proc/self/maps" > 0) { if (/libc.*\.so$/) { n = split($0, procmaps, "/") - if (match(procmaps[n], /[0-9]+([.]?[0-9]+)+/)) { + if (match(procmaps[n], vernum)) { ver = substr(procmaps[n], RSTART, RLENGTH) printversion("Linux C Library", ver) break @@ -70,7 +72,7 @@ BEGIN { function version(cmd, ver) { cmd = cmd " 2>&1" while (cmd | getline > 0) { - if (match($0, /[0-9]+([.]?[0-9]+)+/)) { + if (match($0, vernum)) { ver = substr($0, RSTART, RLENGTH) break } |