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

Tatsuo Ishii ishii at sraoss.co.jp
Mon Mar 18 10:58:56 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
------
master

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

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   | 42 ++++++++++++++++++++++
3 files changed, 63 insertions(+)



More information about the pgpool-committers mailing list