pgsql: Add additional sanity checks when reading a blkreftable.

Поиск
Список
Период
Сортировка
Искать

pgsql: Add additional sanity checks when reading a blkreftable.

От:
Robert Haas <rhaas@postgresql.org>
Дата:
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  (chunk sizes)
Reported-by: Robert Haas  (fork numbers)
Reviewed-by: Daniel Gustafsson 
Discussion: http://postgr.es/m/CA+TgmoYP8RKoBGosS7C6Fdr-GNCfyz_W1zmK=Tx1Fe0ZvzGh0g@mail.gmail.com
Backpatch-through: 17

Branch
------
master

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

Modified Files
--------------
src/common/blkreftable.c | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)

FAQ