hardening-no-relro Warnung

Für alles, was in den übrigen Lazarusthemen keinen Platz, aber mit Lazarus zutun hat.
Antworten
Benutzeravatar
m.fuchs
Lazarusforum e. V.
Beiträge: 2636
Registriert: Fr 22. Sep 2006, 19:32
OS, Lazarus, FPC: Winux (Lazarus 2.0.10, FPC 3.2.0)
CPU-Target: x86, x64, arm
Wohnort: Berlin
Kontaktdaten:

hardening-no-relro Warnung

Beitrag von m.fuchs »

Hallo,

ich versuche gerade ein deb-Paket für eine Software die mit Lazarus entwickelt wird zu bauen. Klappt auch alles soweit ganz gut nur bekomme ich eine Warnung von Lintian:

Code: Alles auswählen

W: executable: hardening-no-relro usr/bin/executable


Die Beschreibung auf der Lintian-Seite sagt mir:
This package provides an ELF binary that lacks the "read-only relocation" link flag. This package was likely not built with the default Debian compiler flags defined by dpkg-buildflags. If built using dpkg-buildflags directly, be sure to import LDFLAGS.


Leider kenne ich mich mit der Thematik überhaupt nicht aus und habe keinerlei Ansatz, was ich tun müsste. Hat irgendjemand Erfahrung mit dem Thema oder kann mir noch ein gutes Stichwort nennen, mit dem ich Hilfe finden könnte?
Software, Bibliotheken, Vorträge und mehr: https://www.ypa-software.de

Benutzeravatar
m.fuchs
Lazarusforum e. V.
Beiträge: 2636
Registriert: Fr 22. Sep 2006, 19:32
OS, Lazarus, FPC: Winux (Lazarus 2.0.10, FPC 3.2.0)
CPU-Target: x86, x64, arm
Wohnort: Berlin
Kontaktdaten:

Re: hardening-no-relro Warnung

Beitrag von m.fuchs »

Ich mache jetzt mal die Ingrid, nachdem mich ein Bekannter auf eine Idee gebracht hat. In Projekteinstellungen => Compilereinstellungen => Kompilieren und Linken gibt es das Feld Linker zusätzliche Einstellungen übergeben. Hier einfach

Code: Alles auswählen

-z relro

eintragen und das entsprechende Link-Flag wird benutzt. Danach ist auch Lintian zufrieden mit der Binary.
Software, Bibliotheken, Vorträge und mehr: https://www.ypa-software.de

Benutzeravatar
af0815
Lazarusforum e. V.
Beiträge: 6198
Registriert: So 7. Jan 2007, 10:20
OS, Lazarus, FPC: FPC fixes Lazarus fixes per fpcupdeluxe (win,linux,raspi)
CPU-Target: 32Bit (64Bit)
Wohnort: Burgenland
Kontaktdaten:

Re: hardening-no-relro Warnung

Beitrag von af0815 »

Ein par Infos dazu gibts schon
https://fedorahosted.org/fesco/ticket/563 und die Erlärung dort ist nachvollziehbar

Code: Alles auswählen

RELRO causes the jump tables and relocation addresses to become readonly.


Code: Alles auswählen

Flags passed to the linker
 
-Wl,-z,relro
First enabled in Ubuntu 8.10. Provides a read-only relocation table area in the final ELF. This option paves the way for using -z now which forces all relocations to be resolved at run-time (which would cause some additional initial load delay), providing an even higher level of protection to the relocation table -- it could then be entirely read-only which can be used to further harden long-running programs like daemons.
 
No known failure examples.
 
Disabled with -Wl,-z,norelro in LDFLAGS.
Blöd kann man ruhig sein, nur zu Helfen muss man sich wissen (oder nachsehen in LazInfos/LazSnippets).

Antworten