PostmasterContext survives into parallel workers!? - Mailing list pgsql-hackers

From Tom Lane
Subject PostmasterContext survives into parallel workers!?
Date
Msg-id 14111.1470082717@sss.pgh.pa.us
Whole thread Raw
Responses Re: PostmasterContext survives into parallel workers!?  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
I noticed $subject while fooling around with the tqueue.c memory leak
issues.  This does not seem like a good idea to me.  At the very least,
it's a waste of space that could be used for something else, and at the
worst, it might be a security issue because it leaves security-sensitive
pg_hba and pg_ident information laying about in places where it might be
recoverable (if only through memory-disclosure bugs, which we've had
before and no doubt will have again).

The reason is that the parallel worker launch path contains no equivalent
of PostgresMain's stanza
if (PostmasterContext){    MemoryContextDelete(PostmasterContext);    PostmasterContext = NULL;}

Now, I'm undecided whether to flush that context only in parallel workers,
or to try to make it go away for all bgworkers of any stripe.  The latter
seems a little better from a security standpoint, but I wonder if anyone
has a use-case where that'd be a bad idea?
        regards, tom lane



pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: New version numbering practices
Next
From: Alvaro Herrera
Date:
Subject: Re: HandleParallelMessages contains CHECK_FOR_INTERRUPTS?