]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Add additional sanity checks when reading a blkreftable.
authorRobert Haas <rhaas@postgresql.org>
Wed, 15 Jul 2026 17:04:32 +0000 (13:04 -0400)
committerRobert Haas <rhaas@postgresql.org>
Wed, 15 Jul 2026 17:13:56 +0000 (13:13 -0400)
commitbcc428a23a69ee6f3bcc2ce20655da68eed0e7aa
tree210e4c4ced71c0d124ea4ed8be028db660de79fd
parentae8c4bd558c5d55c5a357e910d496eea8ff33647
Add additional sanity checks when reading a blkreftable.

Code elsewhere in the system assumes that fork numbers and chunk sizes
are within bounds, so the code that reads those quantities from disk
should validate that they are. Without these additional checks, a
corrupted file can cause us to index off the end of fork number or chunk
entry arrays, potentially resulting in a crash.

Reported-by: oxsignal <awo@kakao.com> (chunk sizes)
Reported-by: Robert Haas <rhaas@postgresql.org> (fork numbers)
Reviewed-by: Daniel Gustafsson <daniel@yesql.se>
Discussion: http://postgr.es/m/CA+TgmoYP8RKoBGosS7C6Fdr-GNCfyz_W1zmK=Tx1Fe0ZvzGh0g@mail.gmail.com
Backpatch-through: 17
src/common/blkreftable.c