diff options
Diffstat (limited to 'scripts/headers_install.sh')
-rwxr-xr-x | scripts/headers_install.sh | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/scripts/headers_install.sh b/scripts/headers_install.sh index bbaf29386995..a07668a5c36b 100755 --- a/scripts/headers_install.sh +++ b/scripts/headers_install.sh | |||
@@ -41,5 +41,77 @@ sed -E -e ' | |||
41 | scripts/unifdef -U__KERNEL__ -D__EXPORTED_HEADERS__ $TMPFILE > $OUTFILE | 41 | scripts/unifdef -U__KERNEL__ -D__EXPORTED_HEADERS__ $TMPFILE > $OUTFILE |
42 | [ $? -gt 1 ] && exit 1 | 42 | [ $? -gt 1 ] && exit 1 |
43 | 43 | ||
44 | # Remove /* ... */ style comments, and find CONFIG_ references in code | ||
45 | configs=$(sed -e ' | ||
46 | :comment | ||
47 | s:/\*[^*][^*]*:/*: | ||
48 | s:/\*\*\**\([^/]\):/*\1: | ||
49 | t comment | ||
50 | s:/\*\*/: : | ||
51 | t comment | ||
52 | /\/\*/! b check | ||
53 | N | ||
54 | b comment | ||
55 | |||
56 | P | ||
57 | D | ||
58 | :check | ||
59 | s:^\(CONFIG_[[:alnum:]_]*\):\1\n: | ||
60 | t print | ||
61 | s:^[[:alnum:]_][[:alnum:]_]*:: | ||
62 | s:^[^[:alnum:]_][^[:alnum:]_]*:: | ||
63 | t check | ||
64 | d | ||
65 | ' $OUTFILE) | ||
66 | |||
67 | # The entries in the following list are not warned. | ||
68 | # Please do not add a new entry. This list is only for existing ones. | ||
69 | # The list will be reduced gradually, and deleted eventually. (hopefully) | ||
70 | # | ||
71 | # The format is <file-name>:<CONFIG-option> in each line. | ||
72 | config_leak_ignores=" | ||
73 | arch/alpha/include/uapi/asm/setup.h:CONFIG_ALPHA_LEGACY_START_ADDRESS | ||
74 | arch/arc/include/uapi/asm/page.h:CONFIG_ARC_PAGE_SIZE_16K | ||
75 | arch/arc/include/uapi/asm/page.h:CONFIG_ARC_PAGE_SIZE_4K | ||
76 | arch/arc/include/uapi/asm/swab.h:CONFIG_ARC_HAS_SWAPE | ||
77 | arch/arm/include/uapi/asm/ptrace.h:CONFIG_CPU_ENDIAN_BE8 | ||
78 | arch/hexagon/include/uapi/asm/ptrace.h:CONFIG_HEXAGON_ARCH_VERSION | ||
79 | arch/hexagon/include/uapi/asm/user.h:CONFIG_HEXAGON_ARCH_VERSION | ||
80 | arch/ia64/include/uapi/asm/cmpxchg.h:CONFIG_IA64_DEBUG_CMPXCHG | ||
81 | arch/m68k/include/uapi/asm/ptrace.h:CONFIG_COLDFIRE | ||
82 | arch/nios2/include/uapi/asm/swab.h:CONFIG_NIOS2_CI_SWAB_NO | ||
83 | arch/nios2/include/uapi/asm/swab.h:CONFIG_NIOS2_CI_SWAB_SUPPORT | ||
84 | arch/sh/include/uapi/asm/ptrace.h:CONFIG_CPU_SH5 | ||
85 | arch/sh/include/uapi/asm/sigcontext.h:CONFIG_CPU_SH5 | ||
86 | arch/sh/include/uapi/asm/stat.h:CONFIG_CPU_SH5 | ||
87 | arch/x86/include/uapi/asm/auxvec.h:CONFIG_IA32_EMULATION | ||
88 | arch/x86/include/uapi/asm/auxvec.h:CONFIG_X86_64 | ||
89 | arch/x86/include/uapi/asm/mman.h:CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS | ||
90 | include/uapi/asm-generic/fcntl.h:CONFIG_64BIT | ||
91 | include/uapi/linux/atmdev.h:CONFIG_COMPAT | ||
92 | include/uapi/linux/elfcore.h:CONFIG_BINFMT_ELF_FDPIC | ||
93 | include/uapi/linux/eventpoll.h:CONFIG_PM_SLEEP | ||
94 | include/uapi/linux/hw_breakpoint.h:CONFIG_HAVE_MIXED_BREAKPOINTS_REGS | ||
95 | include/uapi/linux/pktcdvd.h:CONFIG_CDROM_PKTCDVD_WCACHE | ||
96 | include/uapi/linux/raw.h:CONFIG_MAX_RAW_DEVS | ||
97 | " | ||
98 | |||
99 | for c in $configs | ||
100 | do | ||
101 | warn=1 | ||
102 | |||
103 | for ignore in $config_leak_ignores | ||
104 | do | ||
105 | if echo "$INFILE:$c" | grep -q "$ignore$"; then | ||
106 | warn= | ||
107 | break | ||
108 | fi | ||
109 | done | ||
110 | |||
111 | if [ "$warn" = 1 ]; then | ||
112 | echo "warning: $INFILE: leak $c to user-space" >&2 | ||
113 | fi | ||
114 | done | ||
115 | |||
44 | rm -f $TMPFILE | 116 | rm -f $TMPFILE |
45 | trap - EXIT | 117 | trap - EXIT |