pg.ddx.io  pgbouncer/pgbouncer GitHub issues and pull requests  
help / color / mirror / Atom feed
From: eulerto (@eulerto) <noreply+eulerto@github.com>
To: pgbouncer/pgbouncer <noreply+pgbouncer-pgbouncer@github.com>
Subject: Re: [pgbouncer/pgbouncer] issue #1697: Sporadic segfault on SIGHUP
Date: Thu, 05 Nov 2026 00:45:34 +0000
Message-ID: <gh-pgbouncer-pgbouncer-1697-c6646401120@github.com> (raw)
In-Reply-To: <gh-pgbouncer-pgbouncer-1697@github.com>
References: <gh-pgbouncer-pgbouncer-1697@github.com>

@twoinke Thanks for your report.

```
#1 0x00007b4f527448e3 in __GI___inet_pton (af=af@entry=2, src=src@entry=0x0, dst=dst@entry=0x7fff3b81e610) at ./resolv/inet_pton.c:69
#2 0x00005826b4945a08 in tls_check_subject_altname (name=0x0, cert=0x5826cb96f8f0, ctx=0x5826c99b7ca0) at lib/usual/tls/tls_verify.c:96
#3 tls_check_name (ctx=ctx@entry=0x5826c99b7ca0, cert=cert@entry=0x5826cb96f8f0, name=0x0) at lib/usual/tls/tls_verify.c:248
```

It is an use-after-free. The 2nd argument (`name`) for `inet_pton()` is NULL; it
means undefined behavior (on glibc it crashes with a NULL dereference). The
`tls_check_name()` or `tls_check_subject_altname()` would prevent assigning NULL to
`name`. This is the last line of defense; it is not a proper fix.

There is a race condition between an in-flight TLS handshake (that holds a
pointer to the server TLS configuration -- `server_connect_conf`) and a SIGHUP
(reload) that frees the server TLS configuration underneath.

view thread (6+ messages)  latest in thread

Message-ID: <gh-pgbouncer-pgbouncer-1697-c6646401120@github.com>
Permalink:  ../gh-pgbouncer-pgbouncer-1697-c6646401120@github.com/

 · 


This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox