pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Fix potential use-after-frees in WAL sender 7+ messages / 1 participants [nested] [flat]
* pgsql: Fix potential use-after-frees in WAL sender @ 2026-10-14 03:05 Michael Paquier <michael@paquier.xyz> 0 siblings, 0 replies; 7+ messages in thread From: Michael Paquier @ 2026-10-14 03:05 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix potential use-after-frees in WAL sender A WAL sender tracks its WAL reader and logical decoding context as two static variables, which were left set after being freed for a START_REPLICATION command. The WAL reader is used for in a physical replication command, both the WAL reader and the logical decoding context are used for a logical replication command. Both variables are now cleared once their contents are released at the end of each replication command, to keep the release of the resources and the maintenance of the pointers close to each other. Some more cleanup is done by WalSndErrorCleanup(), as well, once the WAL reader is clear. The assertion added by 879ad9f90e83 is moved before the execution of a replication command, checking now that both the WAL reader and the logical decoding context are never set before the execution of a new command. Author: Ayush Tiwari <ayushtiwari.slg01@gmail.com> Reviewed-by: Michael Paquier <michael@paquier.xyz> Discussion: https://postgr.es/m/CAJTYsWW+hdmmVt_A4hvGv2_5RWK8-kaOf5ncT65=5i_hyD=BHg@mail.gmail.com Backpatch-through: 14 Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/f2dd2a3bd44eb1d158e6e507b86dc3df787043b1 Modified Files -------------- src/backend/replication/walsender.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Fix potential use-after-frees in WAL sender @ 2026-10-14 03:05 Michael Paquier <michael@paquier.xyz> 0 siblings, 0 replies; 7+ messages in thread From: Michael Paquier @ 2026-10-14 03:05 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix potential use-after-frees in WAL sender A WAL sender tracks its WAL reader and logical decoding context as two static variables, which were left set after being freed for a START_REPLICATION command. The WAL reader is used for in a physical replication command, both the WAL reader and the logical decoding context are used for a logical replication command. Both variables are now cleared once their contents are released at the end of each replication command, to keep the release of the resources and the maintenance of the pointers close to each other. Some more cleanup is done by WalSndErrorCleanup(), as well, once the WAL reader is clear. The assertion added by 879ad9f90e83 is moved before the execution of a replication command, checking now that both the WAL reader and the logical decoding context are never set before the execution of a new command. Author: Ayush Tiwari <ayushtiwari.slg01@gmail.com> Reviewed-by: Michael Paquier <michael@paquier.xyz> Discussion: https://postgr.es/m/CAJTYsWW+hdmmVt_A4hvGv2_5RWK8-kaOf5ncT65=5i_hyD=BHg@mail.gmail.com Backpatch-through: 14 Branch ------ REL_19_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/d162119ef7c89da93d2db6653fbf4aed71628e14 Modified Files -------------- src/backend/replication/walsender.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Fix potential use-after-frees in WAL sender @ 2026-10-14 03:05 Michael Paquier <michael@paquier.xyz> 0 siblings, 0 replies; 7+ messages in thread From: Michael Paquier @ 2026-10-14 03:05 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix potential use-after-frees in WAL sender A WAL sender tracks its WAL reader and logical decoding context as two static variables, which were left set after being freed for a START_REPLICATION command. The WAL reader is used for in a physical replication command, both the WAL reader and the logical decoding context are used for a logical replication command. Both variables are now cleared once their contents are released at the end of each replication command, to keep the release of the resources and the maintenance of the pointers close to each other. Some more cleanup is done by WalSndErrorCleanup(), as well, once the WAL reader is clear. The assertion added by 879ad9f90e83 is moved before the execution of a replication command, checking now that both the WAL reader and the logical decoding context are never set before the execution of a new command. Author: Ayush Tiwari <ayushtiwari.slg01@gmail.com> Reviewed-by: Michael Paquier <michael@paquier.xyz> Discussion: https://postgr.es/m/CAJTYsWW+hdmmVt_A4hvGv2_5RWK8-kaOf5ncT65=5i_hyD=BHg@mail.gmail.com Backpatch-through: 14 Branch ------ REL_17_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/39173a9bd0ddcbdb14d1e05bc7a82cad6e7f7fee Modified Files -------------- src/backend/replication/walsender.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Fix potential use-after-frees in WAL sender @ 2026-10-14 03:05 Michael Paquier <michael@paquier.xyz> 0 siblings, 0 replies; 7+ messages in thread From: Michael Paquier @ 2026-10-14 03:05 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix potential use-after-frees in WAL sender A WAL sender tracks its WAL reader and logical decoding context as two static variables, which were left set after being freed for a START_REPLICATION command. The WAL reader is used for in a physical replication command, both the WAL reader and the logical decoding context are used for a logical replication command. Both variables are now cleared once their contents are released at the end of each replication command, to keep the release of the resources and the maintenance of the pointers close to each other. Some more cleanup is done by WalSndErrorCleanup(), as well, once the WAL reader is clear. The assertion added by 879ad9f90e83 is moved before the execution of a replication command, checking now that both the WAL reader and the logical decoding context are never set before the execution of a new command. Author: Ayush Tiwari <ayushtiwari.slg01@gmail.com> Reviewed-by: Michael Paquier <michael@paquier.xyz> Discussion: https://postgr.es/m/CAJTYsWW+hdmmVt_A4hvGv2_5RWK8-kaOf5ncT65=5i_hyD=BHg@mail.gmail.com Backpatch-through: 14 Branch ------ REL_16_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/078110c0075c3773ff4c2d84d3e8808f0748b1fd Modified Files -------------- src/backend/replication/walsender.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Fix potential use-after-frees in WAL sender @ 2026-10-14 03:05 Michael Paquier <michael@paquier.xyz> 0 siblings, 0 replies; 7+ messages in thread From: Michael Paquier @ 2026-10-14 03:05 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix potential use-after-frees in WAL sender A WAL sender tracks its WAL reader and logical decoding context as two static variables, which were left set after being freed for a START_REPLICATION command. The WAL reader is used for in a physical replication command, both the WAL reader and the logical decoding context are used for a logical replication command. Both variables are now cleared once their contents are released at the end of each replication command, to keep the release of the resources and the maintenance of the pointers close to each other. Some more cleanup is done by WalSndErrorCleanup(), as well, once the WAL reader is clear. The assertion added by 879ad9f90e83 is moved before the execution of a replication command, checking now that both the WAL reader and the logical decoding context are never set before the execution of a new command. Author: Ayush Tiwari <ayushtiwari.slg01@gmail.com> Reviewed-by: Michael Paquier <michael@paquier.xyz> Discussion: https://postgr.es/m/CAJTYsWW+hdmmVt_A4hvGv2_5RWK8-kaOf5ncT65=5i_hyD=BHg@mail.gmail.com Backpatch-through: 14 Branch ------ REL_15_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/3f82c47b5d1adab44476f9e4f0e66a9178401e0b Modified Files -------------- src/backend/replication/walsender.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Fix potential use-after-frees in WAL sender @ 2026-10-14 03:05 Michael Paquier <michael@paquier.xyz> 0 siblings, 0 replies; 7+ messages in thread From: Michael Paquier @ 2026-10-14 03:05 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix potential use-after-frees in WAL sender A WAL sender tracks its WAL reader and logical decoding context as two static variables, which were left set after being freed for a START_REPLICATION command. The WAL reader is used for in a physical replication command, both the WAL reader and the logical decoding context are used for a logical replication command. Both variables are now cleared once their contents are released at the end of each replication command, to keep the release of the resources and the maintenance of the pointers close to each other. Some more cleanup is done by WalSndErrorCleanup(), as well, once the WAL reader is clear. The assertion added by 879ad9f90e83 is moved before the execution of a replication command, checking now that both the WAL reader and the logical decoding context are never set before the execution of a new command. Author: Ayush Tiwari <ayushtiwari.slg01@gmail.com> Reviewed-by: Michael Paquier <michael@paquier.xyz> Discussion: https://postgr.es/m/CAJTYsWW+hdmmVt_A4hvGv2_5RWK8-kaOf5ncT65=5i_hyD=BHg@mail.gmail.com Backpatch-through: 14 Branch ------ REL_18_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/d21a3e1fe5f454355efbc3bccbd2b4d81e0f7c27 Modified Files -------------- src/backend/replication/walsender.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Fix potential use-after-frees in WAL sender @ 2026-10-14 03:05 Michael Paquier <michael@paquier.xyz> 0 siblings, 0 replies; 7+ messages in thread From: Michael Paquier @ 2026-10-14 03:05 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix potential use-after-frees in WAL sender A WAL sender tracks its WAL reader and logical decoding context as two static variables, which were left set after being freed for a START_REPLICATION command. The WAL reader is used for in a physical replication command, both the WAL reader and the logical decoding context are used for a logical replication command. Both variables are now cleared once their contents are released at the end of each replication command, to keep the release of the resources and the maintenance of the pointers close to each other. Some more cleanup is done by WalSndErrorCleanup(), as well, once the WAL reader is clear. The assertion added by 879ad9f90e83 is moved before the execution of a replication command, checking now that both the WAL reader and the logical decoding context are never set before the execution of a new command. Author: Ayush Tiwari <ayushtiwari.slg01@gmail.com> Reviewed-by: Michael Paquier <michael@paquier.xyz> Discussion: https://postgr.es/m/CAJTYsWW+hdmmVt_A4hvGv2_5RWK8-kaOf5ncT65=5i_hyD=BHg@mail.gmail.com Backpatch-through: 14 Branch ------ REL_14_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/0e2260ab10f68a681624157365dba58c76578958 Modified Files -------------- src/backend/replication/walsender.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
end of thread, other threads:[~2026-10-14 03:05 UTC | newest] Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2026-10-14 03:05 pgsql: Fix potential use-after-frees in WAL sender Michael Paquier <michael@paquier.xyz> 2026-10-14 03:05 pgsql: Fix potential use-after-frees in WAL sender Michael Paquier <michael@paquier.xyz> 2026-10-14 03:05 pgsql: Fix potential use-after-frees in WAL sender Michael Paquier <michael@paquier.xyz> 2026-10-14 03:05 pgsql: Fix potential use-after-frees in WAL sender Michael Paquier <michael@paquier.xyz> 2026-10-14 03:05 pgsql: Fix potential use-after-frees in WAL sender Michael Paquier <michael@paquier.xyz> 2026-10-14 03:05 pgsql: Fix potential use-after-frees in WAL sender Michael Paquier <michael@paquier.xyz> 2026-10-14 03:05 pgsql: Fix potential use-after-frees in WAL sender Michael Paquier <michael@paquier.xyz>
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