linux-stable/scripts
Richard Yao 1c722503fa genksyms: Duplicate function pointer type definitions segfault
I noticed that genksyms will segfault when it sees duplicate function
pointer type declaration when I placed the same function pointer
definition in two separate headers in a local branch as an intermediate
step of some refactoring. This can be reproduced by piping the following
minimal test case into `genksyms -r /dev/null` or alternatively, putting
it into a C file attempting a build:

typedef int (*f)();
typedef int (*f)();

Attaching gdb to genksyms to understand this failure is useless without
changing CFLAGS to emit debuginfo. Once you have debuginfo, you will
find that the failure is that `char *s` was NULL and the program
executed `while(*s)`. At which point, further debugging requires
familiarity with compiler front end / parser development.

What happens is that flex identifies the first instance of the token "f"
as IDENT and the yacc parser adds it to the symbol table. On the second
instance, flex will identify "f" as TYPE, which triggers an error case
in the yacc parser. Given that TYPE would have been IDENT had it not
been in the symbol table, the the segmentaion fault could be avoided by
treating TYPE as IDENT in the affected rule.

Some might consider placing identical function pointer type declarations
in different headers to be poor style might consider a failure to be
beneficial. However, failing through a segmentation fault makes the
cause non-obvious and can waste the time of anyone who encounters it.

Signed-off-by: Richard Yao <richard.yao@clusterhq.com>
Acked-by: Madhuri Yechuri <madhuriyechuri@clusterhq.com>
Signed-off-by: Michal Marek <mmarek@suse.com>
2015-08-20 14:55:55 +02:00
..
basic
coccinelle scripts/coccinelle/misc/bugon.cocci: update bug_on conversion warning 2015-04-15 14:21:31 +02:00
dtc scripts/dtc: Update to upstream version 9d3649bd3be245c9 2015-04-29 17:17:27 -05:00
gdb scripts/gdb: remove useless global instruction 2015-06-30 19:44:58 -07:00
genksyms genksyms: Duplicate function pointer type definitions segfault 2015-08-20 14:55:55 +02:00
kconfig Merge branch 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild 2015-07-02 14:53:01 -07:00
ksymoops
mod Avoid conflict with host definitions when cross-compiling 2015-08-20 14:55:54 +02:00
package
rt-tester
selinux
tracing
.gitignore
analyze_suspend.py
asn1_compiler.c
bloat-o-meter
bootgraph.pl
check_extable.sh scripts: add check_extable.sh script. 2015-04-13 21:03:02 +09:30
checkincludes.pl
checkkconfigsymbols.py checkkconfigsymbols.py: set python2 as default interpreter 2015-05-24 12:15:29 -07:00
checkpatch.pl checkpatch: emit "NOTE: <types>" message only once after multiple files 2015-06-25 17:00:42 -07:00
checkstack.pl
checksyscalls.sh x86/asm/entry: Move the arch/x86/syscalls/ definitions to arch/x86/entry/syscalls/ 2015-06-04 07:37:37 +02:00
checkversion.pl
cleanfile
cleanpatch
coccicheck
config
conmakehash.c
decode_stacktrace.sh
decodecode
depmod.sh
diffconfig vfs,ext2: remove CONFIG_EXT2_FS_XIP and rename CONFIG_FS_XIP to CONFIG_FS_DAX 2015-02-16 17:56:04 -08:00
docproc.c
export_report.pl
extract-ikconfig scripts/extract-ikconfig: Support LZ4-compressed images. 2015-04-15 14:01:12 +02:00
extract-vmlinux
gcc-goto.sh
gcc-ld
gcc-version.sh
gcc-x86_32-has-stack-protector.sh
gcc-x86_64-has-stack-protector.sh
gen_initramfs_list.sh
get_maintainer.pl get_maintainer: fix perl 5.22/5.24 deprecated/incompatible "\C" use 2015-06-25 17:00:39 -07:00
gfp-translate
headerdep.pl
headers.sh
headers_check.pl
headers_install.sh
kallsyms.c Kbuild: kallsyms: drop special handling of pre-3.0 GCC symbols 2015-04-07 13:04:51 +02:00
Kbuild.include
kernel-doc
ld-version.sh
Lindent
link-vmlinux.sh scripts: link-vmlinux: Don't pass page offset to kallsyms if XIP Kernel 2015-05-21 19:17:44 +08:00
Makefile scripts/gdb: add infrastructure 2015-02-17 14:34:53 -08:00
Makefile.asm-generic
Makefile.build
Makefile.clean Merge branch 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild 2015-02-19 10:07:08 -08:00
Makefile.dtbinst kbuild: include $(src)/Makefile rather than $(obj)/Makefile 2015-04-02 16:42:08 +02:00
Makefile.extrawarn
Makefile.fwinst kbuild: include $(src)/Makefile rather than $(obj)/Makefile 2015-04-02 16:42:08 +02:00
Makefile.headersinst
Makefile.help
Makefile.host
Makefile.kasan kasan: Makefile: shut up warnings if CONFIG_COMPILE_TEST=y 2015-04-17 09:03:59 -04:00
Makefile.lib kbuild: Create directory for target DTB 2015-04-03 13:52:28 -07:00
Makefile.modbuiltin
Makefile.modinst
Makefile.modpost
Makefile.modsign
makelst
markup_oops.pl
mkcompile_h
mkmakefile
mksysmap mksysmap: Add h8300 local symbol pattern 2015-06-23 13:35:47 +09:00
mkuboot.sh
mkversion
module-common.lds kernel: add support for .init_array.* constructors 2015-02-13 21:21:42 -08:00
namespace.pl
objdiff
patch-kernel
pnmtologo.c
profile2linkerlist.pl
recordmcount.c
recordmcount.h
recordmcount.pl
setlocalversion
show_delta
sign-file
sortextable.c ARCv2: extable: Enable sorting at build time 2015-06-22 14:06:56 +05:30
sortextable.h
spelling.txt checkpatch: spell check reudce 2015-04-17 09:03:56 -04:00
tags.sh init: delete the __cpuinit related stubs 2015-06-16 14:12:23 -04:00
unifdef.c
ver_linux
xen-hypercalls.sh xen: build infrastructure for generating hypercall depending symbols 2015-03-16 14:49:13 +00:00
xz_wrap.sh