libpq: Authorize pthread_exit() in libpq_check
authorMichael Paquier <[email protected]>
Wed, 10 Dec 2025 04:56:33 +0000 (13:56 +0900)
committerMichael Paquier <[email protected]>
Wed, 10 Dec 2025 04:56:33 +0000 (13:56 +0900)
pthread_exit() is added to the list of symbols allowed when building
libpq.  This has been reported as possible when libpq is statically
linked to libcrypto, where pthread_exit() could be called.

Reported-by: Torsten Rupp <[email protected]>
Author: Nazir Bilal Yavuz <[email protected]>
Reviewed-by: Daniel Gustafsson <[email protected]>
Reviewed-by: Michael Paquier <[email protected]>
Discussion: https://postgr.es/m/19095-6d8256d0c37d4be2@postgresql.org

src/interfaces/libpq/libpq_check.pl

index 835638cc5a24820e0b8a1cee1de31e1c2b4a67aa..dd03e6864fdb18667c02883c41a5dce9a888be77 100755 (executable)
@@ -63,6 +63,10 @@ while (<$fh>)
        # exit.
        next if /__tsan_func_exit/;
 
+       # Excluding pthread_exit allows legitimate thread terminations in some
+       # builds.
+       next if /pthread_exit/;
+
        # Anything containing "exit" is suspicious.
        # (Ideally we should reject abort() too, but there are various scenarios
        # where build toolchains insert abort() calls, e.g. to implement