Incorrect allocation handling for cryptohash functions with OpenSSL

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Incorrect allocation handling for cryptohash functions with OpenSSL
Date: 2020-12-18 07:35:20
Message-ID: X9xbuEoiU3dlImfa@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi all,

As of the work done in 87ae9691, I have played with error injections
in the code paths using this code, but forgot to count for cases where
cascading resowner cleanups are involved. Like other resources (JIT,
DSM, etc.), this requires an allocation in TopMemoryContext to make
sure that nothing gets forgotten or cleaned up on the way until the
resowner that did the cryptohash allocation is handled.

Attached is a small extension I have played with by doing some error
injections, and a patch. If there are no objections, I would like to
commit this fix.

Thanks,
--
Michael

Attachment Content-Type Size
cryptohash-alloc.patch text/x-diff 750 bytes
hashfuncs.tar.gz application/gzip 1.6 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tang, Haiying 2020-12-18 07:45:33 RE: [Patch] Optimize dropping of relation buffers using dlist
Previous Message Justin Pryzby 2020-12-18 06:58:08 Re: allow to \dtS+ pg_toast.*