pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Check for relation length overrun soon enough.
7+ messages / 1 participants
[nested] [flat]

* pgsql: Check for relation length overrun soon enough.
@ 2021-09-09 15:46  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2021-09-09 15:46 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Check for relation length overrun soon enough.

We don't allow relations to exceed 2^32-1 blocks, because block
numbers are 32 bits and the last possible block number is reserved
to mean InvalidBlockNumber.  There is a check for this in mdextend,
but that's really way too late, because the smgr API requires us to
create a buffer for the block-to-be-added, and we do not want to
have any buffer with blocknum InvalidBlockNumber.  (Such a case
can trigger assertions in bufmgr.c, plus I think it might confuse
ReadBuffer's logic for data-past-EOF later on.)  So put the check
into ReadBuffer.

Per report from Christoph Berg.  It's been like this forever,
so back-patch to all supported branches.

Discussion: https://postgr.es/m/YTn1iTkUYBZfcODk@msg.credativ.de

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/8481f99896a192e9fd57f5e1a99e255e27680a10

Modified Files
--------------
src/backend/storage/buffer/bufmgr.c | 9 +++++++++
src/backend/storage/smgr/md.c       | 3 ++-
2 files changed, 11 insertions(+), 1 deletion(-)



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

* pgsql: Check for relation length overrun soon enough.
@ 2021-09-09 15:46  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2021-09-09 15:46 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Check for relation length overrun soon enough.

We don't allow relations to exceed 2^32-1 blocks, because block
numbers are 32 bits and the last possible block number is reserved
to mean InvalidBlockNumber.  There is a check for this in mdextend,
but that's really way too late, because the smgr API requires us to
create a buffer for the block-to-be-added, and we do not want to
have any buffer with blocknum InvalidBlockNumber.  (Such a case
can trigger assertions in bufmgr.c, plus I think it might confuse
ReadBuffer's logic for data-past-EOF later on.)  So put the check
into ReadBuffer.

Per report from Christoph Berg.  It's been like this forever,
so back-patch to all supported branches.

Discussion: https://postgr.es/m/YTn1iTkUYBZfcODk@msg.credativ.de

Branch
------
REL_14_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/7430c774209cd98bbc33076cc3c07497c1086d9a

Modified Files
--------------
src/backend/storage/buffer/bufmgr.c | 9 +++++++++
src/backend/storage/smgr/md.c       | 3 ++-
2 files changed, 11 insertions(+), 1 deletion(-)



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

* pgsql: Check for relation length overrun soon enough.
@ 2021-09-09 15:46  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2021-09-09 15:46 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Check for relation length overrun soon enough.

We don't allow relations to exceed 2^32-1 blocks, because block
numbers are 32 bits and the last possible block number is reserved
to mean InvalidBlockNumber.  There is a check for this in mdextend,
but that's really way too late, because the smgr API requires us to
create a buffer for the block-to-be-added, and we do not want to
have any buffer with blocknum InvalidBlockNumber.  (Such a case
can trigger assertions in bufmgr.c, plus I think it might confuse
ReadBuffer's logic for data-past-EOF later on.)  So put the check
into ReadBuffer.

Per report from Christoph Berg.  It's been like this forever,
so back-patch to all supported branches.

Discussion: https://postgr.es/m/YTn1iTkUYBZfcODk@msg.credativ.de

Branch
------
REL_13_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/04118de78fe9a8a7160775b47e89bf21a5efb620

Modified Files
--------------
src/backend/storage/buffer/bufmgr.c | 9 +++++++++
src/backend/storage/smgr/md.c       | 3 ++-
2 files changed, 11 insertions(+), 1 deletion(-)



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

* pgsql: Check for relation length overrun soon enough.
@ 2021-09-09 15:46  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2021-09-09 15:46 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Check for relation length overrun soon enough.

We don't allow relations to exceed 2^32-1 blocks, because block
numbers are 32 bits and the last possible block number is reserved
to mean InvalidBlockNumber.  There is a check for this in mdextend,
but that's really way too late, because the smgr API requires us to
create a buffer for the block-to-be-added, and we do not want to
have any buffer with blocknum InvalidBlockNumber.  (Such a case
can trigger assertions in bufmgr.c, plus I think it might confuse
ReadBuffer's logic for data-past-EOF later on.)  So put the check
into ReadBuffer.

Per report from Christoph Berg.  It's been like this forever,
so back-patch to all supported branches.

Discussion: https://postgr.es/m/YTn1iTkUYBZfcODk@msg.credativ.de

Branch
------
REL_12_STABLE

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

Modified Files
--------------
src/backend/storage/buffer/bufmgr.c | 9 +++++++++
src/backend/storage/smgr/md.c       | 3 ++-
2 files changed, 11 insertions(+), 1 deletion(-)



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

* pgsql: Check for relation length overrun soon enough.
@ 2021-09-09 15:46  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2021-09-09 15:46 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Check for relation length overrun soon enough.

We don't allow relations to exceed 2^32-1 blocks, because block
numbers are 32 bits and the last possible block number is reserved
to mean InvalidBlockNumber.  There is a check for this in mdextend,
but that's really way too late, because the smgr API requires us to
create a buffer for the block-to-be-added, and we do not want to
have any buffer with blocknum InvalidBlockNumber.  (Such a case
can trigger assertions in bufmgr.c, plus I think it might confuse
ReadBuffer's logic for data-past-EOF later on.)  So put the check
into ReadBuffer.

Per report from Christoph Berg.  It's been like this forever,
so back-patch to all supported branches.

Discussion: https://postgr.es/m/YTn1iTkUYBZfcODk@msg.credativ.de

Branch
------
REL_11_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/1a23b669db576460a42b257379335a447229ffa6

Modified Files
--------------
src/backend/storage/buffer/bufmgr.c | 9 +++++++++
src/backend/storage/smgr/md.c       | 3 ++-
2 files changed, 11 insertions(+), 1 deletion(-)



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

* pgsql: Check for relation length overrun soon enough.
@ 2021-09-09 15:46  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2021-09-09 15:46 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Check for relation length overrun soon enough.

We don't allow relations to exceed 2^32-1 blocks, because block
numbers are 32 bits and the last possible block number is reserved
to mean InvalidBlockNumber.  There is a check for this in mdextend,
but that's really way too late, because the smgr API requires us to
create a buffer for the block-to-be-added, and we do not want to
have any buffer with blocknum InvalidBlockNumber.  (Such a case
can trigger assertions in bufmgr.c, plus I think it might confuse
ReadBuffer's logic for data-past-EOF later on.)  So put the check
into ReadBuffer.

Per report from Christoph Berg.  It's been like this forever,
so back-patch to all supported branches.

Discussion: https://postgr.es/m/YTn1iTkUYBZfcODk@msg.credativ.de

Branch
------
REL_10_STABLE

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

Modified Files
--------------
src/backend/storage/buffer/bufmgr.c | 9 +++++++++
src/backend/storage/smgr/md.c       | 3 ++-
2 files changed, 11 insertions(+), 1 deletion(-)



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

* pgsql: Check for relation length overrun soon enough.
@ 2021-09-09 15:46  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2021-09-09 15:46 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Check for relation length overrun soon enough.

We don't allow relations to exceed 2^32-1 blocks, because block
numbers are 32 bits and the last possible block number is reserved
to mean InvalidBlockNumber.  There is a check for this in mdextend,
but that's really way too late, because the smgr API requires us to
create a buffer for the block-to-be-added, and we do not want to
have any buffer with blocknum InvalidBlockNumber.  (Such a case
can trigger assertions in bufmgr.c, plus I think it might confuse
ReadBuffer's logic for data-past-EOF later on.)  So put the check
into ReadBuffer.

Per report from Christoph Berg.  It's been like this forever,
so back-patch to all supported branches.

Discussion: https://postgr.es/m/YTn1iTkUYBZfcODk@msg.credativ.de

Branch
------
REL9_6_STABLE

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

Modified Files
--------------
src/backend/storage/buffer/bufmgr.c | 9 +++++++++
src/backend/storage/smgr/md.c       | 3 ++-
2 files changed, 11 insertions(+), 1 deletion(-)



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


end of thread, other threads:[~2021-09-09 15:46 UTC | newest]

Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-09-09 15:46 pgsql: Check for relation length overrun soon enough. Tom Lane <tgl@sss.pgh.pa.us>
2021-09-09 15:46 pgsql: Check for relation length overrun soon enough. Tom Lane <tgl@sss.pgh.pa.us>
2021-09-09 15:46 pgsql: Check for relation length overrun soon enough. Tom Lane <tgl@sss.pgh.pa.us>
2021-09-09 15:46 pgsql: Check for relation length overrun soon enough. Tom Lane <tgl@sss.pgh.pa.us>
2021-09-09 15:46 pgsql: Check for relation length overrun soon enough. Tom Lane <tgl@sss.pgh.pa.us>
2021-09-09 15:46 pgsql: Check for relation length overrun soon enough. Tom Lane <tgl@sss.pgh.pa.us>
2021-09-09 15:46 pgsql: Check for relation length overrun soon enough. 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