Bug 1110598

Summary: kernel-3.16 breaks gdb vdso debugging
Product: [Fedora] Fedora Reporter: Andy Lutomirski <luto>
Component: binutilsAssignee: Nick Clifton <nickc>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: jakub, nickc
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-07-09 01:14:26 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Andy Lutomirski 2014-06-18 04:19:29 UTC
For Linux 3.16, the vdso is heavily stripped.  Specifically, on x86_64, there's a fake section table that contains only one entry of type SHT_DYNSYM (to work around a Go bug).  On i386 and x32, there is no section table at all.  For now, e_shstrndx == 0.

This ought to be fine: things that read ELF files from memory have no business looking at the section table at all.  Unfortunately, symbol_file_add_from_memory (which is the function responsible for digging up the vdso symbols) doesn't ever call any of the section_from_phdr functions, which means that it doesn't try to load the segment table, and it never notices the PT_NOTE segment.  That, in turn, prevents it from detecting the build-id and finding the real symbol file.

I'd be happy to help (a bit) and to make hopefully minimal changes to the kernel to make this better.

I have a prototype patch to add a more complete fake section table, and it works, but this approach sucks.  Not only is it a lie, but it wastes a bunch of space in the vdso image in memory.

Comment 1 Andy Lutomirski 2014-06-18 04:42:07 UTC
Upstream bug here: https://sourceware.org/bugzilla/show_bug.cgi?id=17064

Comment 2 Andy Lutomirski 2014-07-09 01:14:26 UTC
Closing for now -- the relevant kernel change was mostly reverted.