Bug 1574923
Summary: | annobin: Confusing interspersed file-name symbols in .text section | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Florian Weimer <fweimer> |
Component: | annobin | Assignee: | Nick Clifton <nickc> |
Status: | CLOSED EOL | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | 28 | CC: | fweimer, nickc |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | annobin-5.8-1.fc29 | Doc Type: | No Doc Update |
Doc Text: |
undefined
|
Story Points: | --- |
Clone Of: | Environment: | ||
Last Closed: | 2019-05-28 21:50:02 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
Florian Weimer
2018-05-04 11:17:57 UTC
We also have this: 0000000000401c71 <static_reloc.c_end>: 401c71: 66 data16 0000000000401c72 <static_reloc.c>: 401c72: 2e 0f 1f 84 00 00 00 nopl %cs:0x0(%rax,%rax,1) 401c79: 00 00 401c7b: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1) This confuses eu-checksec: Hardened: eu-checksec: GAP detected in annobin notes: 401c72 .. 401d30. Hi Florian, > Linking a program against a glibc which has been built with full annobin > support results in this statically linked bits being copied over: > > 00000000004052c0 <__libc_csu_init>: > 4052c0: 41 57 push %r15 > > 00000000004052c2 <elf_init.c>: > 4052c2: 49 89 d7 mov %rdx,%r15 > The elf_init.c symbol looks very much out of place. This happens because annobin now creates a start-of-file symbol that is actually two bytes in from the start of the file. This is on the assumption that this offset will prevent the symbol from overlapping the function symbol for the first function in the file, and so stop the problems associated with having two symbols for the same address. Is the presence of this symbol merely an inconvenience, or is it actually breaking something ? Apart from the disassembler output that is, which I agree is wrong. One thing I could try is to move the annobin file start symbol two bytes prior to the start of the file... Although this might cause problems with the end of the disassembly of the code that is prior to elf_init.c in the application's address space. :-( (In reply to Florian Weimer from comment #1) > We also have this: > > 0000000000401c71 <static_reloc.c_end>: > 401c71: 66 data16 > > 0000000000401c72 <static_reloc.c>: > 401c72: 2e 0f 1f 84 00 00 00 nopl %cs:0x0(%rax,%rax,1) Hang on - how did the end-of-file symbol end up being before the start-of-file symbol ? > This confuses eu-checksec: Well yes, I am confused too. Is there something funky going on in the source for static_reloc.c ? Some section pushing and popping maybe ? Cheers Nick (In reply to Nick Clifton from comment #2) > (In reply to Florian Weimer from comment #1) > > We also have this: > > > > 0000000000401c71 <static_reloc.c_end>: > > 401c71: 66 data16 > > > > 0000000000401c72 <static_reloc.c>: > > 401c72: 2e 0f 1f 84 00 00 00 nopl %cs:0x0(%rax,%rax,1) > > Hang on - how did the end-of-file symbol end up being before the > start-of-file symbol ? I think it's because the end symbol is not biased, only the start symbol. The biasing looks wrong to me because it makes the covered PC range incorrect. > Well yes, I am confused too. Is there something funky going on in the > source for static_reloc.c ? Some section pushing and popping maybe ? Not really, as far as I can see, it is just an empty file, or maybe it contains a single empty function (not sure about the compiler flags here). I can reproduce it with small input files: 38: 00000000004004e3 0 NOTYPE LOCAL DEFAULT 12 m.c 39: 00000000004004e1 0 NOTYPE LOCAL DEFAULT 12 m.c_end $ cat m.c main() { } That's wrong on a different level because the main function is *outside* this range: 77: 00000000004003e0 3 FUNC GLOBAL DEFAULT 12 main > Is the presence of this symbol merely an inconvenience, or is it actually > breaking something ? Apart from the disassembler output that is, which I > agree is wrong. It's worse if the symbol is in the middle of the instruction because it can happen that this corrupts the disassembler output. I have added a patch to the rawhide annobin which appears to resolve this problem. (By making the annobin file symbol hidden). I would like to leave it a few days however before backporting to F28, just to make sure that it really does work, and that it does not break anything. Fixed in: annobin-5.8-1.fc29 This message is a reminder that Fedora 28 is nearing its end of life. On 2019-May-28 Fedora will stop maintaining and issuing updates for Fedora 28. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a Fedora 'version' of '28'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 28 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete. This message is a reminder that Fedora 28 is nearing its end of life. On 2019-May-28 Fedora will stop maintaining and issuing updates for Fedora 28. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a Fedora 'version' of '28'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 28 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete. Fedora 28 changed to end-of-life (EOL) status on 2019-05-28. Fedora 28 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of Fedora please feel free to reopen this bug against that version. If you are unable to reopen this bug, please file a new report against the current release. If you experience problems, please add a comment to this bug. Thank you for reporting this bug and we are sorry it could not be fixed. |