Label switcher function

From: KaiGai Kohei <kaigai(at)kaigai(dot)gr(dot)jp>
To: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Label switcher function
Date: 2010-11-13 03:36:58
Message-ID: 4CDE07DA.8070301@kaigai.gr.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

The attached patch allows the security label provider to switch
security label of the client during execution of certain functions.
I named it as "label switcher function"; also called as "trusted-
procedure" in SELinux community.

This feature is quite similar idea toward security definer function,
or set-uid program on operating system. It allows label providers
to switch its internal state that holds security label of the
client, then restore it.
If and when a label provider said the function being invoked is
a label-switcher, fmgr_security_definer() traps this invocation
and set some states just before actual invocations.

We added three new hooks for security label provider.
The get_client_label and set_client_label allows the PG core to
save and restore security label of the client; which is mostly
just an internal state of plugin module.
And, the get_switched_label shall return NULL or a valid label
if the supplied function is a label switcher. It also informs
the PG core whether the function is switcher or not.

Thanks,
--
KaiGai Kohei <kaigai(at)kaigai(dot)gr(dot)jp>

Attachment Content-Type Size
pgsql-switcher-function.1.patch application/octect-stream 17.9 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2010-11-13 03:39:23 Re: pgsql: Improved parallel make support
Previous Message Bruce Momjian 2010-11-13 03:05:29 Re: WIP: extensible enums