Description of problem: file(1) reports message "bad note name size 0x80000da4" while recognizing file format of some ELF 64bit files. Version-Release number of selected component (if applicable): file-4-17.8 How reproducible: Run file(1) on the attached file. Steps to Reproduce: 1. file 411toppm.debug Actual results: ELF 64-bit MSB executable, IBM S/390, version 1 (SYSV), bad note name size 0x80000da4, dynamically linked (uses shared libs), not stripped Expected results: ELF 64-bit MSB executable, IBM S/390, version 1 (SYSV), dynamically linked (uses shared libs), not stripped Additional info: Erratum 2006:0651.
Created attachment 137546 [details] Testing file.
File checks, if note name size is greater then 0x80000000 if it is, file complains. Do you have idea where to check whether note name size can be of such size?
The file is the stripped-into-separate-file debuginfo, in which sections that are present in the stripped file are made SHT_NOBITS and not present at all. So, file needs to check for SHT_NOBITS .note sections and don't look at them at all. Currently it just reads some completely unrelated data (probably part of one of the .debug_* sections).
*** Bug 207918 has been marked as a duplicate of this bug. ***
Created attachment 138685 [details] file-note-debuginfo.patch Proposed patch. While it would be possible to do what I proposed (i.e. for each PT_NOTE look up in section header table in which section the virtual address falls in and test if it is not SHT_NOBITS), this is far easier and faster and has a nice side-effect that it doesn't duplication information in file output. Unpatched file will e.g. say: file /bin/bash /bin/bash: ELF 64-bit LSB executable, AMD x86-64, version 1 (SYSV), for GNU/Linux 2.6.9, dynamically linked (uses shared libs), for GNU/Linux 2.6.9, stripped (note the .note.ABI-tag section being parsed and printed twice, once when found through PT_NOTE, once when found through SHT_NOTE). When the executable has a section header table, then it is safe to assume that either there will be a SHT_NOTE section corresponding to the PT_NOTE program header, or it will be SHT_NOBITS in a debuginfo file (at which point it is not present).
Thanks for patch. I'm sorry for delay in resolving this issue. This problem should be fixed in file-4.19-1.fc7.