pgsql: Don't leave pg_hba and pg_ident data lying around in running bac - Mailing list pgsql-committers

From Tom Lane
Subject pgsql: Don't leave pg_hba and pg_ident data lying around in running bac
Date
Msg-id E1ZAQuy-00072J-7G@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Don't leave pg_hba and pg_ident data lying around in running backends.

Free the contexts holding this data after we're done using it, by the
expedient of attaching them to the PostmasterContext which we were
already taking care to delete (and where, indeed, this data used to live
before commits e5e2fc842c418432 and 7c45e3a3c682f855).  This saves a
probably-usually-negligible amount of space per running backend.  It also
avoids leaving potentially-security-sensitive data lying around in memory
in processes that don't need it.  You'd have to be unusually paranoid to
think that that amounts to a live security bug, so I've not gone so far as
to forcibly zero the memory; but there surely isn't a good reason to keep
this data around.

Arguably this is a memory management bug in the aforementioned commits,
but it doesn't seem important enough to back-patch.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/1e24cf645d24aab3ea39a9d259897fd0cae4e4b6

Modified Files
--------------
src/backend/libpq/hba.c           |    8 +++++---
src/backend/utils/init/postinit.c |   13 +++++++++++++
2 files changed, 18 insertions(+), 3 deletions(-)


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: pgsql: Make sampler_random_fract() actually obey its API contract.
Next
From: Fujii Masao
Date:
Subject: pgsql: Make use of xlog_internal.h's macros in WAL-related utilities.