[PATCH] elf: Add GNU_PROPERTY_NO_MEMORY_SEAL gnu property
Florian Weimer
fweimer@redhat.com
Wed Jul 31 20:33:33 GMT 2024
* Adhemerval Zanella:
> On a glibc recent proposal [1] to add Linux mseal support [2],
> Mike Hommey raised that this feature might potentially break Firefox
> on Linux. The issue is Firefox is built with DT_RELR support, and
> post-processed with a tool to both remove the GLIBC_ABI_DT_RELR
> dependency and instrument the binaries to apply the relocation
> themselves so they can deploy Firefox regardless if loader supports
> DT_RELR or not (some more details at [3]).
>
> To accomplish it, the instrumentation mimics the
> dynamic loader and temporarily undoes the RELRO machine to be
> able to apply those relocations, and redoes it afterward. And this
> is exactly what mseal aims to prevent.
>
> The GNU_PROPERTY_NO_MEMORY_SEAL gnu property is a way to mark such
> objects are not sealed by glibc. When linked with
> -Wl,-z,no-memory-seal, glibc will not seal either the binary or
> the shared library (the sealing will still be done by default, if
> the kernel supports it). The version 2 of glibc support for memory
> sealing uses this new property [5].
Wouldn't it be easier to add a new flag in DT_GNU_FLAGS_1 (similar to
allocated, but not yet used in glibc DF_GNU_1_UNIQUE)? This mechanism
seems to be rather heavyweight.
Thanks,
Florian
More information about the Binutils
mailing list