Bug 23144 - strip-new/objcopy: SIGSEGV in group_signature
Summary: strip-new/objcopy: SIGSEGV in group_signature
Status: RESOLVED DUPLICATE of bug 23142
Alias: None
Product: binutils
Classification: Unclassified
Component: binutils (show other bugs)
Version: 2.31
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-05-04 23:59 UTC by Paolo Montesel
Modified: 2018-05-08 04:03 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments
crash (695 bytes, application/x-executable)
2018-05-04 23:59 UTC, Paolo Montesel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Paolo Montesel 2018-05-04 23:59:23 UTC
Created attachment 10996 [details]
crash

As part of a tool I'm writing I fuzzed binutils. The attached file makes strip-new/objcopy crash inside `group_signature`:

Program received signal SIGSEGV, Segmentation fault.
0x00000000004063f6 in group_signature (group=0x72d950, group=0x72d950) at objcopy.c:1222
1222            return isympp[ghdr->sh_info - 1];
#0  0x00000000004063f6 in group_signature (group=0x72d950, group=0x72d950) at objcopy.c:1222
#1  0x000000000040684f in is_strip_section (sec=sec@entry=0x72d950, abfd=0x72bf40) at objcopy.c:1350
#2  0x000000000040690f in setup_section (ibfd=0x72bf40, isection=0x72d950, obfdarg=0x72f2e0) at objcopy.c:3677
#3  0x000000000042602c in bfd_map_over_sections (abfd=abfd@entry=0x72bf40, operation=operation@entry=0x4068f0 <setup_section>, user_storage=user_storage@entry=0x72f2e0) at section.c:1391
#4  0x00000000004079ea in copy_object (ibfd=0x72bf40, obfd=0x72f2e0, input_arch=<optimized out>) at objcopy.c:2627
#5  0x000000000040a5aa in copy_file (input_filename=0x7fffffffe136 "id:000012,sig:1"..., output_filename=output_filename@entry=0x7fffffffe164 "/dev/null", input_target=input_target@entry=0x0, output_target=<optimized out>, output_target@entry=0x0, input_arch=input_arch@entry=0x0) at objcopy.c:3532
#6  0x0000000000404929 in strip_main (argv=<optimized out>, argc=<optimized out>) at objcopy.c:4476
#7  main (argc=argc@entry=4, argv=argv@entry=0x7fffffffdd78) at objcopy.c:5586
#8  0x00007ffff7829830 in __libc_start_main (main=0x402e10 <main>, argc=4, argv=0x7fffffffdd78, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffdd68) at ../csu/libc-start.c:291
#9  0x0000000000405539 in _start ()

Compiled and tried against a freshly cloned repo. It also works on Ubuntu Xenial's binutils (2.26.1).
Comment 1 Alan Modra 2018-05-08 04:03:59 UTC
Doesn't crash for me after applying 23142 fix.

*** This bug has been marked as a duplicate of bug 23142 ***