pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix bogus initialization of replication origin shared memory sta
6+ messages / 1 participants
[nested] [flat]

* pgsql: Fix bogus initialization of replication origin shared memory sta
@ 2020-05-15 23:06 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2020-05-15 23:06 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix bogus initialization of replication origin shared memory state.

The previous coding zeroed out offsetof(ReplicationStateCtl, states)
more bytes than it was entitled to, as a consequence of starting the
zeroing from the wrong pointer (or, if you prefer, using the wrong
calculation of how much to zero).

It's unsurprising that this has not caused any reported problems,
since it can be expected that the newly-allocated block is at the end
of what we've used in shared memory, and we always make the shmem
block substantially bigger than minimally necessary.  Nonetheless,
this is wrong and it could bite us someday; plus it's a dangerous
model for somebody to copy.

This dates back to the introduction of this code (commit 5aa235042),
so back-patch to all supported branches.

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/8048404939bb0fcef80b0ab57910b6e10d4289a3

Modified Files
--------------
src/backend/replication/logical/origin.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)



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

* pgsql: Fix bogus initialization of replication origin shared memory sta
@ 2020-05-15 23:06 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2020-05-15 23:06 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix bogus initialization of replication origin shared memory state.

The previous coding zeroed out offsetof(ReplicationStateCtl, states)
more bytes than it was entitled to, as a consequence of starting the
zeroing from the wrong pointer (or, if you prefer, using the wrong
calculation of how much to zero).

It's unsurprising that this has not caused any reported problems,
since it can be expected that the newly-allocated block is at the end
of what we've used in shared memory, and we always make the shmem
block substantially bigger than minimally necessary.  Nonetheless,
this is wrong and it could bite us someday; plus it's a dangerous
model for somebody to copy.

This dates back to the introduction of this code (commit 5aa235042),
so back-patch to all supported branches.

Branch
------
REL_12_STABLE

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

Modified Files
--------------
src/backend/replication/logical/origin.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)



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

* pgsql: Fix bogus initialization of replication origin shared memory sta
@ 2020-05-15 23:06 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2020-05-15 23:06 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix bogus initialization of replication origin shared memory state.

The previous coding zeroed out offsetof(ReplicationStateCtl, states)
more bytes than it was entitled to, as a consequence of starting the
zeroing from the wrong pointer (or, if you prefer, using the wrong
calculation of how much to zero).

It's unsurprising that this has not caused any reported problems,
since it can be expected that the newly-allocated block is at the end
of what we've used in shared memory, and we always make the shmem
block substantially bigger than minimally necessary.  Nonetheless,
this is wrong and it could bite us someday; plus it's a dangerous
model for somebody to copy.

This dates back to the introduction of this code (commit 5aa235042),
so back-patch to all supported branches.

Branch
------
REL_11_STABLE

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

Modified Files
--------------
src/backend/replication/logical/origin.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)



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

* pgsql: Fix bogus initialization of replication origin shared memory sta
@ 2020-05-15 23:06 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2020-05-15 23:06 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix bogus initialization of replication origin shared memory state.

The previous coding zeroed out offsetof(ReplicationStateCtl, states)
more bytes than it was entitled to, as a consequence of starting the
zeroing from the wrong pointer (or, if you prefer, using the wrong
calculation of how much to zero).

It's unsurprising that this has not caused any reported problems,
since it can be expected that the newly-allocated block is at the end
of what we've used in shared memory, and we always make the shmem
block substantially bigger than minimally necessary.  Nonetheless,
this is wrong and it could bite us someday; plus it's a dangerous
model for somebody to copy.

This dates back to the introduction of this code (commit 5aa235042),
so back-patch to all supported branches.

Branch
------
REL_10_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/9d66ea5dee0091e12e0575b0798fa8ba9645e8bb

Modified Files
--------------
src/backend/replication/logical/origin.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)



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

* pgsql: Fix bogus initialization of replication origin shared memory sta
@ 2020-05-15 23:06 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2020-05-15 23:06 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix bogus initialization of replication origin shared memory state.

The previous coding zeroed out offsetof(ReplicationStateCtl, states)
more bytes than it was entitled to, as a consequence of starting the
zeroing from the wrong pointer (or, if you prefer, using the wrong
calculation of how much to zero).

It's unsurprising that this has not caused any reported problems,
since it can be expected that the newly-allocated block is at the end
of what we've used in shared memory, and we always make the shmem
block substantially bigger than minimally necessary.  Nonetheless,
this is wrong and it could bite us someday; plus it's a dangerous
model for somebody to copy.

This dates back to the introduction of this code (commit 5aa235042),
so back-patch to all supported branches.

Branch
------
REL9_6_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/594ba7f79d32ad1e915c3acb53d84b6e57884ce5

Modified Files
--------------
src/backend/replication/logical/origin.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)



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

* pgsql: Fix bogus initialization of replication origin shared memory sta
@ 2020-05-15 23:06 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2020-05-15 23:06 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix bogus initialization of replication origin shared memory state.

The previous coding zeroed out offsetof(ReplicationStateCtl, states)
more bytes than it was entitled to, as a consequence of starting the
zeroing from the wrong pointer (or, if you prefer, using the wrong
calculation of how much to zero).

It's unsurprising that this has not caused any reported problems,
since it can be expected that the newly-allocated block is at the end
of what we've used in shared memory, and we always make the shmem
block substantially bigger than minimally necessary.  Nonetheless,
this is wrong and it could bite us someday; plus it's a dangerous
model for somebody to copy.

This dates back to the introduction of this code (commit 5aa235042),
so back-patch to all supported branches.

Branch
------
REL9_5_STABLE

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

Modified Files
--------------
src/backend/replication/logical/origin.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)



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


end of thread, other threads:[~2020-05-15 23:06 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-05-15 23:06 pgsql: Fix bogus initialization of replication origin shared memory sta Tom Lane <tgl@sss.pgh.pa.us>
2020-05-15 23:06 pgsql: Fix bogus initialization of replication origin shared memory sta Tom Lane <tgl@sss.pgh.pa.us>
2020-05-15 23:06 pgsql: Fix bogus initialization of replication origin shared memory sta Tom Lane <tgl@sss.pgh.pa.us>
2020-05-15 23:06 pgsql: Fix bogus initialization of replication origin shared memory sta Tom Lane <tgl@sss.pgh.pa.us>
2020-05-15 23:06 pgsql: Fix bogus initialization of replication origin shared memory sta Tom Lane <tgl@sss.pgh.pa.us>
2020-05-15 23:06 pgsql: Fix bogus initialization of replication origin shared memory sta Tom Lane <tgl@sss.pgh.pa.us>

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