Re: Output functions with multiple arguments considered
- From: James William Pye <pgsql(at)jwp(dot)name>
- To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
- Cc: pgsql-hackers(at)postgresql(dot)org
- Subject: Re: Output functions with multiple arguments considered
- Date: Sat, 30 Apr 2005 16:26:30 -0700
- Message-id: <1114903590(dot)724(dot)19(dot)camel(at)localhost>
On Sat, 2005-04-30 at 16:17 -0400, Tom Lane wrote:
> An example that Elein put up yesterday:
> http://archives.postgresql.org/pgsql-general/2005-04/msg01384.php
> caused me to realize that type output functions that depend on
> additional arguments to determine what they are dealing with are
> fundamentally security holes. It is trivial to crash 8.0's record_out
> by lying to it about the rowtype of its first argument.
I was bitten by this a little while ago where I was running an
OidFunctionCall1(yes, 1) on typoutput's. Andrew on IRC pointed out that
calls to recordout out normally used a FunctionCall3, thus showing the
reason for the issue. Sometimes junk data in the heap signalled the
function to use it instead of the datum tuple's typoid, normally causing
a failed cache lookup. I figured it was somehow my fault, but I just
couldn't put my finger on it.(thanks again Andrew if you're on here)
I imagine this change will also help save others from that mistake as
well.
Home |
Main Index |
Thread Index