pg.ddx.io  pgpool-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgpool: Fix lifecheck buffer overrun.
6+ messages / 1 participants
[nested] [flat]

* pgpool: Fix lifecheck buffer overrun.
@ 2026-10-01 11:16 Tatsuo Ishii <ishii@postgresql.org>
  0 siblings, 0 replies; 6+ messages in thread

From: Tatsuo Ishii @ 2026-10-01 11:16 UTC (permalink / raw)
  To: pgpool-committers@lists.postgresql.org

Fix lifecheck buffer overrun.

load_watchdog_nodes_from_json() in wd_lifecheck.c used strcpy() to
copy WDNodeInfo.stateName to lifeCheckNode.stateName.  As the size of
WDNodeInfo.stateName is WD_MAX_HOST_NAMELEN (254), while the size of
lifeCheckNode.stateName was 128, theoretically it was possible for the
strcpy() to overrun lifeCheckNode.stateName. Fortunately strings used
for WDNodeInfo.stateName are predefined as global variable
(wd_state_names in watchdog.c), and never exceeds 128 bytes at this
point. But bug is a bug.

To fix this, change the size of LifeCheckNode.stateName from 128 to
WD_MAX_HOST_NAMELEN, which aligns with WDNodeInfo.stateName.

In passing following changes are made:

- Eliminate use of strcpy() in load_watchdog_nodes_from_json(),
  instead use strlcpy().

- Fix the size of WDNodeInfo.nodeName which was mistakenly defined as
  WD_MAX_HOST_NAMELEN. Correct one is WD_MAX_NODE_NAMELEN.

Author: Tatsuo Ishii <ishii@sraoss.co.jp>
Backpatch-through: v4.3

Branch
------
V4_3_STABLE

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

Modified Files
--------------
src/include/watchdog/wd_commands.h  | 2 +-
src/include/watchdog/wd_lifecheck.h | 2 +-
src/watchdog/wd_lifecheck.c         | 9 ++++++---
3 files changed, 8 insertions(+), 5 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgpool: Fix lifecheck buffer overrun.
@ 2026-10-01 11:16 Tatsuo Ishii <ishii@postgresql.org>
  0 siblings, 0 replies; 6+ messages in thread

From: Tatsuo Ishii @ 2026-10-01 11:16 UTC (permalink / raw)
  To: pgpool-committers@lists.postgresql.org

Fix lifecheck buffer overrun.

load_watchdog_nodes_from_json() in wd_lifecheck.c used strcpy() to
copy WDNodeInfo.stateName to lifeCheckNode.stateName.  As the size of
WDNodeInfo.stateName is WD_MAX_HOST_NAMELEN (254), while the size of
lifeCheckNode.stateName was 128, theoretically it was possible for the
strcpy() to overrun lifeCheckNode.stateName. Fortunately strings used
for WDNodeInfo.stateName are predefined as global variable
(wd_state_names in watchdog.c), and never exceeds 128 bytes at this
point. But bug is a bug.

To fix this, change the size of LifeCheckNode.stateName from 128 to
WD_MAX_HOST_NAMELEN, which aligns with WDNodeInfo.stateName.

In passing following changes are made:

- Eliminate use of strcpy() in load_watchdog_nodes_from_json(),
  instead use strlcpy().

- Fix the size of WDNodeInfo.nodeName which was mistakenly defined as
  WD_MAX_HOST_NAMELEN. Correct one is WD_MAX_NODE_NAMELEN.

Author: Tatsuo Ishii <ishii@sraoss.co.jp>
Backpatch-through: v4.3

Branch
------
V4_4_STABLE

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

Modified Files
--------------
src/include/watchdog/wd_commands.h  | 2 +-
src/include/watchdog/wd_lifecheck.h | 2 +-
src/watchdog/wd_lifecheck.c         | 9 ++++++---
3 files changed, 8 insertions(+), 5 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgpool: Fix lifecheck buffer overrun.
@ 2026-10-01 11:16 Tatsuo Ishii <ishii@postgresql.org>
  0 siblings, 0 replies; 6+ messages in thread

