pgsql: Make LOAD of an already-loaded library into a no-op, instead of

From: tgl(at)postgresql(dot)org (Tom Lane)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Make LOAD of an already-loaded library into a no-op, instead of
Date: 2009-09-03 22:11:14
Message-ID: 20090903221114.26E60753FB7@cvs.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Log Message:
-----------
Make LOAD of an already-loaded library into a no-op, instead of attempting
to unload and re-load the library.

The difficulty with unloading a library is that we haven't defined safe
protocols for doing so. In particular, there's no safe mechanism for
getting out of a "hook" function pointer unless libraries are unloaded
in reverse order of loading. And there's no mechanism at all for undefining
a custom GUC variable, so GUC would be left with a pointer to an old value
that might or might not still be valid, and very possibly wouldn't be in
the same place anymore.

While the unload and reload behavior had some usefulness in easing
development of new loadable libraries, it's of no use whatever to normal
users, so just disabling it isn't giving up that much. Someday we might
care to expend the effort to develop safe unload protocols; but even if
we did, there'd be little certainty that every third-party loadable module
was following them, so some security restrictions would still be needed.

Back-patch to 8.2; before that, LOAD was superuser-only anyway.

Security: unprivileged users could crash backend. CVE not assigned yet

Tags:
----
REL8_4_STABLE

Modified Files:
--------------
pgsql/doc/src/sgml/ref:
create_function.sgml (r1.84 -> r1.84.2.1)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/doc/src/sgml/ref/create_function.sgml?r1=1.84&r2=1.84.2.1)
load.sgml (r1.25 -> r1.25.2.1)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/doc/src/sgml/ref/load.sgml?r1=1.25&r2=1.25.2.1)
pgsql/doc/src/sgml:
xfunc.sgml (r1.138 -> r1.138.2.1)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/doc/src/sgml/xfunc.sgml?r1=1.138&r2=1.138.2.1)
pgsql/src/backend/utils/fmgr:
dfmgr.c (r1.99 -> r1.99.2.1)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/fmgr/dfmgr.c?r1=1.99&r2=1.99.2.1)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2009-09-03 22:11:23 pgsql: Make LOAD of an already-loaded library into a no-op, instead of
Previous Message Tom Lane 2009-09-03 22:11:07 pgsql: Make LOAD of an already-loaded library into a no-op, instead of