|
|
Log in / Subscribe / Register

More hygienic linking

More hygienic linking

Posted Mar 30, 2024 16:48 UTC (Sat) by smurf (subscriber, #17840)
In reply to: More hygienic linking by epa
Parent article: A backdoor in xz

When you load a library, its .init section gets executed. Likewise .fini when the library is unloaded / program ends regularly.

(Disclaimer: the actual details are a bit more hairy than that.)

The code in that section is typically used to set up variables and global objects and whatnot, but it can and in this case indeed does do whatever it damn well pleases. Restricting that capability is … difficult.


to post comments

More hygienic linking

Posted Mar 30, 2024 17:02 UTC (Sat) by epa (subscriber, #39769) [Link]

Right. Libraries would have to be written in a restricted style where there isn’t global data to initialize, and if there’s some kind of setup work that must be done by an explicit call from the application code. Which I suggest is all good practice anyway. But likely to meet pushback from those who don’t see a need to change.


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds