pgsql: Fix dangling smgr_owner pointer when a fake relcache entry is fr

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема pgsql: Fix dangling smgr_owner pointer when a fake relcache entry is fr
Дата
Msg-id E1WLtIb-0000me-IK@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Fix dangling smgr_owner pointer when a fake relcache entry is freed.

A fake relcache entry can "own" a SmgrRelation object, like a regular
relcache entry. But when it was free'd, the owner field in SmgrRelation
was not cleared, so it was left pointing to free'd memory.

Amazingly this apparently hasn't caused crashes in practice, or we would've
heard about it earlier. Andres found this with Valgrind.

Report and fix by Andres Freund, with minor modifications by me. Backpatch
to all supported versions.

Branch
------
REL9_3_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/4f91af8ca2f567bc9087644b29df8d6a56549994

Modified Files
--------------
src/backend/access/transam/xlogutils.c |    3 +++
src/backend/storage/smgr/smgr.c        |   42 +++++++++++++++++++++++++++++---
src/include/storage/smgr.h             |    1 +
3 files changed, 42 insertions(+), 4 deletions(-)


В списке pgsql-committers по дате отправления:

Предыдущее
От: Heikki Linnakangas
Дата:
Сообщение: pgsql: Avoid memcpy() with same source and destination address.
Следующее
От: Heikki Linnakangas
Дата:
Сообщение: pgsql: Fix dangling smgr_owner pointer when a fake relcache entry is fr