aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/Makefile.gcc-plugins2
-rw-r--r--scripts/Makefile.kasan7
-rwxr-xr-xscripts/atomic/atomic-tbl.sh186
-rwxr-xr-xscripts/atomic/atomics.tbl41
-rwxr-xr-xscripts/atomic/check-atomics.sh33
-rwxr-xr-xscripts/atomic/fallbacks/acquire9
-rwxr-xr-xscripts/atomic/fallbacks/add_negative16
-rwxr-xr-xscripts/atomic/fallbacks/add_unless16
-rwxr-xr-xscripts/atomic/fallbacks/andnot7
-rwxr-xr-xscripts/atomic/fallbacks/dec7
-rwxr-xr-xscripts/atomic/fallbacks/dec_and_test15
-rwxr-xr-xscripts/atomic/fallbacks/dec_if_positive15
-rwxr-xr-xscripts/atomic/fallbacks/dec_unless_positive14
-rwxr-xr-xscripts/atomic/fallbacks/fence11
-rwxr-xr-xscripts/atomic/fallbacks/fetch_add_unless23
-rwxr-xr-xscripts/atomic/fallbacks/inc7
-rwxr-xr-xscripts/atomic/fallbacks/inc_and_test15
-rwxr-xr-xscripts/atomic/fallbacks/inc_not_zero14
-rwxr-xr-xscripts/atomic/fallbacks/inc_unless_negative14
-rwxr-xr-xscripts/atomic/fallbacks/read_acquire7
-rwxr-xr-xscripts/atomic/fallbacks/release8
-rwxr-xr-xscripts/atomic/fallbacks/set_release7
-rwxr-xr-xscripts/atomic/fallbacks/sub_and_test16
-rwxr-xr-xscripts/atomic/fallbacks/try_cmpxchg11
-rwxr-xr-xscripts/atomic/gen-atomic-fallback.sh181
-rwxr-xr-xscripts/atomic/gen-atomic-instrumented.sh182
-rwxr-xr-xscripts/atomic/gen-atomic-long.sh101
-rw-r--r--scripts/atomic/gen-atomics.sh20
-rwxr-xr-xscripts/checkpatch.pl51
-rwxr-xr-xscripts/checksyscalls.sh53
-rwxr-xr-xscripts/decode_stacktrace.sh9
-rwxr-xr-xscripts/dtc/dtx_diff13
-rw-r--r--scripts/gcc-plugins/Kconfig62
-rw-r--r--scripts/gcc-plugins/structleak_plugin.c36
-rw-r--r--scripts/gdb/linux/constants.py.in12
-rw-r--r--scripts/gdb/linux/proc.py12
-rw-r--r--scripts/kallsyms.c4
-rwxr-xr-xscripts/kernel-doc2
-rwxr-xr-xscripts/leaking_addresses.pl9
-rw-r--r--scripts/mod/devicetable-offsets.c6
-rw-r--r--scripts/mod/file2alias.c47
-rwxr-xr-xscripts/spdxcheck.py8
-rw-r--r--scripts/spelling.txt69
-rwxr-xr-xscripts/ver_linux6
44 files changed, 1306 insertions, 78 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
15gcc-plugin-$(CONFIG_GCC_PLUGIN_STRUCTLEAK) += structleak_plugin.so 15gcc-plugin-$(CONFIG_GCC_PLUGIN_STRUCTLEAK) += structleak_plugin.so
16gcc-plugin-cflags-$(CONFIG_GCC_PLUGIN_STRUCTLEAK_VERBOSE) \ 16gcc-plugin-cflags-$(CONFIG_GCC_PLUGIN_STRUCTLEAK_VERBOSE) \
17 += -fplugin-arg-structleak_plugin-verbose 17 += -fplugin-arg-structleak_plugin-verbose
18gcc-plugin-cflags-$(CONFIG_GCC_PLUGIN_STRUCTLEAK_BYREF) \
19 += -fplugin-arg-structleak_plugin-byref
18gcc-plugin-cflags-$(CONFIG_GCC_PLUGIN_STRUCTLEAK_BYREF_ALL) \ 20gcc-plugin-cflags-$(CONFIG_GCC_PLUGIN_STRUCTLEAK_BYREF_ALL) \
19 += -fplugin-arg-structleak_plugin-byref-all 21 += -fplugin-arg-structleak_plugin-byref-all
20gcc-plugin-cflags-$(CONFIG_GCC_PLUGIN_STRUCTLEAK) \ 22gcc-plugin-cflags-$(CONFIG_GCC_PLUGIN_STRUCTLEAK) \
diff --git a/scripts/Makefile.kasan b/scripts/Makefile.kasan
index 25c259df8ffa..6410bd22fe38 100644
--- a/scripts/Makefile.kasan
+++ b/scripts/Makefile.kasan
@@ -26,15 +26,10 @@ else
26 CFLAGS_KASAN := $(CFLAGS_KASAN_SHADOW) \ 26 CFLAGS_KASAN := $(CFLAGS_KASAN_SHADOW) \
27 $(call cc-param,asan-globals=1) \ 27 $(call cc-param,asan-globals=1) \
28 $(call cc-param,asan-instrumentation-with-call-threshold=$(call_threshold)) \ 28 $(call cc-param,asan-instrumentation-with-call-threshold=$(call_threshold)) \
29 $(call cc-param,asan-stack=1) \ 29 $(call cc-param,asan-stack=$(CONFIG_KASAN_STACK)) \
30 $(call cc-param,asan-use-after-scope=1) \
31 $(call cc-param,asan-instrument-allocas=1) 30 $(call cc-param,asan-instrument-allocas=1)
32endif 31endif
33 32
34ifdef CONFIG_KASAN_EXTRA
35CFLAGS_KASAN += $(call cc-option, -fsanitize-address-use-after-scope)
36endif
37
38endif # CONFIG_KASAN_GENERIC 33endif # CONFIG_KASAN_GENERIC
39 34
40ifdef CONFIG_KASAN_SW_TAGS 35ifdef CONFIG_KASAN_SW_TAGS
diff --git a/scripts/atomic/atomic-tbl.sh b/scripts/atomic/atomic-tbl.sh
new file mode 100755
index 000000000000..81d5c32039dd
--- /dev/null
+++ b/scripts/atomic/atomic-tbl.sh
@@ -0,0 +1,186 @@
1#!/bin/sh
2# SPDX-License-Identifier: GPL-2.0
3# helpers for dealing with atomics.tbl
4
5#meta_in(meta, match)
6meta_in()
7{
8 case "$1" in
9 [$2]) return 0;;
10 esac
11
12 return 1
13}
14
15#meta_has_ret(meta)
16meta_has_ret()
17{
18 meta_in "$1" "bBiIfFlR"
19}
20
21#meta_has_acquire(meta)
22meta_has_acquire()
23{
24 meta_in "$1" "BFIlR"
25}
26
27#meta_has_release(meta)
28meta_has_release()
29{
30 meta_in "$1" "BFIRs"
31}
32
33#meta_has_relaxed(meta)
34meta_has_relaxed()
35{
36 meta_in "$1" "BFIR"
37}
38
39#find_fallback_template(pfx, name, sfx, order)
40find_fallback_template()
41{
42 local pfx="$1"; shift
43 local name="$1"; shift
44 local sfx="$1"; shift
45 local order="$1"; shift
46
47 local base=""
48 local file=""
49
50 # We may have fallbacks for a specific case (e.g. read_acquire()), or
51 # an entire class, e.g. *inc*().
52 #
53 # Start at the most specific, and fall back to the most general. Once
54 # we find a specific fallback, don't bother looking for more.
55 for base in "${pfx}${name}${sfx}${order}" "${name}"; do
56 file="${ATOMICDIR}/fallbacks/${base}"
57
58 if [ -f "${file}" ]; then
59 printf "${file}"
60 break
61 fi
62 done
63}
64
65#gen_ret_type(meta, int)
66gen_ret_type() {
67 local meta="$1"; shift
68 local int="$1"; shift
69
70 case "${meta}" in
71 [sv]) printf "void";;
72 [bB]) printf "bool";;
73 [aiIfFlR]) printf "${int}";;
74 esac
75}
76
77#gen_ret_stmt(meta)
78gen_ret_stmt()
79{
80 if meta_has_ret "${meta}"; then
81 printf "return ";
82 fi
83}
84
85# gen_param_name(arg)
86gen_param_name()
87{
88 # strip off the leading 'c' for 'cv'
89 local name="${1#c}"
90 printf "${name#*:}"
91}
92
93# gen_param_type(arg, int, atomic)
94gen_param_type()
95{
96 local type="${1%%:*}"; shift
97 local int="$1"; shift
98 local atomic="$1"; shift
99
100 case "${type}" in
101 i) type="${int} ";;
102 p) type="${int} *";;
103 v) type="${atomic}_t *";;
104 cv) type="const ${atomic}_t *";;
105 esac
106
107 printf "${type}"
108}
109
110#gen_param(arg, int, atomic)
111gen_param()
112{
113 local arg="$1"; shift
114 local int="$1"; shift
115 local atomic="$1"; shift
116 local name="$(gen_param_name "${arg}")"
117 local type="$(gen_param_type "${arg}" "${int}" "${atomic}")"
118
119 printf "${type}${name}"
120}
121
122#gen_params(int, atomic, arg...)
123gen_params()
124{
125 local int="$1"; shift
126 local atomic="$1"; shift
127
128 while [ "$#" -gt 0 ]; do
129 gen_param "$1" "${int}" "${atomic}"
130 [ "$#" -gt 1 ] && printf ", "
131 shift;
132 done
133}
134
135#gen_args(arg...)
136gen_args()
137{
138 while [ "$#" -gt 0 ]; do
139 printf "$(gen_param_name "$1")"
140 [ "$#" -gt 1 ] && printf ", "
141 shift;
142 done
143}
144
145#gen_proto_order_variants(meta, pfx, name, sfx, ...)
146gen_proto_order_variants()
147{
148 local meta="$1"; shift
149 local pfx="$1"; shift
150 local name="$1"; shift
151 local sfx="$1"; shift
152
153 gen_proto_order_variant "${meta}" "${pfx}" "${name}" "${sfx}" "" "$@"
154
155 if meta_has_acquire "${meta}"; then
156 gen_proto_order_variant "${meta}" "${pfx}" "${name}" "${sfx}" "_acquire" "$@"
157 fi
158 if meta_has_release "${meta}"; then
159 gen_proto_order_variant "${meta}" "${pfx}" "${name}" "${sfx}" "_release" "$@"
160 fi
161 if meta_has_relaxed "${meta}"; then
162 gen_proto_order_variant "${meta}" "${pfx}" "${name}" "${sfx}" "_relaxed" "$@"
163 fi
164}
165
166#gen_proto_variants(meta, name, ...)
167gen_proto_variants()
168{
169 local meta="$1"; shift
170 local name="$1"; shift
171 local pfx=""
172 local sfx=""
173
174 meta_in "${meta}" "fF" && pfx="fetch_"
175 meta_in "${meta}" "R" && sfx="_return"
176
177 gen_proto_order_variants "${meta}" "${pfx}" "${name}" "${sfx}" "$@"
178}
179
180#gen_proto(meta, ...)
181gen_proto() {
182 local meta="$1"; shift
183 for m in $(echo "${meta}" | grep -o .); do
184 gen_proto_variants "${m}" "$@"
185 done
186}
diff --git a/scripts/atomic/atomics.tbl b/scripts/atomic/atomics.tbl
new file mode 100755
index 000000000000..fbee2f6190d9
--- /dev/null
+++ b/scripts/atomic/atomics.tbl
@@ -0,0 +1,41 @@
1# name meta args...
2#
3# Where meta contains a string of variants to generate.
4# Upper-case implies _{acquire,release,relaxed} variants.
5# Valid meta values are:
6# * B/b - bool: returns bool
7# * v - void: returns void
8# * I/i - int: returns base type
9# * R - return: returns base type (has _return variants)
10# * F/f - fetch: returns base type (has fetch_ variants)
11# * l - load: returns base type (has _acquire order variant)
12# * s - store: returns void (has _release order variant)
13#
14# Where args contains list of type[:name], where type is:
15# * cv - const pointer to atomic base type (atomic_t/atomic64_t/atomic_long_t)
16# * v - pointer to atomic base type (atomic_t/atomic64_t/atomic_long_t)
17# * i - base type (int/s64/long)
18# * p - pointer to base type (int/s64/long)
19#
20read l cv
21set s v i
22add vRF i v
23sub vRF i v
24inc vRF v
25dec vRF v
26and vF i v
27andnot vF i v
28or vF i v
29xor vF i v
30xchg I v i
31cmpxchg I v i:old i:new
32try_cmpxchg B v p:old i:new
33sub_and_test b i v
34dec_and_test b v
35inc_and_test b v
36add_negative b i v
37add_unless fb v i:a i:u
38inc_not_zero b v
39inc_unless_negative b v
40dec_unless_positive b v
41dec_if_positive i v
diff --git a/scripts/atomic/check-atomics.sh b/scripts/atomic/check-atomics.sh
new file mode 100755
index 000000000000..cfa0c2f71c84
--- /dev/null
+++ b/scripts/atomic/check-atomics.sh
@@ -0,0 +1,33 @@
1#!/bin/sh
2# SPDX-License-Identifier: GPL-2.0
3#
4# Check if atomic headers are up-to-date
5
6ATOMICDIR=$(dirname $0)
7ATOMICTBL=${ATOMICDIR}/atomics.tbl
8LINUXDIR=${ATOMICDIR}/../..
9
10echo '' | sha1sum - > /dev/null 2>&1
11if [ $? -ne 0 ]; then
12 printf "sha1sum not available, skipping atomic header checks.\n"
13 exit 0
14fi
15
16cat <<EOF |
17asm-generic/atomic-instrumented.h
18asm-generic/atomic-long.h
19linux/atomic-fallback.h
20EOF
21while read header; do
22 OLDSUM="$(tail -n 1 ${LINUXDIR}/include/${header})"
23 OLDSUM="${OLDSUM#// }"
24
25 NEWSUM="$(head -n -1 ${LINUXDIR}/include/${header} | sha1sum)"
26 NEWSUM="${NEWSUM%% *}"
27
28 if [ "${OLDSUM}" != "${NEWSUM}" ]; then
29 printf "warning: generated include/${header} has been modified.\n"
30 fi
31done
32
33exit 0
diff --git a/scripts/atomic/fallbacks/acquire b/scripts/atomic/fallbacks/acquire
new file mode 100755
index 000000000000..e38871e64db6
--- /dev/null
+++ b/scripts/atomic/fallbacks/acquire
@@ -0,0 +1,9 @@
1cat <<EOF
2static inline ${ret}
3${atomic}_${pfx}${name}${sfx}_acquire(${params})
4{
5 ${ret} ret = ${atomic}_${pfx}${name}${sfx}_relaxed(${args});
6 __atomic_acquire_fence();
7 return ret;
8}
9EOF
diff --git a/scripts/atomic/fallbacks/add_negative b/scripts/atomic/fallbacks/add_negative
new file mode 100755
index 000000000000..e6f4815637de
--- /dev/null
+++ b/scripts/atomic/fallbacks/add_negative
@@ -0,0 +1,16 @@
1cat <<EOF
2/**
3 * ${atomic}_add_negative - add and test if negative
4 * @i: integer value to add
5 * @v: pointer of type ${atomic}_t
6 *
7 * Atomically adds @i to @v and returns true
8 * if the result is negative, or false when
9 * result is greater than or equal to zero.
10 */
11static inline bool
12${atomic}_add_negative(${int} i, ${atomic}_t *v)
13{
14 return ${atomic}_add_return(i, v) < 0;
15}
16EOF
diff --git a/scripts/atomic/fallbacks/add_unless b/scripts/atomic/fallbacks/add_unless
new file mode 100755
index 000000000000..792533885fbf
--- /dev/null
+++ b/scripts/atomic/fallbacks/add_unless
@@ -0,0 +1,16 @@
1cat << EOF
2/**
3 * ${atomic}_add_unless - add unless the number is already a given value
4 * @v: pointer of type ${atomic}_t
5 * @a: the amount to add to v...
6 * @u: ...unless v is equal to u.
7 *
8 * Atomically adds @a to @v, if @v was not already @u.
9 * Returns true if the addition was done.
10 */
11static inline bool
12${atomic}_add_unless(${atomic}_t *v, ${int} a, ${int} u)
13{
14 return ${atomic}_fetch_add_unless(v, a, u) != u;
15}
16EOF
diff --git a/scripts/atomic/fallbacks/andnot b/scripts/atomic/fallbacks/andnot
new file mode 100755
index 000000000000..9f3a3216b5e3
--- /dev/null
+++ b/scripts/atomic/fallbacks/andnot
@@ -0,0 +1,7 @@
1cat <<EOF
2static inline ${ret}
3${atomic}_${pfx}andnot${sfx}${order}(${int} i, ${atomic}_t *v)
4{
5 ${retstmt}${atomic}_${pfx}and${sfx}${order}(~i, v);
6}
7EOF
diff --git a/scripts/atomic/fallbacks/dec b/scripts/atomic/fallbacks/dec
new file mode 100755
index 000000000000..10bbc82be31d
--- /dev/null
+++ b/scripts/atomic/fallbacks/dec
@@ -0,0 +1,7 @@
1cat <<EOF
2static inline ${ret}
3${atomic}_${pfx}dec${sfx}${order}(${atomic}_t *v)
4{
5 ${retstmt}${atomic}_${pfx}sub${sfx}${order}(1, v);
6}
7EOF
diff --git a/scripts/atomic/fallbacks/dec_and_test b/scripts/atomic/fallbacks/dec_and_test
new file mode 100755
index 000000000000..0ce7103b3df2
--- /dev/null
+++ b/scripts/atomic/fallbacks/dec_and_test
@@ -0,0 +1,15 @@
1cat <<EOF
2/**
3 * ${atomic}_dec_and_test - decrement and test
4 * @v: pointer of type ${atomic}_t
5 *
6 * Atomically decrements @v by 1 and
7 * returns true if the result is 0, or false for all other
8 * cases.
9 */
10static inline bool
11${atomic}_dec_and_test(${atomic}_t *v)
12{
13 return ${atomic}_dec_return(v) == 0;
14}
15EOF
diff --git a/scripts/atomic/fallbacks/dec_if_positive b/scripts/atomic/fallbacks/dec_if_positive
new file mode 100755
index 000000000000..c52eacec43c8
--- /dev/null
+++ b/scripts/atomic/fallbacks/dec_if_positive
@@ -0,0 +1,15 @@
1cat <<EOF
2static inline ${ret}
3${atomic}_dec_if_positive(${atomic}_t *v)
4{
5 ${int} dec, c = ${atomic}_read(v);
6
7 do {
8 dec = c - 1;
9 if (unlikely(dec < 0))
10 break;
11 } while (!${atomic}_try_cmpxchg(v, &c, dec));
12
13 return dec;
14}
15EOF
diff --git a/scripts/atomic/fallbacks/dec_unless_positive b/scripts/atomic/fallbacks/dec_unless_positive
new file mode 100755
index 000000000000..8a2578f14268
--- /dev/null
+++ b/scripts/atomic/fallbacks/dec_unless_positive
@@ -0,0 +1,14 @@
1cat <<EOF
2static inline bool
3${atomic}_dec_unless_positive(${atomic}_t *v)
4{
5 ${int} c = ${atomic}_read(v);
6
7 do {
8 if (unlikely(c > 0))
9 return false;
10 } while (!${atomic}_try_cmpxchg(v, &c, c - 1));
11
12 return true;
13}
14EOF
diff --git a/scripts/atomic/fallbacks/fence b/scripts/atomic/fallbacks/fence
new file mode 100755
index 000000000000..82f68fa6931a
--- /dev/null
+++ b/scripts/atomic/fallbacks/fence
@@ -0,0 +1,11 @@
1cat <<EOF
2static inline ${ret}
3${atomic}_${pfx}${name}${sfx}(${params})
4{
5 ${ret} ret;
6 __atomic_pre_full_fence();
7 ret = ${atomic}_${pfx}${name}${sfx}_relaxed(${args});
8 __atomic_post_full_fence();
9 return ret;
10}
11EOF
diff --git a/scripts/atomic/fallbacks/fetch_add_unless b/scripts/atomic/fallbacks/fetch_add_unless
new file mode 100755
index 000000000000..d2c091db7eae
--- /dev/null
+++ b/scripts/atomic/fallbacks/fetch_add_unless
@@ -0,0 +1,23 @@
1cat << EOF
2/**
3 * ${atomic}_fetch_add_unless - add unless the number is already a given value
4 * @v: pointer of type ${atomic}_t
5 * @a: the amount to add to v...
6 * @u: ...unless v is equal to u.
7 *
8 * Atomically adds @a to @v, so long as @v was not already @u.
9 * Returns original value of @v
10 */
11static inline ${int}
12${atomic}_fetch_add_unless(${atomic}_t *v, ${int} a, ${int} u)
13{
14 ${int} c = ${atomic}_read(v);
15
16 do {
17 if (unlikely(c == u))
18 break;
19 } while (!${atomic}_try_cmpxchg(v, &c, c + a));
20
21 return c;
22}
23EOF
diff --git a/scripts/atomic/fallbacks/inc b/scripts/atomic/fallbacks/inc
new file mode 100755
index 000000000000..f866b3ad2353
--- /dev/null
+++ b/scripts/atomic/fallbacks/inc
@@ -0,0 +1,7 @@
1cat <<EOF
2static inline ${ret}
3${atomic}_${pfx}inc${sfx}${order}(${atomic}_t *v)
4{
5 ${retstmt}${atomic}_${pfx}add${sfx}${order}(1, v);
6}
7EOF
diff --git a/scripts/atomic/fallbacks/inc_and_test b/scripts/atomic/fallbacks/inc_and_test
new file mode 100755
index 000000000000..4e2068869f7e
--- /dev/null
+++ b/scripts/atomic/fallbacks/inc_and_test
@@ -0,0 +1,15 @@
1cat <<EOF
2/**
3 * ${atomic}_inc_and_test - increment and test
4 * @v: pointer of type ${atomic}_t
5 *
6 * Atomically increments @v by 1
7 * and returns true if the result is zero, or false for all
8 * other cases.
9 */
10static inline bool
11${atomic}_inc_and_test(${atomic}_t *v)
12{
13 return ${atomic}_inc_return(v) == 0;
14}
15EOF
diff --git a/scripts/atomic/fallbacks/inc_not_zero b/scripts/atomic/fallbacks/inc_not_zero
new file mode 100755
index 000000000000..a7c45c8d107c
--- /dev/null
+++ b/scripts/atomic/fallbacks/inc_not_zero
@@ -0,0 +1,14 @@
1cat <<EOF
2/**
3 * ${atomic}_inc_not_zero - increment unless the number is zero
4 * @v: pointer of type ${atomic}_t
5 *
6 * Atomically increments @v by 1, if @v is non-zero.
7 * Returns true if the increment was done.
8 */
9static inline bool
10${atomic}_inc_not_zero(${atomic}_t *v)
11{
12 return ${atomic}_add_unless(v, 1, 0);
13}
14EOF
diff --git a/scripts/atomic/fallbacks/inc_unless_negative b/scripts/atomic/fallbacks/inc_unless_negative
new file mode 100755
index 000000000000..0c266e71dbd4
--- /dev/null
+++ b/scripts/atomic/fallbacks/inc_unless_negative
@@ -0,0 +1,14 @@
1cat <<EOF
2static inline bool
3${atomic}_inc_unless_negative(${atomic}_t *v)
4{
5 ${int} c = ${atomic}_read(v);
6
7 do {
8 if (unlikely(c < 0))
9 return false;
10 } while (!${atomic}_try_cmpxchg(v, &c, c + 1));
11
12 return true;
13}
14EOF
diff --git a/scripts/atomic/fallbacks/read_acquire b/scripts/atomic/fallbacks/read_acquire
new file mode 100755
index 000000000000..75863b5203f7
--- /dev/null
+++ b/scripts/atomic/fallbacks/read_acquire
@@ -0,0 +1,7 @@
1cat <<EOF
2static inline ${ret}
3${atomic}_read_acquire(const ${atomic}_t *v)
4{
5 return smp_load_acquire(&(v)->counter);
6}
7EOF
diff --git a/scripts/atomic/fallbacks/release b/scripts/atomic/fallbacks/release
new file mode 100755
index 000000000000..3f628a3802d9
--- /dev/null
+++ b/scripts/atomic/fallbacks/release
@@ -0,0 +1,8 @@
1cat <<EOF
2static inline ${ret}
3${atomic}_${pfx}${name}${sfx}_release(${params})
4{
5 __atomic_release_fence();
6 ${retstmt}${atomic}_${pfx}${name}${sfx}_relaxed(${args});
7}
8EOF
diff --git a/scripts/atomic/fallbacks/set_release b/scripts/atomic/fallbacks/set_release
new file mode 100755
index 000000000000..45bb5e0cfc08
--- /dev/null
+++ b/scripts/atomic/fallbacks/set_release
@@ -0,0 +1,7 @@
1cat <<EOF
2static inline void
3${atomic}_set_release(${atomic}_t *v, ${int} i)
4{
5 smp_store_release(&(v)->counter, i);
6}
7EOF
diff --git a/scripts/atomic/fallbacks/sub_and_test b/scripts/atomic/fallbacks/sub_and_test
new file mode 100755
index 000000000000..289ef17a2d7a
--- /dev/null
+++ b/scripts/atomic/fallbacks/sub_and_test
@@ -0,0 +1,16 @@
1cat <<EOF
2/**
3 * ${atomic}_sub_and_test - subtract value from variable and test result
4 * @i: integer value to subtract
5 * @v: pointer of type ${atomic}_t
6 *
7 * Atomically subtracts @i from @v and returns
8 * true if the result is zero, or false for all
9 * other cases.
10 */
11static inline bool
12${atomic}_sub_and_test(${int} i, ${atomic}_t *v)
13{
14 return ${atomic}_sub_return(i, v) == 0;
15}
16EOF
diff --git a/scripts/atomic/fallbacks/try_cmpxchg b/scripts/atomic/fallbacks/try_cmpxchg
new file mode 100755
index 000000000000..4ed85e2f5378
--- /dev/null
+++ b/scripts/atomic/fallbacks/try_cmpxchg
@@ -0,0 +1,11 @@
1cat <<EOF
2static inline bool
3${atomic}_try_cmpxchg${order}(${atomic}_t *v, ${int} *old, ${int} new)
4{
5 ${int} r, o = *old;
6 r = ${atomic}_cmpxchg${order}(v, o, new);
7 if (unlikely(r != o))
8 *old = r;
9 return likely(r == o);
10}
11EOF
diff --git a/scripts/atomic/gen-atomic-fallback.sh b/scripts/atomic/gen-atomic-fallback.sh
new file mode 100755
index 000000000000..1bd7c1707633
--- /dev/null
+++ b/scripts/atomic/gen-atomic-fallback.sh
@@ -0,0 +1,181 @@
1#!/bin/sh
2# SPDX-License-Identifier: GPL-2.0
3
4ATOMICDIR=$(dirname $0)
5
6. ${ATOMICDIR}/atomic-tbl.sh
7
8#gen_template_fallback(template, meta, pfx, name, sfx, order, atomic, int, args...)
9gen_template_fallback()
10{
11 local template="$1"; shift
12 local meta="$1"; shift
13 local pfx="$1"; shift
14 local name="$1"; shift
15 local sfx="$1"; shift
16 local order="$1"; shift
17 local atomic="$1"; shift
18 local int="$1"; shift
19
20 local atomicname="${atomic}_${pfx}${name}${sfx}${order}"
21
22 local ret="$(gen_ret_type "${meta}" "${int}")"
23 local retstmt="$(gen_ret_stmt "${meta}")"
24 local params="$(gen_params "${int}" "${atomic}" "$@")"
25 local args="$(gen_args "$@")"
26
27 if [ ! -z "${template}" ]; then
28 printf "#ifndef ${atomicname}\n"
29 . ${template}
30 printf "#define ${atomicname} ${atomicname}\n"
31 printf "#endif\n\n"
32 fi
33}
34
35#gen_proto_fallback(meta, pfx, name, sfx, order, atomic, int, args...)
36gen_proto_fallback()
37{
38 local meta="$1"; shift
39 local pfx="$1"; shift
40 local name="$1"; shift
41 local sfx="$1"; shift
42 local order="$1"; shift
43
44 local tmpl="$(find_fallback_template "${pfx}" "${name}" "${sfx}" "${order}")"
45 gen_template_fallback "${tmpl}" "${meta}" "${pfx}" "${name}" "${sfx}" "${order}" "$@"
46}
47
48#gen_basic_fallbacks(basename)
49gen_basic_fallbacks()
50{
51 local basename="$1"; shift
52cat << EOF
53#define ${basename}_acquire ${basename}
54#define ${basename}_release ${basename}
55#define ${basename}_relaxed ${basename}
56EOF
57}
58
59#gen_proto_order_variants(meta, pfx, name, sfx, atomic, int, args...)
60gen_proto_order_variants()
61{
62 local meta="$1"; shift
63 local pfx="$1"; shift
64 local name="$1"; shift
65 local sfx="$1"; shift
66 local atomic="$1"
67
68 local basename="${atomic}_${pfx}${name}${sfx}"
69
70 local template="$(find_fallback_template "${pfx}" "${name}" "${sfx}" "${order}")"
71
72 # If we don't have relaxed atomics, then we don't bother with ordering fallbacks
73 # read_acquire and set_release need to be templated, though
74 if ! meta_has_relaxed "${meta}"; then
75 gen_proto_fallback "${meta}" "${pfx}" "${name}" "${sfx}" "" "$@"
76
77 if meta_has_acquire "${meta}"; then
78 gen_proto_fallback "${meta}" "${pfx}" "${name}" "${sfx}" "_acquire" "$@"
79 fi
80
81 if meta_has_release "${meta}"; then
82 gen_proto_fallback "${meta}" "${pfx}" "${name}" "${sfx}" "_release" "$@"
83 fi
84
85 return
86 fi
87
88 printf "#ifndef ${basename}_relaxed\n"
89
90 if [ ! -z "${template}" ]; then
91 printf "#ifdef ${basename}\n"
92 fi
93
94 gen_basic_fallbacks "${basename}"
95
96 if [ ! -z "${template}" ]; then
97 printf "#endif /* ${atomic}_${pfx}${name}${sfx} */\n\n"
98 gen_proto_fallback "${meta}" "${pfx}" "${name}" "${sfx}" "" "$@"
99 gen_proto_fallback "${meta}" "${pfx}" "${name}" "${sfx}" "_acquire" "$@"
100 gen_proto_fallback "${meta}" "${pfx}" "${name}" "${sfx}" "_release" "$@"
101 gen_proto_fallback "${meta}" "${pfx}" "${name}" "${sfx}" "_relaxed" "$@"
102 fi
103
104 printf "#else /* ${basename}_relaxed */\n\n"
105
106 gen_template_fallback "${ATOMICDIR}/fallbacks/acquire" "${meta}" "${pfx}" "${name}" "${sfx}" "_acquire" "$@"
107 gen_template_fallback "${ATOMICDIR}/fallbacks/release" "${meta}" "${pfx}" "${name}" "${sfx}" "_release" "$@"
108 gen_template_fallback "${ATOMICDIR}/fallbacks/fence" "${meta}" "${pfx}" "${name}" "${sfx}" "" "$@"
109
110 printf "#endif /* ${basename}_relaxed */\n\n"
111}
112
113gen_xchg_fallbacks()
114{
115 local xchg="$1"; shift
116cat <<EOF
117#ifndef ${xchg}_relaxed
118#define ${xchg}_relaxed ${xchg}
119#define ${xchg}_acquire ${xchg}
120#define ${xchg}_release ${xchg}
121#else /* ${xchg}_relaxed */
122
123#ifndef ${xchg}_acquire
124#define ${xchg}_acquire(...) \\
125 __atomic_op_acquire(${xchg}, __VA_ARGS__)
126#endif
127
128#ifndef ${xchg}_release
129#define ${xchg}_release(...) \\
130 __atomic_op_release(${xchg}, __VA_ARGS__)
131#endif
132
133#ifndef ${xchg}
134#define ${xchg}(...) \\
135 __atomic_op_fence(${xchg}, __VA_ARGS__)
136#endif
137
138#endif /* ${xchg}_relaxed */
139
140EOF
141}
142
143cat << EOF
144// SPDX-License-Identifier: GPL-2.0
145
146// Generated by $0
147// DO NOT MODIFY THIS FILE DIRECTLY
148
149#ifndef _LINUX_ATOMIC_FALLBACK_H
150#define _LINUX_ATOMIC_FALLBACK_H
151
152EOF
153
154for xchg in "xchg" "cmpxchg" "cmpxchg64"; do
155 gen_xchg_fallbacks "${xchg}"
156done
157
158grep '^[a-z]' "$1" | while read name meta args; do
159 gen_proto "${meta}" "${name}" "atomic" "int" ${args}
160done
161
162cat <<EOF
163#define atomic_cond_read_acquire(v, c) smp_cond_load_acquire(&(v)->counter, (c))
164#define atomic_cond_read_relaxed(v, c) smp_cond_load_relaxed(&(v)->counter, (c))
165
166#ifdef CONFIG_GENERIC_ATOMIC64
167#include <asm-generic/atomic64.h>
168#endif
169
170EOF
171
172grep '^[a-z]' "$1" | while read name meta args; do
173 gen_proto "${meta}" "${name}" "atomic64" "s64" ${args}
174done
175
176cat <<EOF
177#define atomic64_cond_read_acquire(v, c) smp_cond_load_acquire(&(v)->counter, (c))
178#define atomic64_cond_read_relaxed(v, c) smp_cond_load_relaxed(&(v)->counter, (c))
179
180#endif /* _LINUX_ATOMIC_FALLBACK_H */
181EOF
diff --git a/scripts/atomic/gen-atomic-instrumented.sh b/scripts/atomic/gen-atomic-instrumented.sh
new file mode 100755
index 000000000000..e09812372b17
--- /dev/null
+++ b/scripts/atomic/gen-atomic-instrumented.sh
@@ -0,0 +1,182 @@
1#!/bin/sh
2# SPDX-License-Identifier: GPL-2.0
3
4ATOMICDIR=$(dirname $0)
5
6. ${ATOMICDIR}/atomic-tbl.sh
7
8#gen_param_check(arg)
9gen_param_check()
10{
11 local arg="$1"; shift
12 local type="${arg%%:*}"
13 local name="$(gen_param_name "${arg}")"
14 local rw="write"
15
16 case "${type#c}" in
17 i) return;;
18 esac
19
20 # We don't write to constant parameters
21 [ ${type#c} != ${type} ] && rw="read"
22
23 printf "\tkasan_check_${rw}(${name}, sizeof(*${name}));\n"
24}
25
26#gen_param_check(arg...)
27gen_params_checks()
28{
29 while [ "$#" -gt 0 ]; do
30 gen_param_check "$1"
31 shift;
32 done
33}
34
35# gen_guard(meta, atomic, pfx, name, sfx, order)
36gen_guard()
37{
38 local meta="$1"; shift
39 local atomic="$1"; shift
40 local pfx="$1"; shift
41 local name="$1"; shift
42 local sfx="$1"; shift
43 local order="$1"; shift
44
45 local atomicname="arch_${atomic}_${pfx}${name}${sfx}${order}"
46
47 local template="$(find_fallback_template "${pfx}" "${name}" "${sfx}" "${order}")"
48
49 # We definitely need a preprocessor symbol for this atomic if it is an
50 # ordering variant, or if there's a generic fallback.
51 if [ ! -z "${order}" ] || [ ! -z "${template}" ]; then
52 printf "defined(${atomicname})"
53 return
54 fi
55
56 # If this is a base variant, but a relaxed variant *may* exist, then we
57 # only have a preprocessor symbol if the relaxed variant isn't defined
58 if meta_has_relaxed "${meta}"; then
59 printf "!defined(${atomicname}_relaxed) || defined(${atomicname})"
60 fi
61}
62
63#gen_proto_order_variant(meta, pfx, name, sfx, order, atomic, int, arg...)
64gen_proto_order_variant()
65{
66 local meta="$1"; shift
67 local pfx="$1"; shift
68 local name="$1"; shift
69 local sfx="$1"; shift
70 local order="$1"; shift
71 local atomic="$1"; shift
72 local int="$1"; shift
73
74 local atomicname="${atomic}_${pfx}${name}${sfx}${order}"
75
76 local guard="$(gen_guard "${meta}" "${atomic}" "${pfx}" "${name}" "${sfx}" "${order}")"
77
78 local ret="$(gen_ret_type "${meta}" "${int}")"
79 local params="$(gen_params "${int}" "${atomic}" "$@")"
80 local checks="$(gen_params_checks "$@")"
81 local args="$(gen_args "$@")"
82 local retstmt="$(gen_ret_stmt "${meta}")"
83
84 [ ! -z "${guard}" ] && printf "#if ${guard}\n"
85
86cat <<EOF
87static inline ${ret}
88${atomicname}(${params})
89{
90${checks}
91 ${retstmt}arch_${atomicname}(${args});
92}
93#define ${atomicname} ${atomicname}
94EOF
95
96 [ ! -z "${guard}" ] && printf "#endif\n"
97
98 printf "\n"
99}
100
101gen_xchg()
102{
103 local xchg="$1"; shift
104 local mult="$1"; shift
105
106cat <<EOF
107#define ${xchg}(ptr, ...) \\
108({ \\
109 typeof(ptr) __ai_ptr = (ptr); \\
110 kasan_check_write(__ai_ptr, ${mult}sizeof(*__ai_ptr)); \\
111 arch_${xchg}(__ai_ptr, __VA_ARGS__); \\
112})
113EOF
114}
115
116gen_optional_xchg()
117{
118 local name="$1"; shift
119 local sfx="$1"; shift
120 local guard="defined(arch_${name}${sfx})"
121
122 [ -z "${sfx}" ] && guard="!defined(arch_${name}_relaxed) || defined(arch_${name})"
123
124 printf "#if ${guard}\n"
125 gen_xchg "${name}${sfx}" ""
126 printf "#endif\n\n"
127}
128
129cat << EOF
130// SPDX-License-Identifier: GPL-2.0
131
132// Generated by $0
133// DO NOT MODIFY THIS FILE DIRECTLY
134
135/*
136 * This file provides wrappers with KASAN instrumentation for atomic operations.
137 * To use this functionality an arch's atomic.h file needs to define all
138 * atomic operations with arch_ prefix (e.g. arch_atomic_read()) and include
139 * this file at the end. This file provides atomic_read() that forwards to
140 * arch_atomic_read() for actual atomic operation.
141 * Note: if an arch atomic operation is implemented by means of other atomic
142 * operations (e.g. atomic_read()/atomic_cmpxchg() loop), then it needs to use
143 * arch_ variants (i.e. arch_atomic_read()/arch_atomic_cmpxchg()) to avoid
144 * double instrumentation.
145 */
146#ifndef _ASM_GENERIC_ATOMIC_INSTRUMENTED_H
147#define _ASM_GENERIC_ATOMIC_INSTRUMENTED_H
148
149#include <linux/build_bug.h>
150#include <linux/kasan-checks.h>
151
152EOF
153
154grep '^[a-z]' "$1" | while read name meta args; do
155 gen_proto "${meta}" "${name}" "atomic" "int" ${args}
156done
157
158grep '^[a-z]' "$1" | while read name meta args; do
159 gen_proto "${meta}" "${name}" "atomic64" "s64" ${args}
160done
161
162for xchg in "xchg" "cmpxchg" "cmpxchg64"; do
163 for order in "" "_acquire" "_release" "_relaxed"; do
164 gen_optional_xchg "${xchg}" "${order}"
165 done
166done
167
168for xchg in "cmpxchg_local" "cmpxchg64_local" "sync_cmpxchg"; do
169 gen_xchg "${xchg}" ""
170 printf "\n"
171done
172
173gen_xchg "cmpxchg_double" "2 * "
174
175printf "\n\n"
176
177gen_xchg "cmpxchg_double_local" "2 * "
178
179cat <<EOF
180
181#endif /* _ASM_GENERIC_ATOMIC_INSTRUMENTED_H */
182EOF
diff --git a/scripts/atomic/gen-atomic-long.sh b/scripts/atomic/gen-atomic-long.sh
new file mode 100755
index 000000000000..c240a7231b2e
--- /dev/null
+++ b/scripts/atomic/gen-atomic-long.sh
@@ -0,0 +1,101 @@
1#!/bin/sh
2# SPDX-License-Identifier: GPL-2.0
3
4ATOMICDIR=$(dirname $0)
5
6. ${ATOMICDIR}/atomic-tbl.sh
7
8#gen_cast(arg, int, atomic)
9gen_cast()
10{
11 local arg="$1"; shift
12 local int="$1"; shift
13 local atomic="$1"; shift
14
15 [ "${arg%%:*}" = "p" ] || return
16
17 printf "($(gen_param_type "${arg}" "${int}" "${atomic}"))"
18}
19
20#gen_args_cast(int, atomic, arg...)
21gen_args_cast()
22{
23 local int="$1"; shift
24 local atomic="$1"; shift
25
26 while [ "$#" -gt 0 ]; do
27 local cast="$(gen_cast "$1" "${int}" "${atomic}")"
28 local arg="$(gen_param_name "$1")"
29 printf "${cast}${arg}"
30 [ "$#" -gt 1 ] && printf ", "
31 shift;
32 done
33}
34
35#gen_proto_order_variant(meta, pfx, name, sfx, order, atomic, int, arg...)
36gen_proto_order_variant()
37{
38 local meta="$1"; shift
39 local name="$1$2$3$4"; shift; shift; shift; shift
40 local atomic="$1"; shift
41 local int="$1"; shift
42
43 local ret="$(gen_ret_type "${meta}" "long")"
44 local params="$(gen_params "long" "atomic_long" "$@")"
45 local argscast="$(gen_args_cast "${int}" "${atomic}" "$@")"
46 local retstmt="$(gen_ret_stmt "${meta}")"
47
48cat <<EOF
49static inline ${ret}
50atomic_long_${name}(${params})
51{
52 ${retstmt}${atomic}_${name}(${argscast});
53}
54
55EOF
56}
57
58cat << EOF
59// SPDX-License-Identifier: GPL-2.0
60
61// Generated by $0
62// DO NOT MODIFY THIS FILE DIRECTLY
63
64#ifndef _ASM_GENERIC_ATOMIC_LONG_H
65#define _ASM_GENERIC_ATOMIC_LONG_H
66
67#include <asm/types.h>
68
69#ifdef CONFIG_64BIT
70typedef atomic64_t atomic_long_t;
71#define ATOMIC_LONG_INIT(i) ATOMIC64_INIT(i)
72#define atomic_long_cond_read_acquire atomic64_cond_read_acquire
73#define atomic_long_cond_read_relaxed atomic64_cond_read_relaxed
74#else
75typedef atomic_t atomic_long_t;
76#define ATOMIC_LONG_INIT(i) ATOMIC_INIT(i)
77#define atomic_long_cond_read_acquire atomic_cond_read_acquire
78#define atomic_long_cond_read_relaxed atomic_cond_read_relaxed
79#endif
80
81#ifdef CONFIG_64BIT
82
83EOF
84
85grep '^[a-z]' "$1" | while read name meta args; do
86 gen_proto "${meta}" "${name}" "atomic64" "s64" ${args}
87done
88
89cat <<EOF
90#else /* CONFIG_64BIT */
91
92EOF
93
94grep '^[a-z]' "$1" | while read name meta args; do
95 gen_proto "${meta}" "${name}" "atomic" "int" ${args}
96done
97
98cat <<EOF
99#endif /* CONFIG_64BIT */
100#endif /* _ASM_GENERIC_ATOMIC_LONG_H */
101EOF
diff --git a/scripts/atomic/gen-atomics.sh b/scripts/atomic/gen-atomics.sh
new file mode 100644
index 000000000000..27400b0cd732
--- /dev/null
+++ b/scripts/atomic/gen-atomics.sh
@@ -0,0 +1,20 @@
1#!/bin/sh
2# SPDX-License-Identifier: GPL-2.0
3#
4# Generate atomic headers
5
6ATOMICDIR=$(dirname $0)
7ATOMICTBL=${ATOMICDIR}/atomics.tbl
8LINUXDIR=${ATOMICDIR}/../..
9
10cat <<EOF |
11gen-atomic-instrumented.sh asm-generic/atomic-instrumented.h
12gen-atomic-long.sh asm-generic/atomic-long.h
13gen-atomic-fallback.sh linux/atomic-fallback.h
14EOF
15while read script header; do
16 ${ATOMICDIR}/${script} ${ATOMICTBL} > ${LINUXDIR}/include/${header}
17 HASH="$(sha1sum ${LINUXDIR}/include/${header})"
18 HASH="${HASH%% *}"
19 printf "// %s\n" "${HASH}" >> ${LINUXDIR}/include/${header}
20done
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";
61my $conststructsfile = "$D/const_structs.checkpatch"; 61my $conststructsfile = "$D/const_structs.checkpatch";
62my $typedefsfile = ""; 62my $typedefsfile = "";
63my $color = "auto"; 63my $color = "auto";
64my $allow_c99_comments = 1; 64my $allow_c99_comments = 1; # Can be overridden by --ignore C99_COMMENT_TOLERANCE
65 65
66sub help { 66sub help {
67 my ($exitcode) = @_; 67 my ($exitcode) = @_;
@@ -466,6 +466,16 @@ our $logFunctions = qr{(?x:
466 seq_vprintf|seq_printf|seq_puts 466 seq_vprintf|seq_printf|seq_puts
467)}; 467)};
468 468
469our $allocFunctions = qr{(?x:
470 (?:(?:devm_)?
471 (?:kv|k|v)[czm]alloc(?:_node|_array)? |
472 kstrdup(?:_const)? |
473 kmemdup(?:_nul)?) |
474 (?:\w+)?alloc_skb(?:ip_align)? |
475 # dev_alloc_skb/netdev_alloc_skb, et al
476 dma_alloc_coherent
477)};
478
469our $signature_tags = qr{(?xi: 479our $signature_tags = qr{(?xi:
470 Signed-off-by:| 480 Signed-off-by:|
471 Co-developed-by:| 481 Co-developed-by:|
@@ -1011,6 +1021,7 @@ if ($git) {
1011} 1021}
1012 1022
1013my $vname; 1023my $vname;
1024$allow_c99_comments = !defined $ignore_type{"C99_COMMENT_TOLERANCE"};
1014for my $filename (@ARGV) { 1025for my $filename (@ARGV) {
1015 my $FILE; 1026 my $FILE;
1016 if ($git) { 1027 if ($git) {
@@ -3037,6 +3048,14 @@ sub process {
3037 $comment = '..'; 3048 $comment = '..';
3038 } 3049 }
3039 3050
3051# check SPDX comment style for .[chsS] files
3052 if ($realfile =~ /\.[chsS]$/ &&
3053 $rawline =~ /SPDX-License-Identifier:/ &&
3054 $rawline !~ /^\+\s*\Q$comment\E\s*/) {
3055 WARN("SPDX_LICENSE_TAG",
3056 "Improper SPDX comment style for '$realfile', please use '$comment' instead\n" . $herecurr);
3057 }
3058
3040 if ($comment !~ /^$/ && 3059 if ($comment !~ /^$/ &&
3041 $rawline !~ /^\+\Q$comment\E SPDX-License-Identifier: /) { 3060 $rawline !~ /^\+\Q$comment\E SPDX-License-Identifier: /) {
3042 WARN("SPDX_LICENSE_TAG", 3061 WARN("SPDX_LICENSE_TAG",
@@ -3054,6 +3073,14 @@ sub process {
3054# check we are in a valid source file if not then ignore this hunk 3073# check we are in a valid source file if not then ignore this hunk
3055 next if ($realfile !~ /\.(h|c|s|S|sh|dtsi|dts)$/); 3074 next if ($realfile !~ /\.(h|c|s|S|sh|dtsi|dts)$/);
3056 3075
3076# check for using SPDX-License-Identifier on the wrong line number
3077 if ($realline != $checklicenseline &&
3078 $rawline =~ /\bSPDX-License-Identifier:/ &&
3079 substr($line, @-, @+ - @-) eq "$;" x (@+ - @-)) {
3080 WARN("SPDX_LICENSE_TAG",
3081 "Misplaced SPDX-License-Identifier tag - use line $checklicenseline instead\n" . $herecurr);
3082 }
3083
3057# line length limit (with some exclusions) 3084# line length limit (with some exclusions)
3058# 3085#
3059# There are a few types of lines that may extend beyond $max_line_length: 3086# There are a few types of lines that may extend beyond $max_line_length:
@@ -5545,7 +5572,8 @@ sub process {
5545 my ($s, $c) = ctx_statement_block($linenr - 3, $realcnt, 0); 5572 my ($s, $c) = ctx_statement_block($linenr - 3, $realcnt, 0);
5546# print("line: <$line>\nprevline: <$prevline>\ns: <$s>\nc: <$c>\n\n\n"); 5573# print("line: <$line>\nprevline: <$prevline>\ns: <$s>\nc: <$c>\n\n\n");
5547 5574
5548 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)/) { 5575 if ($s =~ /(?:^|\n)[ \+]\s*(?:$Type\s*)?\Q$testval\E\s*=\s*(?:\([^\)]*\)\s*)?\s*$allocFunctions\s*\(/ &&
5576 $s !~ /\b__GFP_NOWARN\b/ ) {
5549 WARN("OOM_MESSAGE", 5577 WARN("OOM_MESSAGE",
5550 "Possible unnecessary 'out of memory' message\n" . $hereprev); 5578 "Possible unnecessary 'out of memory' message\n" . $hereprev);
5551 } 5579 }
@@ -6196,8 +6224,8 @@ sub process {
6196 } 6224 }
6197 } 6225 }
6198 6226
6199# check for pointless casting of kmalloc return 6227# check for pointless casting of alloc functions
6200 if ($line =~ /\*\s*\)\s*[kv][czm]alloc(_node){0,1}\b/) { 6228 if ($line =~ /\*\s*\)\s*$allocFunctions\b/) {
6201 WARN("UNNECESSARY_CASTS", 6229 WARN("UNNECESSARY_CASTS",
6202 "unnecessary cast may hide bugs, see http://c-faq.com/malloc/mallocnocast.html\n" . $herecurr); 6230 "unnecessary cast may hide bugs, see http://c-faq.com/malloc/mallocnocast.html\n" . $herecurr);
6203 } 6231 }
@@ -6205,7 +6233,7 @@ sub process {
6205# alloc style 6233# alloc style
6206# p = alloc(sizeof(struct foo), ...) should be p = alloc(sizeof(*p), ...) 6234# p = alloc(sizeof(struct foo), ...) should be p = alloc(sizeof(*p), ...)
6207 if ($perl_version_ok && 6235 if ($perl_version_ok &&
6208 $line =~ /\b($Lval)\s*\=\s*(?:$balanced_parens)?\s*([kv][mz]alloc(?:_node)?)\s*\(\s*(sizeof\s*\(\s*struct\s+$Lval\s*\))/) { 6236 $line =~ /\b($Lval)\s*\=\s*(?:$balanced_parens)?\s*((?:kv|k|v)[mz]alloc(?:_node)?)\s*\(\s*(sizeof\s*\(\s*struct\s+$Lval\s*\))/) {
6209 CHK("ALLOC_SIZEOF_STRUCT", 6237 CHK("ALLOC_SIZEOF_STRUCT",
6210 "Prefer $3(sizeof(*$1)...) over $3($4...)\n" . $herecurr); 6238 "Prefer $3(sizeof(*$1)...) over $3($4...)\n" . $herecurr);
6211 } 6239 }
@@ -6368,19 +6396,6 @@ sub process {
6368 } 6396 }
6369 } 6397 }
6370 6398
6371# check for bool bitfields
6372 if ($sline =~ /^.\s+bool\s*$Ident\s*:\s*\d+\s*;/) {
6373 WARN("BOOL_BITFIELD",
6374 "Avoid using bool as bitfield. Prefer bool bitfields as unsigned int or u<8|16|32>\n" . $herecurr);
6375 }
6376
6377# check for bool use in .h files
6378 if ($realfile =~ /\.h$/ &&
6379 $sline =~ /^.\s+bool\s*$Ident\s*(?::\s*d+\s*)?;/) {
6380 CHK("BOOL_MEMBER",
6381 "Avoid using bool structure members because of possible alignment issues - see: https://lkml.org/lkml/2017/11/21/384\n" . $herecurr);
6382 }
6383
6384# check for semaphores initialized locked 6399# check for semaphores initialized locked
6385 if ($line =~ /^.\s*sema_init.+,\W?0\W?\)/) { 6400 if ($line =~ /^.\s*sema_init.+,\W?0\W?\)/) {
6386 WARN("CONSIDER_COMPLETION", 6401 WARN("CONSIDER_COMPLETION",
diff --git a/scripts/checksyscalls.sh b/scripts/checksyscalls.sh
index cf931003395f..a18b47695f55 100755
--- a/scripts/checksyscalls.sh
+++ b/scripts/checksyscalls.sh
@@ -30,12 +30,14 @@ cat << EOF
30#define __IGNORE_readlink /* readlinkat */ 30#define __IGNORE_readlink /* readlinkat */
31#define __IGNORE_symlink /* symlinkat */ 31#define __IGNORE_symlink /* symlinkat */
32#define __IGNORE_utimes /* futimesat */ 32#define __IGNORE_utimes /* futimesat */
33#if BITS_PER_LONG == 64
34#define __IGNORE_stat /* fstatat */ 33#define __IGNORE_stat /* fstatat */
35#define __IGNORE_lstat /* fstatat */ 34#define __IGNORE_lstat /* fstatat */
36#else
37#define __IGNORE_stat64 /* fstatat64 */ 35#define __IGNORE_stat64 /* fstatat64 */
38#define __IGNORE_lstat64 /* fstatat64 */ 36#define __IGNORE_lstat64 /* fstatat64 */
37
38#ifndef __ARCH_WANT_SET_GET_RLIMIT
39#define __IGNORE_getrlimit /* getrlimit */
40#define __IGNORE_setrlimit /* setrlimit */
39#endif 41#endif
40 42
41/* Missing flags argument */ 43/* Missing flags argument */
@@ -84,6 +86,26 @@ cat << EOF
84#define __IGNORE_statfs64 86#define __IGNORE_statfs64
85#define __IGNORE_llseek 87#define __IGNORE_llseek
86#define __IGNORE_mmap2 88#define __IGNORE_mmap2
89#define __IGNORE_clock_gettime64
90#define __IGNORE_clock_settime64
91#define __IGNORE_clock_adjtime64
92#define __IGNORE_clock_getres_time64
93#define __IGNORE_clock_nanosleep_time64
94#define __IGNORE_timer_gettime64
95#define __IGNORE_timer_settime64
96#define __IGNORE_timerfd_gettime64
97#define __IGNORE_timerfd_settime64
98#define __IGNORE_utimensat_time64
99#define __IGNORE_pselect6_time64
100#define __IGNORE_ppoll_time64
101#define __IGNORE_io_pgetevents_time64
102#define __IGNORE_recvmmsg_time64
103#define __IGNORE_mq_timedsend_time64
104#define __IGNORE_mq_timedreceive_time64
105#define __IGNORE_semtimedop_time64
106#define __IGNORE_rt_sigtimedwait_time64
107#define __IGNORE_futex_time64
108#define __IGNORE_sched_rr_get_interval_time64
87#else 109#else
88#define __IGNORE_sendfile 110#define __IGNORE_sendfile
89#define __IGNORE_ftruncate 111#define __IGNORE_ftruncate
@@ -98,6 +120,33 @@ cat << EOF
98#define __IGNORE_statfs 120#define __IGNORE_statfs
99#define __IGNORE_lseek 121#define __IGNORE_lseek
100#define __IGNORE_mmap 122#define __IGNORE_mmap
123#define __IGNORE_clock_gettime
124#define __IGNORE_clock_settime
125#define __IGNORE_clock_adjtime
126#define __IGNORE_clock_getres
127#define __IGNORE_clock_nanosleep
128#define __IGNORE_timer_gettime
129#define __IGNORE_timer_settime
130#define __IGNORE_timerfd_gettime
131#define __IGNORE_timerfd_settime
132#define __IGNORE_utimensat
133#define __IGNORE_pselect6
134#define __IGNORE_ppoll
135#define __IGNORE_io_pgetevents
136#define __IGNORE_recvmmsg
137#define __IGNORE_mq_timedsend
138#define __IGNORE_mq_timedreceive
139#define __IGNORE_semtimedop
140#define __IGNORE_rt_sigtimedwait
141#define __IGNORE_futex
142#define __IGNORE_sched_rr_get_interval
143#define __IGNORE_gettimeofday
144#define __IGNORE_settimeofday
145#define __IGNORE_wait4
146#define __IGNORE_adjtimex
147#define __IGNORE_nanosleep
148#define __IGNORE_io_getevents
149#define __IGNORE_recvmmsg
101#endif 150#endif
102 151
103/* i386-specific or historical system calls */ 152/* i386-specific or historical system calls */
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() {
37 symbol=${symbol#\(} 37 symbol=${symbol#\(}
38 symbol=${symbol%\)} 38 symbol=${symbol%\)}
39 39
40 # Strip segment
41 local segment
42 if [[ $symbol == *:* ]] ; then
43 segment=${symbol%%:*}:
44 symbol=${symbol#*:}
45 fi
46
40 # Strip the symbol name so that we could look it up 47 # Strip the symbol name so that we could look it up
41 local name=${symbol%+*} 48 local name=${symbol%+*}
42 49
@@ -84,7 +91,7 @@ parse_symbol() {
84 code=${code//$'\n'/' '} 91 code=${code//$'\n'/' '}
85 92
86 # Replace old address with pretty line numbers 93 # Replace old address with pretty line numbers
87 symbol="$name ($code)" 94 symbol="$segment$name ($code)"
88} 95}
89 96
90decode_code() { 97decode_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:
21 diff DTx_1 and DTx_2 21 diff DTx_1 and DTx_2
22 22
23 23
24 --annotate synonym for -T
24 -f print full dts in diff (--unified=99999) 25 -f print full dts in diff (--unified=99999)
25 -h synonym for --help 26 -h synonym for --help
26 -help synonym for --help 27 -help synonym for --help
@@ -28,6 +29,7 @@ Usage:
28 -s SRCTREE linux kernel source tree is at path SRCTREE 29 -s SRCTREE linux kernel source tree is at path SRCTREE
29 (default is current directory) 30 (default is current directory)
30 -S linux kernel source tree is at root of current git repo 31 -S linux kernel source tree is at root of current git repo
32 -T Annotate output .dts with input source file and line (-T -T for more details)
31 -u unsorted, do not sort DTx 33 -u unsorted, do not sort DTx
32 34
33 35
@@ -174,6 +176,7 @@ compile_to_dts() {
174 176
175# ----- start of script 177# ----- start of script
176 178
179annotate=""
177cmd_diff=0 180cmd_diff=0
178diff_flags="-u" 181diff_flags="-u"
179dtx_file_1="" 182dtx_file_1=""
@@ -208,6 +211,14 @@ while [ $# -gt 0 ] ; do
208 shift 211 shift
209 ;; 212 ;;
210 213
214 -T | --annotate )
215 if [ "${annotate}" = "" ] ; then
216 annotate="-T"
217 elif [ "${annotate}" = "-T" ] ; then
218 annotate="-T -T"
219 fi
220 shift
221 ;;
211 -u ) 222 -u )
212 dtc_sort="" 223 dtc_sort=""
213 shift 224 shift
@@ -327,7 +338,7 @@ cpp_flags="\
327DTC="\ 338DTC="\
328 ${DTC} \ 339 ${DTC} \
329 -i ${srctree}/scripts/dtc/include-prefixes \ 340 -i ${srctree}/scripts/dtc/include-prefixes \
330 -O dts -qq -f ${dtc_sort} -o -" 341 -O dts -qq -f ${dtc_sort} ${annotate} -o -"
331 342
332 343
333# ----- do the diff or decompile 344# ----- 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
67 * https://pax.grsecurity.net/ 67 * https://pax.grsecurity.net/
68 68
69config GCC_PLUGIN_STRUCTLEAK 69config GCC_PLUGIN_STRUCTLEAK
70 bool "Force initialization of variables containing userspace addresses" 70 bool "Zero initialize stack variables"
71 # Currently STRUCTLEAK inserts initialization out of live scope of
72 # variables from KASAN point of view. This leads to KASAN false
73 # positive reports. Prohibit this combination for now.
74 depends on !KASAN_EXTRA
75 help 71 help
76 This plugin zero-initializes any structures containing a 72 While the kernel is built with warnings enabled for any missed
77 __user attribute. This can prevent some classes of information 73 stack variable initializations, this warning is silenced for
78 exposures. 74 anything passed by reference to another function, under the
79 75 occasionally misguided assumption that the function will do
80 This plugin was ported from grsecurity/PaX. More information at: 76 the initialization. As this regularly leads to exploitable
77 flaws, this plugin is available to identify and zero-initialize
78 such variables, depending on the chosen level of coverage.
79
80 This plugin was originally ported from grsecurity/PaX. More
81 information at:
81 * https://grsecurity.net/ 82 * https://grsecurity.net/
82 * https://pax.grsecurity.net/ 83 * https://pax.grsecurity.net/
83 84
84config GCC_PLUGIN_STRUCTLEAK_BYREF_ALL 85choice
85 bool "Force initialize all struct type variables passed by reference" 86 prompt "Coverage"
86 depends on GCC_PLUGIN_STRUCTLEAK 87 depends on GCC_PLUGIN_STRUCTLEAK
87 depends on !COMPILE_TEST 88 default GCC_PLUGIN_STRUCTLEAK_BYREF_ALL
88 help 89 help
89 Zero initialize any struct type local variable that may be passed by 90 This chooses the level of coverage over classes of potentially
90 reference without having been initialized. 91 uninitialized variables. The selected class will be
92 zero-initialized before use.
93
94 config GCC_PLUGIN_STRUCTLEAK_USER
95 bool "structs marked for userspace"
96 help
97 Zero-initialize any structures on the stack containing
98 a __user attribute. This can prevent some classes of
99 uninitialized stack variable exploits and information
100 exposures, like CVE-2013-2141:
101 https://git.kernel.org/linus/b9e146d8eb3b9eca
102
103 config GCC_PLUGIN_STRUCTLEAK_BYREF
104 bool "structs passed by reference"
105 help
106 Zero-initialize any structures on the stack that may
107 be passed by reference and had not already been
108 explicitly initialized. This can prevent most classes
109 of uninitialized stack variable exploits and information
110 exposures, like CVE-2017-1000410:
111 https://git.kernel.org/linus/06e7e776ca4d3654
112
113 config GCC_PLUGIN_STRUCTLEAK_BYREF_ALL
114 bool "anything passed by reference"
115 help
116 Zero-initialize any stack variables that may be passed
117 by reference and had not already been explicitly
118 initialized. This is intended to eliminate all classes
119 of uninitialized stack variable exploits and information
120 exposures.
121
122endchoice
91 123
92config GCC_PLUGIN_STRUCTLEAK_VERBOSE 124config GCC_PLUGIN_STRUCTLEAK_VERBOSE
93 bool "Report forcefully initialized variables" 125 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 @@
16 * Options: 16 * Options:
17 * -fplugin-arg-structleak_plugin-disable 17 * -fplugin-arg-structleak_plugin-disable
18 * -fplugin-arg-structleak_plugin-verbose 18 * -fplugin-arg-structleak_plugin-verbose
19 * -fplugin-arg-structleak_plugin-byref
19 * -fplugin-arg-structleak_plugin-byref-all 20 * -fplugin-arg-structleak_plugin-byref-all
20 * 21 *
21 * Usage: 22 * Usage:
@@ -26,7 +27,6 @@
26 * $ gcc -fplugin=./structleak_plugin.so test.c -O2 27 * $ gcc -fplugin=./structleak_plugin.so test.c -O2
27 * 28 *
28 * TODO: eliminate redundant initializers 29 * TODO: eliminate redundant initializers
29 * increase type coverage
30 */ 30 */
31 31
32#include "gcc-common.h" 32#include "gcc-common.h"
@@ -37,13 +37,18 @@
37__visible int plugin_is_GPL_compatible; 37__visible int plugin_is_GPL_compatible;
38 38
39static struct plugin_info structleak_plugin_info = { 39static struct plugin_info structleak_plugin_info = {
40 .version = "201607271510vanilla", 40 .version = "20190125vanilla",
41 .help = "disable\tdo not activate plugin\n" 41 .help = "disable\tdo not activate plugin\n"
42 "verbose\tprint all initialized variables\n", 42 "byref\tinit structs passed by reference\n"
43 "byref-all\tinit anything passed by reference\n"
44 "verbose\tprint all initialized variables\n",
43}; 45};
44 46
47#define BYREF_STRUCT 1
48#define BYREF_ALL 2
49
45static bool verbose; 50static bool verbose;
46static bool byref_all; 51static int byref;
47 52
48static tree handle_user_attribute(tree *node, tree name, tree args, int flags, bool *no_add_attrs) 53static tree handle_user_attribute(tree *node, tree name, tree args, int flags, bool *no_add_attrs)
49{ 54{
@@ -118,6 +123,7 @@ static void initialize(tree var)
118 gimple_stmt_iterator gsi; 123 gimple_stmt_iterator gsi;
119 tree initializer; 124 tree initializer;
120 gimple init_stmt; 125 gimple init_stmt;
126 tree type;
121 127
122 /* this is the original entry bb before the forced split */ 128 /* this is the original entry bb before the forced split */
123 bb = single_succ(ENTRY_BLOCK_PTR_FOR_FN(cfun)); 129 bb = single_succ(ENTRY_BLOCK_PTR_FOR_FN(cfun));
@@ -148,11 +154,15 @@ static void initialize(tree var)
148 if (verbose) 154 if (verbose)
149 inform(DECL_SOURCE_LOCATION(var), 155 inform(DECL_SOURCE_LOCATION(var),
150 "%s variable will be forcibly initialized", 156 "%s variable will be forcibly initialized",
151 (byref_all && TREE_ADDRESSABLE(var)) ? "byref" 157 (byref && TREE_ADDRESSABLE(var)) ? "byref"
152 : "userspace"); 158 : "userspace");
153 159
154 /* build the initializer expression */ 160 /* build the initializer expression */
155 initializer = build_constructor(TREE_TYPE(var), NULL); 161 type = TREE_TYPE(var);
162 if (AGGREGATE_TYPE_P(type))
163 initializer = build_constructor(type, NULL);
164 else
165 initializer = fold_convert(type, integer_zero_node);
156 166
157 /* build the initializer stmt */ 167 /* build the initializer stmt */
158 init_stmt = gimple_build_assign(var, initializer); 168 init_stmt = gimple_build_assign(var, initializer);
@@ -184,13 +194,13 @@ static unsigned int structleak_execute(void)
184 if (!auto_var_in_fn_p(var, current_function_decl)) 194 if (!auto_var_in_fn_p(var, current_function_decl))
185 continue; 195 continue;
186 196
187 /* only care about structure types */ 197 /* only care about structure types unless byref-all */
188 if (TREE_CODE(type) != RECORD_TYPE && TREE_CODE(type) != UNION_TYPE) 198 if (byref != BYREF_ALL && TREE_CODE(type) != RECORD_TYPE && TREE_CODE(type) != UNION_TYPE)
189 continue; 199 continue;
190 200
191 /* if the type is of interest, examine the variable */ 201 /* if the type is of interest, examine the variable */
192 if (TYPE_USERSPACE(type) || 202 if (TYPE_USERSPACE(type) ||
193 (byref_all && TREE_ADDRESSABLE(var))) 203 (byref && TREE_ADDRESSABLE(var)))
194 initialize(var); 204 initialize(var);
195 } 205 }
196 206
@@ -232,8 +242,12 @@ __visible int plugin_init(struct plugin_name_args *plugin_info, struct plugin_gc
232 verbose = true; 242 verbose = true;
233 continue; 243 continue;
234 } 244 }
245 if (!strcmp(argv[i].key, "byref")) {
246 byref = BYREF_STRUCT;
247 continue;
248 }
235 if (!strcmp(argv[i].key, "byref-all")) { 249 if (!strcmp(argv[i].key, "byref-all")) {
236 byref_all = true; 250 byref = BYREF_ALL;
237 continue; 251 continue;
238 } 252 }
239 error(G_("unknown option '-fplugin-arg-%s-%s'"), plugin_name, argv[i].key); 253 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 @@
37import gdb 37import gdb
38 38
39/* linux/fs.h */ 39/* linux/fs.h */
40LX_VALUE(MS_RDONLY) 40LX_VALUE(SB_RDONLY)
41LX_VALUE(MS_SYNCHRONOUS) 41LX_VALUE(SB_SYNCHRONOUS)
42LX_VALUE(MS_MANDLOCK) 42LX_VALUE(SB_MANDLOCK)
43LX_VALUE(MS_DIRSYNC) 43LX_VALUE(SB_DIRSYNC)
44LX_VALUE(MS_NOATIME) 44LX_VALUE(SB_NOATIME)
45LX_VALUE(MS_NODIRATIME) 45LX_VALUE(SB_NODIRATIME)
46 46
47/* linux/mount.h */ 47/* linux/mount.h */
48LX_VALUE(MNT_NOSUID) 48LX_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):
114 return opts 114 return opts
115 115
116 116
117FS_INFO = {constants.LX_MS_SYNCHRONOUS: ",sync", 117FS_INFO = {constants.LX_SB_SYNCHRONOUS: ",sync",
118 constants.LX_MS_MANDLOCK: ",mand", 118 constants.LX_SB_MANDLOCK: ",mand",
119 constants.LX_MS_DIRSYNC: ",dirsync", 119 constants.LX_SB_DIRSYNC: ",dirsync",
120 constants.LX_MS_NOATIME: ",noatime", 120 constants.LX_SB_NOATIME: ",noatime",
121 constants.LX_MS_NODIRATIME: ",nodiratime"} 121 constants.LX_SB_NODIRATIME: ",nodiratime"}
122 122
123MNT_INFO = {constants.LX_MNT_NOSUID: ",nosuid", 123MNT_INFO = {constants.LX_MNT_NOSUID: ",nosuid",
124 constants.LX_MNT_NODEV: ",nodev", 124 constants.LX_MNT_NODEV: ",nodev",
@@ -184,7 +184,7 @@ values of that process namespace"""
184 fstype = superblock['s_type']['name'].string() 184 fstype = superblock['s_type']['name'].string()
185 s_flags = int(superblock['s_flags']) 185 s_flags = int(superblock['s_flags'])
186 m_flags = int(vfs['mnt']['mnt_flags']) 186 m_flags = int(vfs['mnt']['mnt_flags'])
187 rd = "ro" if (s_flags & constants.LX_MS_RDONLY) else "rw" 187 rd = "ro" if (s_flags & constants.LX_SB_RDONLY) else "rw"
188 188
189 gdb.write( 189 gdb.write(
190 "{} {} {} {}{}{} 0 0\n" 190 "{} {} {} {}{}{} 0 0\n"
diff --git a/scripts/kallsyms.c b/scripts/kallsyms.c
index 77cebad0474e..f75e7bda4889 100644
--- a/scripts/kallsyms.c
+++ b/scripts/kallsyms.c
@@ -118,8 +118,8 @@ static int read_symbol(FILE *in, struct sym_entry *s)
118 fprintf(stderr, "Read error or end of file.\n"); 118 fprintf(stderr, "Read error or end of file.\n");
119 return -1; 119 return -1;
120 } 120 }
121 if (strlen(sym) > KSYM_NAME_LEN) { 121 if (strlen(sym) >= KSYM_NAME_LEN) {
122 fprintf(stderr, "Symbol %s too long for kallsyms (%zu vs %d).\n" 122 fprintf(stderr, "Symbol %s too long for kallsyms (%zu >= %d).\n"
123 "Please increase KSYM_NAME_LEN both in kernel and kallsyms.c\n", 123 "Please increase KSYM_NAME_LEN both in kernel and kallsyms.c\n",
124 sym, strlen(sym), KSYM_NAME_LEN); 124 sym, strlen(sym), KSYM_NAME_LEN);
125 return -1; 125 return -1;
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($$$$) {
1474 if (!defined $parameterdescs{$param} && $param !~ /^#/) { 1474 if (!defined $parameterdescs{$param} && $param !~ /^#/) {
1475 $parameterdescs{$param} = $undescribed; 1475 $parameterdescs{$param} = $undescribed;
1476 1476
1477 if (show_warnings($type, $declaration_name)) { 1477 if (show_warnings($type, $declaration_name) && $param !~ /\./) {
1478 print STDERR 1478 print STDERR
1479 "${file}:$.: warning: Function parameter or member '$param' not described in '$declaration_name'\n"; 1479 "${file}:$.: warning: Function parameter or member '$param' not described in '$declaration_name'\n";
1480 ++$warnings; 1480 ++$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:
97 --32-bit Scan 32-bit kernel. 97 --32-bit Scan 32-bit kernel.
98 --page-offset-32-bit=o Page offset (for 32-bit kernel 0xABCD1234). 98 --page-offset-32-bit=o Page offset (for 32-bit kernel 0xABCD1234).
99 -d, --debug Display debugging output. 99 -d, --debug Display debugging output.
100 -h, --help, --version Display this help and exit. 100 -h, --help Display this help and exit.
101 101
102Scans the running kernel for potential leaking addresses. 102Scans the running kernel for potential leaking addresses.
103 103
@@ -108,7 +108,6 @@ EOM
108GetOptions( 108GetOptions(
109 'd|debug' => \$debug, 109 'd|debug' => \$debug,
110 'h|help' => \$help, 110 'h|help' => \$help,
111 'version' => \$help,
112 'o|output-raw=s' => \$output_raw, 111 'o|output-raw=s' => \$output_raw,
113 'i|input-raw=s' => \$input_raw, 112 'i|input-raw=s' => \$input_raw,
114 'suppress-dmesg' => \$suppress_dmesg, 113 'suppress-dmesg' => \$suppress_dmesg,
@@ -231,7 +230,7 @@ sub get_kernel_config_option
231 my $tmp_file = "/tmp/tmpkconf"; 230 my $tmp_file = "/tmp/tmpkconf";
232 231
233 if (system("gunzip < /proc/config.gz > $tmp_file")) { 232 if (system("gunzip < /proc/config.gz > $tmp_file")) {
234 dprint "$0: system(gunzip < /proc/config.gz) failed\n"; 233 dprint("system(gunzip < /proc/config.gz) failed\n");
235 return ""; 234 return "";
236 } else { 235 } else {
237 @config_files = ($tmp_file); 236 @config_files = ($tmp_file);
@@ -243,7 +242,7 @@ sub get_kernel_config_option
243 } 242 }
244 243
245 foreach my $file (@config_files) { 244 foreach my $file (@config_files) {
246 dprint("parsing config file: %s\n", $file); 245 dprint("parsing config file: $file\n");
247 $value = option_from_file($option, $file); 246 $value = option_from_file($option, $file);
248 if ($value ne "") { 247 if ($value ne "") {
249 last; 248 last;
@@ -502,7 +501,7 @@ sub walk
502 next; 501 next;
503 } 502 }
504 503
505 dprint "parsing: $path\n"; 504 dprint("parsing: $path\n");
506 timed_parse_file($path); 505 timed_parse_file($path);
507 } 506 }
508 } 507 }
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)
225 DEVID_FIELD(typec_device_id, svid); 225 DEVID_FIELD(typec_device_id, svid);
226 DEVID_FIELD(typec_device_id, mode); 226 DEVID_FIELD(typec_device_id, mode);
227 227
228 DEVID(tee_client_device_id);
229 DEVID_FIELD(tee_client_device_id, uuid);
230
231 DEVID(wmi_device_id);
232 DEVID_FIELD(wmi_device_id, guid_string);
233
228 return 0; 234 return 0;
229} 235}
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;
37typedef struct { 37typedef struct {
38 __u8 b[16]; 38 __u8 b[16];
39} uuid_le; 39} uuid_le;
40typedef struct {
41 __u8 b[16];
42} uuid_t;
43#define UUID_STRING_LEN 36
40 44
41/* Big exception to the "don't include kernel headers into userspace, which 45/* Big exception to the "don't include kernel headers into userspace, which
42 * even potentially has different endianness and word sizes, since 46 * even potentially has different endianness and word sizes, since
@@ -50,6 +54,9 @@ struct devtable {
50 int (*do_entry)(const char *filename, void *symval, char *alias); 54 int (*do_entry)(const char *filename, void *symval, char *alias);
51}; 55};
52 56
57/* Size of alias provided to do_entry functions */
58#define ALIAS_SIZE 500
59
53/* Define a variable f that holds the value of field f of struct devid 60/* Define a variable f that holds the value of field f of struct devid
54 * based at address m. 61 * based at address m.
55 */ 62 */
@@ -1287,6 +1294,42 @@ static int do_typec_entry(const char *filename, void *symval, char *alias)
1287 return 1; 1294 return 1;
1288} 1295}
1289 1296
1297/* Looks like: tee:uuid */
1298static int do_tee_entry(const char *filename, void *symval, char *alias)
1299{
1300 DEF_FIELD(symval, tee_client_device_id, uuid);
1301
1302 sprintf(alias, "tee:%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x",
1303 uuid.b[0], uuid.b[1], uuid.b[2], uuid.b[3], uuid.b[4],
1304 uuid.b[5], uuid.b[6], uuid.b[7], uuid.b[8], uuid.b[9],
1305 uuid.b[10], uuid.b[11], uuid.b[12], uuid.b[13], uuid.b[14],
1306 uuid.b[15]);
1307
1308 add_wildcard(alias);
1309 return 1;
1310}
1311
1312/* Looks like: wmi:guid */
1313static int do_wmi_entry(const char *filename, void *symval, char *alias)
1314{
1315 int len;
1316 DEF_FIELD_ADDR(symval, wmi_device_id, guid_string);
1317
1318 if (strlen(*guid_string) != UUID_STRING_LEN) {
1319 warn("Invalid WMI device id 'wmi:%s' in '%s'\n",
1320 *guid_string, filename);
1321 return 0;
1322 }
1323
1324 len = snprintf(alias, ALIAS_SIZE, WMI_MODULE_PREFIX "%s", *guid_string);
1325 if (len < 0 || len >= ALIAS_SIZE) {
1326 warn("Could not generate all MODULE_ALIAS's in '%s'\n",
1327 filename);
1328 return 0;
1329 }
1330 return 1;
1331}
1332
1290/* Does namelen bytes of name exactly match the symbol? */ 1333/* Does namelen bytes of name exactly match the symbol? */
1291static bool sym_is(const char *name, unsigned namelen, const char *symbol) 1334static bool sym_is(const char *name, unsigned namelen, const char *symbol)
1292{ 1335{
@@ -1303,7 +1346,7 @@ static void do_table(void *symval, unsigned long size,
1303 struct module *mod) 1346 struct module *mod)
1304{ 1347{
1305 unsigned int i; 1348 unsigned int i;
1306 char alias[500]; 1349 char alias[ALIAS_SIZE];
1307 1350
1308 device_id_check(mod->name, device_id, size, id_size, symval); 1351 device_id_check(mod->name, device_id, size, id_size, symval);
1309 /* Leave last one: it's the terminator. */ 1352 /* Leave last one: it's the terminator. */
@@ -1357,6 +1400,8 @@ static const struct devtable devtable[] = {
1357 {"fslmc", SIZE_fsl_mc_device_id, do_fsl_mc_entry}, 1400 {"fslmc", SIZE_fsl_mc_device_id, do_fsl_mc_entry},
1358 {"tbsvc", SIZE_tb_service_id, do_tbsvc_entry}, 1401 {"tbsvc", SIZE_tb_service_id, do_tbsvc_entry},
1359 {"typec", SIZE_typec_device_id, do_typec_entry}, 1402 {"typec", SIZE_typec_device_id, do_typec_entry},
1403 {"tee", SIZE_tee_client_device_id, do_tee_entry},
1404 {"wmi", SIZE_wmi_device_id, do_wmi_entry},
1360}; 1405};
1361 1406
1362/* Create MODULE_ALIAS() statements. 1407/* 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):
175 self.lines_checked += 1 175 self.lines_checked += 1
176 if line.find("SPDX-License-Identifier:") < 0: 176 if line.find("SPDX-License-Identifier:") < 0:
177 continue 177 continue
178 expr = line.split(':')[1].replace('*/', '').strip() 178 expr = line.split(':')[1].strip()
179 # Remove trailing comment closure
180 if line.strip().endswith('*/'):
181 expr = expr.rstrip('*/').strip()
182 # Special case for SH magic boot code files
183 if line.startswith('LIST \"'):
184 expr = expr.rstrip('\"').strip()
179 self.parse(expr) 185 self.parse(expr)
180 self.spdx_valid += 1 186 self.spdx_valid += 1
181 # 187 #
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 @@
10abandonning||abandoning 10abandonning||abandoning
11abigious||ambiguous 11abigious||ambiguous
12abitrate||arbitrate 12abitrate||arbitrate
13abnornally||abnormally
14abnrormal||abnormal
13abord||abort 15abord||abort
14aboslute||absolute 16aboslute||absolute
15abov||above 17abov||above
@@ -107,6 +109,7 @@ ambigious||ambiguous
107amoung||among 109amoung||among
108amout||amount 110amout||amount
109amplifer||amplifier 111amplifer||amplifier
112amplifyer||amplifier
110an union||a union 113an union||a union
111an user||a user 114an user||a user
112an userspace||a userspace 115an userspace||a userspace
@@ -145,6 +148,7 @@ artillary||artillery
145asign||assign 148asign||assign
146asser||assert 149asser||assert
147assertation||assertion 150assertation||assertion
151assertting||asserting
148assiged||assigned 152assiged||assigned
149assigment||assignment 153assigment||assignment
150assigments||assignments 154assigments||assignments
@@ -168,6 +172,8 @@ attachement||attachment
168attched||attached 172attched||attached
169attemps||attempts 173attemps||attempts
170attemping||attempting 174attemping||attempting
175attepmpt||attempt
176attnetion||attention
171attruibutes||attributes 177attruibutes||attributes
172authentification||authentication 178authentification||authentication
173automaticaly||automatically 179automaticaly||automatically
@@ -217,6 +223,7 @@ boardcast||broadcast
217borad||board 223borad||board
218boundry||boundary 224boundry||boundary
219brievely||briefly 225brievely||briefly
226broadcase||broadcast
220broadcat||broadcast 227broadcat||broadcast
221bufufer||buffer 228bufufer||buffer
222cacluated||calculated 229cacluated||calculated
@@ -234,6 +241,7 @@ cancle||cancel
234capabilites||capabilities 241capabilites||capabilities
235capabilty||capability 242capabilty||capability
236capabitilies||capabilities 243capabitilies||capabilities
244capablity||capability
237capatibilities||capabilities 245capatibilities||capabilities
238capapbilities||capabilities 246capapbilities||capabilities
239caputure||capture 247caputure||capture
@@ -274,6 +282,7 @@ clared||cleared
274closeing||closing 282closeing||closing
275clustred||clustered 283clustred||clustered
276coexistance||coexistence 284coexistance||coexistence
285colescing||coalescing
277collapsable||collapsible 286collapsable||collapsible
278colorfull||colorful 287colorfull||colorful
279comand||command 288comand||command
@@ -290,6 +299,7 @@ comsumer||consumer
290comsuming||consuming 299comsuming||consuming
291compability||compatibility 300compability||compatibility
292compaibility||compatibility 301compaibility||compatibility
302comparsion||comparison
293compatability||compatibility 303compatability||compatibility
294compatable||compatible 304compatable||compatible
295compatibiliy||compatibility 305compatibiliy||compatibility
@@ -303,6 +313,7 @@ completly||completely
303complient||compliant 313complient||compliant
304componnents||components 314componnents||components
305compoment||component 315compoment||component
316comppatible||compatible
306compres||compress 317compres||compress
307compresion||compression 318compresion||compression
308comression||compression 319comression||compression
@@ -368,6 +379,8 @@ decsribed||described
368decription||description 379decription||description
369dectected||detected 380dectected||detected
370defailt||default 381defailt||default
382deferal||deferral
383deffered||deferred
371defferred||deferred 384defferred||deferred
372definate||definite 385definate||definite
373definately||definitely 386definately||definitely
@@ -400,6 +413,7 @@ descritptor||descriptor
400desctiptor||descriptor 413desctiptor||descriptor
401desriptor||descriptor 414desriptor||descriptor
402desriptors||descriptors 415desriptors||descriptors
416desination||destination
403destionation||destination 417destionation||destination
404destoried||destroyed 418destoried||destroyed
405destory||destroy 419destory||destroy
@@ -426,7 +440,9 @@ diffrent||different
426differenciate||differentiate 440differenciate||differentiate
427diffrentiate||differentiate 441diffrentiate||differentiate
428difinition||definition 442difinition||definition
443dimention||dimension
429dimesions||dimensions 444dimesions||dimensions
445dispalying||displaying
430diplay||display 446diplay||display
431directon||direction 447directon||direction
432direectly||directly 448direectly||directly
@@ -442,6 +458,7 @@ disbled||disabled
442disconnet||disconnect 458disconnet||disconnect
443discontinous||discontinuous 459discontinous||discontinuous
444disharge||discharge 460disharge||discharge
461disnabled||disabled
445dispertion||dispersion 462dispertion||dispersion
446dissapears||disappears 463dissapears||disappears
447distiction||distinction 464distiction||distinction
@@ -456,6 +473,7 @@ dorp||drop
456dosen||doesn 473dosen||doesn
457downlad||download 474downlad||download
458downlads||downloads 475downlads||downloads
476droped||dropped
459druing||during 477druing||during
460dynmaic||dynamic 478dynmaic||dynamic
461eanable||enable 479eanable||enable
@@ -471,6 +489,7 @@ elementry||elementary
471eletronic||electronic 489eletronic||electronic
472embeded||embedded 490embeded||embedded
473enabledi||enabled 491enabledi||enabled
492enble||enable
474enchanced||enhanced 493enchanced||enhanced
475encorporating||incorporating 494encorporating||incorporating
476encrupted||encrypted 495encrupted||encrypted
@@ -479,6 +498,9 @@ encryptio||encryption
479endianess||endianness 498endianess||endianness
480enhaced||enhanced 499enhaced||enhanced
481enlightnment||enlightenment 500enlightnment||enlightenment
501enqueing||enqueuing
502entires||entries
503entites||entities
482entrys||entries 504entrys||entries
483enocded||encoded 505enocded||encoded
484enterily||entirely 506enterily||entirely
@@ -498,6 +520,8 @@ etsbalishment||establishment
498excecutable||executable 520excecutable||executable
499exceded||exceeded 521exceded||exceeded
500excellant||excellent 522excellant||excellent
523execeeded||exceeded
524execeeds||exceeds
501exeed||exceed 525exeed||exceed
502existance||existence 526existance||existence
503existant||existent 527existant||existent
@@ -506,6 +530,7 @@ exlcude||exclude
506exlcusive||exclusive 530exlcusive||exclusive
507exmaple||example 531exmaple||example
508expecially||especially 532expecially||especially
533experies||expires
509explicite||explicit 534explicite||explicit
510explicitely||explicitly 535explicitely||explicitly
511explict||explicit 536explict||explicit
@@ -521,6 +546,7 @@ extracter||extractor
521faield||failed 546faield||failed
522falied||failed 547falied||failed
523faild||failed 548faild||failed
549failded||failed
524failer||failure 550failer||failure
525faill||fail 551faill||fail
526failied||failed 552failied||failed
@@ -540,6 +566,7 @@ fetaure||feature
540fetaures||features 566fetaures||features
541fileystem||filesystem 567fileystem||filesystem
542fimware||firmware 568fimware||firmware
569firmare||firmware
543firware||firmware 570firware||firmware
544finanize||finalize 571finanize||finalize
545findn||find 572findn||find
@@ -574,6 +601,7 @@ funtions||functions
574furthur||further 601furthur||further
575futhermore||furthermore 602futhermore||furthermore
576futrue||future 603futrue||future
604gauage||gauge
577gaurenteed||guaranteed 605gaurenteed||guaranteed
578generiously||generously 606generiously||generously
579genereate||generate 607genereate||generate
@@ -645,6 +673,7 @@ independed||independent
645indiate||indicate 673indiate||indicate
646indicat||indicate 674indicat||indicate
647inexpect||inexpected 675inexpect||inexpected
676inferface||interface
648infomation||information 677infomation||information
649informatiom||information 678informatiom||information
650informations||information 679informations||information
@@ -662,14 +691,17 @@ initialiazation||initialization
662initializiation||initialization 691initializiation||initialization
663initialze||initialize 692initialze||initialize
664initialzed||initialized 693initialzed||initialized
694initialzing||initializing
665initilization||initialization 695initilization||initialization
666initilize||initialize 696initilize||initialize
667inofficial||unofficial 697inofficial||unofficial
668inrerface||interface 698inrerface||interface
669insititute||institute 699insititute||institute
700instace||instance
670instal||install 701instal||install
671instanciate||instantiate 702instanciate||instantiate
672instanciated||instantiated 703instanciated||instantiated
704insufficent||insufficient
673inteface||interface 705inteface||interface
674integreated||integrated 706integreated||integrated
675integrety||integrity 707integrety||integrity
@@ -684,6 +716,8 @@ intermittant||intermittent
684internel||internal 716internel||internal
685interoprability||interoperability 717interoprability||interoperability
686interuupt||interrupt 718interuupt||interrupt
719interupt||interrupt
720interupts||interrupts
687interrface||interface 721interrface||interface
688interrrupt||interrupt 722interrrupt||interrupt
689interrup||interrupt 723interrup||interrupt
@@ -699,11 +733,14 @@ intialization||initialization
699intialized||initialized 733intialized||initialized
700intialize||initialize 734intialize||initialize
701intregral||integral 735intregral||integral
736intrerrupt||interrupt
702intrrupt||interrupt 737intrrupt||interrupt
703intterrupt||interrupt 738intterrupt||interrupt
704intuative||intuitive 739intuative||intuitive
705inavlid||invalid 740inavlid||invalid
706invaid||invalid 741invaid||invalid
742invaild||invalid
743invailid||invalid
707invald||invalid 744invald||invalid
708invalde||invalid 745invalde||invalid
709invalide||invalid 746invalide||invalid
@@ -712,6 +749,7 @@ invalud||invalid
712invididual||individual 749invididual||individual
713invokation||invocation 750invokation||invocation
714invokations||invocations 751invokations||invocations
752ireelevant||irrelevant
715irrelevent||irrelevant 753irrelevent||irrelevant
716isnt||isn't 754isnt||isn't
717isssue||issue 755isssue||issue
@@ -747,6 +785,7 @@ loobpack||loopback
747loosing||losing 785loosing||losing
748losted||lost 786losted||lost
749machinary||machinery 787machinary||machinery
788maibox||mailbox
750maintainance||maintenance 789maintainance||maintenance
751maintainence||maintenance 790maintainence||maintenance
752maintan||maintain 791maintan||maintain
@@ -758,14 +797,19 @@ managable||manageable
758managment||management 797managment||management
759mangement||management 798mangement||management
760manoeuvering||maneuvering 799manoeuvering||maneuvering
800manufaucturing||manufacturing
761mappping||mapping 801mappping||mapping
762matchs||matches 802matchs||matches
763mathimatical||mathematical 803mathimatical||mathematical
764mathimatic||mathematic 804mathimatic||mathematic
765mathimatics||mathematics 805mathimatics||mathematics
806maximium||maximum
766maxium||maximum 807maxium||maximum
767mechamism||mechanism 808mechamism||mechanism
768meetign||meeting 809meetign||meeting
810memeory||memory
811memmber||member
812memoery||memory
769ment||meant 813ment||meant
770mergable||mergeable 814mergable||mergeable
771mesage||message 815mesage||message
@@ -779,6 +823,7 @@ migrateable||migratable
779milliseonds||milliseconds 823milliseonds||milliseconds
780minium||minimum 824minium||minimum
781minimam||minimum 825minimam||minimum
826miniumum||minimum
782minumum||minimum 827minumum||minimum
783misalinged||misaligned 828misalinged||misaligned
784miscelleneous||miscellaneous 829miscelleneous||miscellaneous
@@ -839,6 +884,7 @@ occurence||occurrence
839occure||occurred 884occure||occurred
840occured||occurred 885occured||occurred
841occuring||occurring 886occuring||occurring
887offser||offset
842offet||offset 888offet||offset
843offloded||offloaded 889offloded||offloaded
844omited||omitted 890omited||omitted
@@ -855,6 +901,7 @@ optmizations||optimizations
855orientatied||orientated 901orientatied||orientated
856orientied||oriented 902orientied||oriented
857orignal||original 903orignal||original
904originial||original
858otherise||otherwise 905otherise||otherwise
859ouput||output 906ouput||output
860oustanding||outstanding 907oustanding||outstanding
@@ -874,6 +921,7 @@ packege||package
874packge||package 921packge||package
875packtes||packets 922packtes||packets
876pakage||package 923pakage||package
924paket||packet
877pallette||palette 925pallette||palette
878paln||plan 926paln||plan
879paramameters||parameters 927paramameters||parameters
@@ -886,6 +934,8 @@ paramters||parameters
886parmaters||parameters 934parmaters||parameters
887particuarly||particularly 935particuarly||particularly
888particularily||particularly 936particularily||particularly
937partion||partition
938partions||partitions
889partiton||partition 939partiton||partition
890pased||passed 940pased||passed
891passin||passing 941passin||passing
@@ -897,10 +947,12 @@ peice||piece
897pendantic||pedantic 947pendantic||pedantic
898peprocessor||preprocessor 948peprocessor||preprocessor
899perfoming||performing 949perfoming||performing
950peripherial||peripheral
900permissons||permissions 951permissons||permissions
901peroid||period 952peroid||period
902persistance||persistence 953persistance||persistence
903persistant||persistent 954persistant||persistent
955phoneticly||phonetically
904plalform||platform 956plalform||platform
905platfoem||platform 957platfoem||platform
906platfrom||platform 958platfrom||platform
@@ -915,6 +967,7 @@ posible||possible
915positon||position 967positon||position
916possibilites||possibilities 968possibilites||possibilities
917powerfull||powerful 969powerfull||powerful
970pramater||parameter
918preamle||preamble 971preamle||preamble
919preample||preamble 972preample||preamble
920preapre||prepare 973preapre||prepare
@@ -976,6 +1029,7 @@ psudo||pseudo
976psuedo||pseudo 1029psuedo||pseudo
977psychadelic||psychedelic 1030psychadelic||psychedelic
978pwoer||power 1031pwoer||power
1032queing||queuing
979quering||querying 1033quering||querying
980randomally||randomly 1034randomally||randomly
981raoming||roaming 1035raoming||roaming
@@ -1004,6 +1058,7 @@ refering||referring
1004refernces||references 1058refernces||references
1005refernnce||reference 1059refernnce||reference
1006refrence||reference 1060refrence||reference
1061registed||registered
1007registerd||registered 1062registerd||registered
1008registeration||registration 1063registeration||registration
1009registeresd||registered 1064registeresd||registered
@@ -1018,6 +1073,7 @@ regulamentations||regulations
1018reigstration||registration 1073reigstration||registration
1019releated||related 1074releated||related
1020relevent||relevant 1075relevent||relevant
1076reloade||reload
1021remoote||remote 1077remoote||remote
1022remore||remote 1078remore||remote
1023removeable||removable 1079removeable||removable
@@ -1036,19 +1092,23 @@ requried||required
1036requst||request 1092requst||request
1037reregisteration||reregistration 1093reregisteration||reregistration
1038reseting||resetting 1094reseting||resetting
1095reseved||reserved
1039reseverd||reserved 1096reseverd||reserved
1040resizeable||resizable 1097resizeable||resizable
1041resouce||resource 1098resouce||resource
1042resouces||resources 1099resouces||resources
1043resoures||resources 1100resoures||resources
1044responce||response 1101responce||response
1102resrouce||resource
1045ressizes||resizes 1103ressizes||resizes
1046ressource||resource 1104ressource||resource
1047ressources||resources 1105ressources||resources
1048restesting||retesting 1106restesting||retesting
1107resumbmitting||resubmitting
1049retransmited||retransmitted 1108retransmited||retransmitted
1050retreived||retrieved 1109retreived||retrieved
1051retreive||retrieve 1110retreive||retrieve
1111retreiving||retrieving
1052retrive||retrieve 1112retrive||retrieve
1053retuned||returned 1113retuned||returned
1054reudce||reduce 1114reudce||reduce
@@ -1120,6 +1180,7 @@ sleeped||slept
1120softwares||software 1180softwares||software
1121speach||speech 1181speach||speech
1122specfic||specific 1182specfic||specific
1183specfield||specified
1123speciefied||specified 1184speciefied||specified
1124specifc||specific 1185specifc||specific
1125specifed||specified 1186specifed||specified
@@ -1142,7 +1203,10 @@ staion||station
1142standardss||standards 1203standardss||standards
1143standartization||standardization 1204standartization||standardization
1144standart||standard 1205standart||standard
1206standy||standby
1207stardard||standard
1145staticly||statically 1208staticly||statically
1209statuss||status
1146stoped||stopped 1210stoped||stopped
1147stoping||stopping 1211stoping||stopping
1148stoppped||stopped 1212stoppped||stopped
@@ -1227,12 +1291,14 @@ tipically||typically
1227timeing||timing 1291timeing||timing
1228timout||timeout 1292timout||timeout
1229tmis||this 1293tmis||this
1294toogle||toggle
1230torerable||tolerable 1295torerable||tolerable
1231traking||tracking 1296traking||tracking
1232tramsmitted||transmitted 1297tramsmitted||transmitted
1233tramsmit||transmit 1298tramsmit||transmit
1234tranasction||transaction 1299tranasction||transaction
1235tranfer||transfer 1300tranfer||transfer
1301transcevier||transceiver
1236transciever||transceiver 1302transciever||transceiver
1237transferd||transferred 1303transferd||transferred
1238transfered||transferred 1304transfered||transferred
@@ -1267,6 +1333,7 @@ unfortunatelly||unfortunately
1267unifiy||unify 1333unifiy||unify
1268uniterrupted||uninterrupted 1334uniterrupted||uninterrupted
1269unintialized||uninitialized 1335unintialized||uninitialized
1336unitialized||uninitialized
1270unkmown||unknown 1337unkmown||unknown
1271unknonw||unknown 1338unknonw||unknown
1272unknow||unknown 1339unknow||unknown
@@ -1291,7 +1358,9 @@ unsuccessfull||unsuccessful
1291unsuported||unsupported 1358unsuported||unsupported
1292untill||until 1359untill||until
1293unuseful||useless 1360unuseful||useless
1361unvalid||invalid
1294upate||update 1362upate||update
1363upsupported||unsupported
1295usefule||useful 1364usefule||useful
1296usefull||useful 1365usefull||useful
1297usege||usage 1366usege||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 {
13 system("uname -a") 13 system("uname -a")
14 printf("\n") 14 printf("\n")
15 15
16 vernum = "[0-9]+([.]?[0-9]+)+"
17
16 printversion("GNU C", version("gcc -dumpversion")) 18 printversion("GNU C", version("gcc -dumpversion"))
17 printversion("GNU Make", version("make --version")) 19 printversion("GNU Make", version("make --version"))
18 printversion("Binutils", version("ld -v")) 20 printversion("Binutils", version("ld -v"))
@@ -34,7 +36,7 @@ BEGIN {
34 while (getline <"/proc/self/maps" > 0) { 36 while (getline <"/proc/self/maps" > 0) {
35 if (/libc.*\.so$/) { 37 if (/libc.*\.so$/) {
36 n = split($0, procmaps, "/") 38 n = split($0, procmaps, "/")
37 if (match(procmaps[n], /[0-9]+([.]?[0-9]+)+/)) { 39 if (match(procmaps[n], vernum)) {
38 ver = substr(procmaps[n], RSTART, RLENGTH) 40 ver = substr(procmaps[n], RSTART, RLENGTH)
39 printversion("Linux C Library", ver) 41 printversion("Linux C Library", ver)
40 break 42 break
@@ -70,7 +72,7 @@ BEGIN {
70function version(cmd, ver) { 72function version(cmd, ver) {
71 cmd = cmd " 2>&1" 73 cmd = cmd " 2>&1"
72 while (cmd | getline > 0) { 74 while (cmd | getline > 0) {
73 if (match($0, /[0-9]+([.]?[0-9]+)+/)) { 75 if (match($0, vernum)) {
74 ver = substr($0, RSTART, RLENGTH) 76 ver = substr($0, RSTART, RLENGTH)
75 break 77 break
76 } 78 }