[pgpool-committers: 7047] pgpool: Fix sefault in pgpool child process in certain case.
Tatsuo Ishii
ishii at sraoss.co.jp
Fri Aug 21 20:14:31 JST 2020
Fix sefault in pgpool child process in certain case.
When all backend go down, pgpool refuses to accept connection from
clients and try to send a message in
validate_backend_connectivity(). For this purpose it connects to the
client and try to read the startup packet. This is done in a PG_TRY
block. The startup packet is read in memory pointed to by "sp", which
is declared as "StartupPacket *volatile". This is fine. But it was
forgotten to initialize the value with NULL. As a result, if reading
startup packet fails, sp would be garbage a pointer and segfaults later
in pool_free_startup_packet(sp).
Fix is, initialize "sp" with NULL.
I have found this accidentally in following way:
1) shutdown all backends.
2) connect to pgpool with invalid client. I have used pcp_attach_node
with pgpool's port number, not pcp's.
Branch
------
V4_1_STABLE
Details
-------
https://git.postgresql.org/gitweb?p=pgpool2.git;a=commitdiff;h=2f141610ba5fe4e2411c43c3f2821f02ba3514d9
Modified Files
--------------
src/protocol/child.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
More information about the pgpool-committers
mailing list