oss-sec mailing list archives

Re: CVE-2023-31975: memory leak in yasm


From: Demi Marie Obenour <demi () invisiblethingslab com>
Date: Wed, 21 Jun 2023 17:54:57 -0400

On Thu, Jun 22, 2023 at 01:44:04AM +1000, Dave Horsfall wrote:
On Wed, 21 Jun 2023, Jeffrey Walton wrote:

Memory leaks on exit are par for the course in GNU software per
https://www.gnu.org/prep/standards/standards.html#Memory-Usage .

Don't bother with this, don't bother with that, etc...  Call me old-school 
(which I am), but I cannot abide sloppy programming[*].

Memory leaks on exit are a _good_ thing in general.  There is absolutely
zero point in calling free() if the program is about to exit — the OS
will do a better job of freeing resources than the program itself ever
could.  Furthermore, preventing all memory leaks may well require
freeing resources that are being used by other threads in the same
process, resulting in use-after-free!  Again, much better to just leak
the memory and let the OS deal with it.  One can provide a function to
clean up the resources in preparation for e.g. dlclose(), but it should
not be called automatically.
-- 
Sincerely,
Demi Marie Obenour (she/her/hers)
Invisible Things Lab

Attachment: signature.asc
Description:


Current thread: