libpq: Authorize pthread_exit() in libpq_check
authorMichael Paquier <michael@paquier.xyz>
Wed, 10 Dec 2025 04:56:33 +0000 (13:56 +0900)
committerMichael Paquier <michael@paquier.xyz>
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 <torsten.rupp@gmx.net>
Author: Nazir Bilal Yavuz <byavuz81@gmail.com>
Reviewed-by: Daniel Gustafsson <daniel@yesql.se>
Reviewed-by: Michael Paquier <michael@paquier.xyz>
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