<div dir="ltr">Hey,<div><br></div><div>We would like to propose an idea that would help security harden applications that define custom sections.</div><div><div><br></div><div>Motivation and Background</div><div>In Chromium we have a garbage collector that implements some RTTI machinery in the form of a table. This table is used by the collector to trace and finalize garbage collected objects. We're thinking of using __attribute__((section(...))) so that the table can be created and merged at link time. We also use -fPIC and therefore rely on the dynamic linker to process relocations in this table after the program is loaded. At the same time, we want the table to be read-only after relocations are applied, in the same fashion as e.g. .got sections are write protected after eager binding (with -z,relro,-z,now). The custom section can't be mprotected, because it can live in the same PT_LOAD segment as other modifiable data (e.g. .data).</div><div><br></div><div>At the moment, all big 3 ELF linkers hardcode names of read-only-after-relocation sections (.<a href="http://data.rel.ro">data.rel.ro</a>, .<a href="http://bss.rel.ro">bss.rel.ro</a>, .ctors, .eh_frame, ...). We would like to propose extending this for custom sections that end with ".<a href="http://rel.ro">rel.ro</a>".</div><div><br></div><div>What do you think? Would this be useful to you?</div><div><br></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div><div>Sincerely,<br></div>Anton.<br></div></div></div></div></div></div>