From: Tatsuo Ishii @ 2026-10-01 11:16 UTC (permalink / raw)
  To: pgpool-committers@lists.postgresql.org

Fix lifecheck buffer overrun.

load_watchdog_nodes_from_json() in wd_lifecheck.c used strcpy() to
copy WDNodeInfo.stateName to lifeCheckNode.stateName.  As the size of
WDNodeInfo.stateName is WD_MAX_HOST_NAMELEN (254), while the size of
lifeCheckNode.stateName was 128, theoretically it was possible for the
strcpy() to overrun lifeCheckNode.stateName. Fortunately strings used
for WDNodeInfo.stateName are predefined as global variable
(wd_state_names in watchdog.c), and never exceeds 128 bytes at this
point. But bug is a bug.

To fix this, change the size of LifeCheckNode.stateName from 128 to
WD_MAX_HOST_NAMELEN, which aligns with WDNodeInfo.stateName.

In passing following changes are made:

- Eliminate use of strcpy() in load_watchdog_nodes_from_json(),
  instead use strlcpy().

- Fix the size of WDNodeInfo.nodeName which was mistakenly defined as
  WD_MAX_HOST_NAMELEN. Correct one is WD_MAX_NODE_NAMELEN.

Author: Tatsuo Ishii <ishii@sraoss.co.jp>
Backpatch-through: v4.3

Branch
------
V4_5_STABLE

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

Modified Files
--------------
src/include/watchdog/wd_commands.h  | 2 +-
src/include/watchdog/wd_lifecheck.h | 2 +-
src/watchdog/wd_lifecheck.c         | 9 ++++++---
3 files changed, 8 insertions(+), 5 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgpool: Fix lifecheck buffer overrun.
@ 2026-10-01 11:16 Tatsuo Ishii <ishii@postgresql.org>
  0 siblings, 0 replies; 6+ messages in thread

From: Tatsuo Ishii @ 2026-10-01 11:16 UTC (permalink / raw)
  To: pgpool-committers@lists.postgresql.org

Fix lifecheck buffer overrun.

load_watchdog_nodes_from_json() in wd_lifecheck.c used strcpy() to
copy WDNodeInfo.stateName to lifeCheckNode.stateName.  As the size of
WDNodeInfo.stateName is WD_MAX_HOST_NAMELEN (254), while the size of
lifeCheckNode.stateName was 128, theoretically it was possible for the
strcpy() to overrun lifeCheckNode.stateName. Fortunately strings used
for WDNodeInfo.stateName are predefined as global variable
(wd_state_names in watchdog.c), and never exceeds 128 bytes at this
point. But bug is a bug.

To fix this, change the size of LifeCheckNode.stateName from 128 to
WD_MAX_HOST_NAMELEN, which aligns with WDNodeInfo.stateName.

In passing following changes are made:

- Eliminate use of strcpy() in load_watchdog_nodes_from_json(),
  instead use strlcpy().

- Fix the size of WDNodeInfo.nodeName which was mistakenly defined as
  WD_MAX_HOST_NAMELEN. Correct one is WD_MAX_NODE_NAMELEN.

Author: Tatsuo Ishii <ishii@sraoss.co.jp>
Backpatch-through: v4.3

Branch
------
V4_6_STABLE

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

Modified Files
--------------
src/include/watchdog/wd_commands.h  | 2 +-
src/include/watchdog/wd_lifecheck.h | 2 +-
src/watchdog/wd_lifecheck.c         | 9 ++++++---
3 files changed, 8 insertions(+), 5 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgpool: Fix lifecheck buffer overrun.
@ 2026-10-01 11:16 Tatsuo Ishii <ishii@postgresql.org>
  0 siblings, 0 replies; 6+ messages in thread

From: Tatsuo Ishii @ 2026-10-01 11:16 UTC (permalink / raw)
  To: pgpool-committers@lists.postgresql.org

Fix lifecheck buffer overrun.

