| From: | Taiki Koshino <koshino(at)sraoss(dot)co(dot)jp> |
|---|---|
| To: | pgpool-committers(at)lists(dot)postgresql(dot)org |
| Subject: | pgpool: Fix operator precedence in parse_wd_node_function_json NodeIdLi |
| Date: | 2026-09-29 04:44:17 |
| Message-ID: | E1xBPhR-00000002h2D-10gZ@gothos.postgresql.org |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgpool-committers |
Fix operator precedence in parse_wd_node_function_json NodeIdList write.
In src/watchdog/wd_json_data.c parse_wd_node_function_json(), the loop
body wrote
*node_id_set[i] = value->u.array.values[i]->u.integer;
which by C precedence parses as *(node_id_set[i]). node_id_set is an
int ** that aliases the caller's &node_id_list pointer. For i == 0 the
write happens to land on the palloc'd destination buffer; for i >= 1 the
indexing walks sizeof(int*) * i bytes past the int ** parameter into
adjacent memory, dereferences the resulting garbage pointer, and stores
a peer-controlled 32-bit integer there.
Add the missing parentheses so the subscript applies to the dereferenced
array: (*node_id_set)[i] = ...
This is almost certainly the original intent - the single-node
failover path (the common production case) hits only i == 0 and so the
bug has not been observed in normal operation. Any NodeIdList of length
two or more immediately fires the misbehaviour.
Reported-by: Emond Papegaaij <emond(dot)papegaaij(at)topicus(dot)nl>
Reported-by: Claude
Author: Bo Peng <pengbo(at)sraoss(dot)co(dot)jp>
CVE-2026-92867
Backpatch-through: v4.3
Branch
------
V4_3_STABLE
Details
-------
https://git.postgresql.org/gitweb?p=pgpool2.git;a=commitdiff;h=3d956ecd7d5823464adcee386971ff0e51c5f8f0
Modified Files
--------------
src/watchdog/wd_json_data.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Taiki Koshino | 2026-09-29 04:47:05 | pgpool: Bound wd_nodes JSON array parsing in get_pool_config_from_json. |
| Previous Message | Taiki Koshino | 2026-09-29 04:43:57 | pgpool: Fix operator precedence in parse_wd_node_function_json NodeIdLi |