Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id DB3D7650183 for ; Sat, 2 Aug 2008 13:13:01 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 74708-08 for ; Sat, 2 Aug 2008 13:13:00 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id D777164FCE3 for ; Sat, 2 Aug 2008 13:13:00 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id m72GComM004112; Sat, 2 Aug 2008 12:12:51 -0400 (EDT) To: Thomas Hallgren cc: Kris Jurka , pljava-dev@pgfoundry.org, Alvaro Herrera , pgsql-hackers@postgresql.org Subject: Re: Re: [Pljava-dev] Should creating a new base type require superuser status? In-reply-to: <48940239.8080401@tada.se> References: <19715.1217447413@sss.pgh.pa.us> <20080730220753.GG3977@alvh.no-ip.org> <23846.1217539394@sss.pgh.pa.us> <48937589.10304@tada.se> <23725.1217626961@sss.pgh.pa.us> <48940239.8080401@tada.se> Comments: In-reply-to Thomas Hallgren message dated "Sat, 02 Aug 2008 08:44:09 +0200" Date: Sat, 02 Aug 2008 12:12:50 -0400 Message-ID: <4111.1217693570@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200808/45 X-Sequence-Number: 121799 Thomas Hallgren writes: > Tom Lane wrote: >> The problem that we've seen in the past shows up when the user lies in >> the CREATE TYPE command, specifying type representation properties that >> are different from what the underlying functions expect. > This is a non-issue in PL/Java. An integer parameter is never passed by > reference and there's no way the PL/Java user can get direct access to > backend memory. So what exactly does happen when the user deliberately specifies wrong typlen/typbyval/typalign info when creating a type based on PL/Java functions? > I think that assumption is without ground. Java doesn't permit you to > access memory unless you use Java classes (java.nio stuff) that is > explicitly designed to do that and you need native code to set such > things up. A PL/Java user can not do that unless he is able to link in > other shared objects or dll's to the backend process. PL/Java itself must be doing "unsafe" things in order to interface with PG at all. So what your argument really is is that you have managed to securely sandbox the user-written code you are calling. That might or might not be true, but I don't think that worrying about it is without foundation. regards, tom lane