summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorMichal Marek <mmarek@suse.com>2017-01-03 08:40:44 -0500
committerMichal Marek <mmarek@suse.com>2017-01-05 07:00:54 -0500
commitd920f7c6628c63a390009c237fb80a203c2e400a (patch)
tree439964a9707355942a7896255624f97739800075 /scripts
parent7ce7d89f48834cefece7804d38fc5d85382edf77 (diff)
genksyms: Fix segfault with invalid declarations
Do not try to recover too early and segfault when parsing invalid declarations such as echo 'int (int);' | scripts/genksyms/genksyms echo 'int a, (int);' | scripts/genksyms/genksyms echo 'extern void *__inline_memcpy((void *), (const void *), (__kernel_size_t));' | scripts/genksyms/genksyms The last one was a real-life bug with include/asm-generic/asm-prototypes.h on x86_64. Reported-and-tested-by: Borislav Petkov <bp@alien8.de> Signed-off-by: Michal Marek <mmarek@suse.com>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/genksyms/parse.y2
1 files changed, 0 insertions, 2 deletions
diff --git a/scripts/genksyms/parse.y b/scripts/genksyms/parse.y
index 4fba255e54ae..00a6d7e54971 100644
--- a/scripts/genksyms/parse.y
+++ b/scripts/genksyms/parse.y
@@ -322,8 +322,6 @@ direct_declarator:
322 { $$ = $2; } 322 { $$ = $2; }
323 | '(' declarator ')' 323 | '(' declarator ')'
324 { $$ = $3; } 324 { $$ = $3; }
325 | '(' error ')'
326 { $$ = $3; }
327 ; 325 ;
328 326
329/* Nested declarators differ from regular declarators in that they do 327/* Nested declarators differ from regular declarators in that they do