Skip to content

Commit

Permalink
genksyms: Fix segfault with invalid declarations
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Michal Marek <[email protected]>
  • Loading branch information
Michal Marek committed Jan 5, 2017
1 parent 7ce7d89 commit d920f7c
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions scripts/genksyms/parse.y
Original file line number Diff line number Diff line change
Expand Up @@ -322,8 +322,6 @@ direct_declarator:
{ $$ = $2; }
| '(' declarator ')'
{ $$ = $3; }
| '(' error ')'
{ $$ = $3; }
;

/* Nested declarators differ from regular declarators in that they do
Expand Down

0 comments on commit d920f7c

Please sign in to comment.