[PATCH] debug: Reject %n format strings in RELRO of static main program (bug 33183)

Florian Weimer fweimer@redhat.com
Thu Jul 24 14:34:26 GMT 2025


* Adhemerval Zanella Netto:

>> Is this correct? Because if PT_GNU_RELRO exists, either it will be applied
>> or the process status will be aborted (_dl_protect_relro).  The check_relro
>> already returns dl_readonly_area_writable on hppa (where relro is not
>> applied), so I am not sure about adding this snipped for static only.
>
> I think the correct fix is indeed make the test rely on PT_GNU_RELRO,
> it is supported on all architectures even though not default.

You are right.  I forgot about this commit of yours:

commit 57013650f7e796428ac2c0b7512757e99327bfc9
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Fri Nov 29 10:26:30 2019 -0300

    elf: Enable relro for static build

So think Dave's original patch was actually a valid fix for this.

Thanks,
Florian



More information about the Libc-alpha mailing list