load_watchdog_nodes_from_json() in wd_lifecheck.c used strcpy() to
copy WDNodeInfo.stateName to lifeCheckNode.stateName.  As the size of
WDNodeInfo.stateName is WD_MAX_HOST_NAMELEN (254), while the size of
lifeCheckNode.stateName was 128, theoretically it was possible for the
strcpy() to overrun lifeCheckNode.stateName. Fortunately strings used
for WDNodeInfo.stateName are predefined as global variable
(wd_state_names in watchdog.c), and never exceeds 128 bytes at this
point. But bug is a bug.

To fix this, change the size of LifeCheckNode.stateName from 128 to
WD_MAX_HOST_NAMELEN, which aligns with WDNodeInfo.stateName.

In passing following changes are made:

- Eliminate use of strcpy() in load_watchdog_nodes_from_json(),
  instead use strlcpy().

- Fix the size of WDNodeInfo.nodeName which was mistakenly defined as
  WD_MAX_HOST_NAMELEN. Correct one is WD_MAX_NODE_NAMELEN.

Author: Tatsuo Ishii <ishii@sraoss.co.jp>
Backpatch-through: v4.3

Branch
------
V4_7_STABLE

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

Modified Files
--------------
src/include/watchdog/wd_commands.h  | 2 +-
src/include/watchdog/wd_lifecheck.h | 2 +-
src/watchdog/wd_lifecheck.c         | 9 ++++++---
3 files changed, 8 insertions(+), 5 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgpool: Fix lifecheck buffer overrun.
@ 2026-10-01 11:16 Tatsuo Ishii <ishii@postgresql.org>
  0 siblings, 0 replies; 6+ messages in thread

From: Tatsuo Ishii @ 2026-10-01 11:16 UTC (permalink / raw)
  To: pgpool-committers@lists.postgresql.org

Fix lifecheck buffer overrun.

load_watchdog_nodes_from_json() in wd_lifecheck.c used strcpy() to
copy WDNodeInfo.stateName to lifeCheckNode.stateName.  As the size of
WDNodeInfo.stateName is WD_MAX_HOST_NAMELEN (254), while the size of
lifeCheckNode.stateName was 128, theoretically it was possible for the
strcpy() to overrun lifeCheckNode.stateName. Fortunately strings used
for WDNodeInfo.stateName are predefined as global variable
(wd_state_names in watchdog.c), and never exceeds 128 bytes at this
point. But bug is a bug.

To fix this, change the size of LifeCheckNode.stateName from 128 to
WD_MAX_HOST_NAMELEN, which aligns with WDNodeInfo.stateName.

In passing following changes are made:

- Eliminate use of strcpy() in load_watchdog_nodes_from_json(),
  instead use strlcpy().

- Fix the size of WDNodeInfo.nodeName which was mistakenly defined as
  WD_MAX_HOST_NAMELEN. Correct one is WD_MAX_NODE_NAMELEN.

Author: Tatsuo Ishii <ishii@sraoss.co.jp>
Backpatch-through: v4.3

Branch
------
master

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

Modified Files
--------------
src/include/watchdog/wd_commands.h  | 2 +-
src/include/watchdog/wd_lifecheck.h | 2 +-
src/watchdog/wd_lifecheck.c         | 9 ++++++---
3 files changed, 8 insertions(+), 5 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread


end of thread, other threads:[~2026-10-01 11:16 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-10-01 11:16 pgpool: Fix lifecheck buffer overrun. Tatsuo Ishii <ishii@postgresql.org>
2026-10-01 11:16 pgpool: Fix lifecheck buffer overrun. Tatsuo Ishii <ishii@postgresql.org>
2026-10-01 11:16 pgpool: Fix lifecheck buffer overrun. Tatsuo Ishii <ishii@postgresql.org>
2026-10-01 11:16 pgpool: Fix lifecheck buffer overrun. Tatsuo Ishii <ishii@postgresql.org>
2026-10-01 11:16 pgpool: Fix lifecheck buffer overrun. Tatsuo Ishii <ishii@postgresql.org>
2026-10-01 11:16 pgpool: Fix lifecheck buffer overrun. Tatsuo Ishii <ishii@postgresql.org>

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