[16974] in Kerberos-V5-bugs

home help back first fref pref prev next nref lref last post

[krbdev.mit.edu #9139] git commit

daemon@ATHENA.MIT.EDU (Greg Hudson via RT)
Wed Sep 11 17:04:03 2024

From: "Greg Hudson via RT" <rt-comment@krbdev.mit.edu>
In-Reply-To: 
Message-ID: <rt-4.4.3-2-3015379-1726088635-1772.9139-4-0@mit.edu>
To: "AdminCc of krbdev.mit.edu Ticket #9139":;
Date: Wed, 11 Sep 2024 17:03:55 -0400
MIME-Version: 1.0
Reply-To: rt-comment@krbdev.mit.edu
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: krb5-bugs-bounces@mit.edu


Wed Sep 11 17:03:55 2024: Request 9139 was acted upon.
 Transaction: Ticket created by ghudson@mit.edu
       Queue: krb5
     Subject: git commit
       Owner: ghudson@mit.edu
  Requestors: 
      Status: new
 Ticket <URL: https://krbdev.mit.edu/rt/Ticket/Display.html?id=9139 >



Block library unloading to avoid finalizer races

Library finalizers can run due to the library being unloaded or the
process exiting.  If the library is being unloaded, global memory
resources must be released to avoid memory leaks.  But if the process
is exiting, releasing memory resources can lead to race conditions if
another thread invokes functions from the library during or after
finalizer execution.  Most commonly this manifests as an assertion
error about trying to lock a destroyed mutex.

We can block unloading of our library on ELF platforms by passing "-z
nodelete" to the linker.  Add a shell variable "lib_unload_prevented"
to the shlib.conf outputs, set it on platforms where we can block
unloading, and suppress finalizers when it is set.

On Windows we can detect if the process is exiting by checking for a
non-null lpvReserved argument in DllMain().  Do not execute finalizers
when the process is executing.

https://github.com/krb5/krb5/commit/1bfcf572241a4ec0e44e609e5c6b7c0b11b08eea
Author: Greg Hudson <ghudson@mit.edu>
Commit: 1bfcf572241a4ec0e44e609e5c6b7c0b11b08eea
Branch: master
 src/aclocal.m4            |  3 +++
 src/config/shlib.conf     | 34 +++++++++++++++++++++++-----------
 src/include/k5-platform.h |  5 ++++-
 src/lib/win_glue.c        |  6 +++++-
 4 files changed, 35 insertions(+), 13 deletions(-)

_______________________________________________
krb5-bugs mailing list
krb5-bugs@mit.edu
https://mailman.mit.edu/mailman/listinfo/krb5-bugs

home help back first fref pref prev next nref lref last post