pgsql: Fix locking bugs that could corrupt pg_control.

From: Thomas Munro <tmunro(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix locking bugs that could corrupt pg_control.
Date: 2020-06-08 02:45:21
Message-ID: E1ji7mr-0003Ka-BY@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix locking bugs that could corrupt pg_control.

The redo routines for XLOG_CHECKPOINT_{ONLINE,SHUTDOWN} must acquire
ControlFileLock before modifying ControlFile->checkPointCopy, or the
checkpointer could write out a control file with a bad checksum.

Likewise, XLogReportParameters() must acquire ControlFileLock before
modifying ControlFile and calling UpdateControlFile().

Back-patch to all supported releases.

Author: Nathan Bossart <bossartn(at)amazon(dot)com>
Author: Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>
Reviewed-by: Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>
Reviewed-by: Michael Paquier <michael(at)paquier(dot)xyz>
Reviewed-by: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
Discussion: https://postgr.es/m/70BF24D6-DC51-443F-B55A-95735803842A%40amazon.com

Branch
------
REL_10_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/fd11b842eba944d62014f7072b0c76e36cbe652e

Modified Files
--------------
src/backend/access/transam/xlog.c | 8 ++++++++
1 file changed, 8 insertions(+)

Browse pgsql-committers by date

  From Date Subject
Next Message Thomas Munro 2020-06-08 02:45:46 pgsql: Fix locking bugs that could corrupt pg_control.
Previous Message Thomas Munro 2020-06-08 02:45:01 pgsql: Fix locking bugs that could corrupt pg_control.