[pgpool-committers: 9780] pgpool: Guard against inappropriate protocol data.

Tatsuo Ishii ishii at sraoss.co.jp
Mon Mar 18 13:56:00 JST 2024


Guard against inappropriate protocol data.

If a simple query message arrives before a sequence of extended query
messages ends (that is, no sync message arrives or some ready for
query messages corresponding the sync message do not arrive yet),
pgpool could hang.  This is because the query context in the session
context for the simple query is overwritten by the query contexts of
the extended query messages.

This commit implements a guard in SimpleQuery() by checking whether
extended query protocol messages ended. If they do not end, raise a
FATAL error. A known example detected by this checking is JDBC
driver's "autosave=always" option. This means pgpool will not accept
the option after this commit until the issue (sending a simple
protocol message before ending extended query message protocol) is
fixed by the JDBC driver side.

Discussion:
[pgpool-hackers: 4427] Guard against ill mannered frontend
https://www.pgpool.net/pipermail/pgpool-hackers/2024-February/004428.html

Branch
------
V4_2_STABLE

Details
-------
https://git.postgresql.org/gitweb?p=pgpool2.git;a=commitdiff;h=9d6561afa78c3666cac149590799f59211694ea7

Modified Files
--------------
src/protocol/pool_proto_modules.c                  | 14 +++++++
.../082.guard_against_bad_protocol/pgproto.data    |  7 ++++
.../tests/082.guard_against_bad_protocol/test.sh   | 43 ++++++++++++++++++++++
3 files changed, 64 insertions(+)



More information about the pgpool-committers mailing list