postgresql/src/pl/plpython
Tom Lane 2eb2fcd56b Revert error-throwing wrappers for the printf family of functions.
This reverts commit 16304a0134, except
for its changes in src/port/snprintf.c; as well as commit
cac18a76bb which is no longer needed.

Fujii Masao reported that the previous commit caused failures in psql on
OS X, since if one exits the pager program early while viewing a query
result, psql sees an EPIPE error from fprintf --- and the wrapper function
thought that was reason to panic.  (It's a bit surprising that the same
does not happen on Linux.)  Further discussion among the security list
concluded that the risk of other such failures was far too great, and
that the one-size-fits-all approach to error handling embodied in the
previous patch is unlikely to be workable.

This leaves us again exposed to the possibility of the type of failure
envisioned in CVE-2015-3166.  However, that failure mode is strictly
hypothetical at this point: there is no concrete reason to believe that
an attacker could trigger information disclosure through the supposed
mechanism.  In the first place, the attack surface is fairly limited,
since so much of what the backend does with format strings goes through
stringinfo.c or psprintf(), and those already had adequate defenses.
In the second place, even granting that an unprivileged attacker could
control the occurrence of ENOMEM with some precision, it's a stretch to
believe that he could induce it just where the target buffer contains some
valuable information.  So we concluded that the risk of non-hypothetical
problems induced by the patch greatly outweighs the security risks.
We will therefore revert, and instead undertake closer analysis to
identify specific calls that may need hardening, rather than attempt a
universal solution.

We have kept the portion of the previous patch that improved snprintf.c's
handling of errors when it calls the platform's sprintf().  That seems to
be an unalloyed improvement.

Security: CVE-2015-3166
2015-05-19 18:16:19 -04:00
..
expected Make plpython_unicode regression test work in more database encodings. 2014-06-03 12:01:54 -04:00
po Translation updates 2015-05-18 08:38:34 -04:00
sql Make plpython_unicode regression test work in more database encodings. 2014-06-03 12:01:54 -04:00
.gitignore PL/Python: Improve Python 3 regression test setup 2012-09-16 22:26:33 -04:00
generate-spiexceptions.pl Update copyright for 2014 2014-01-07 16:05:30 -05:00
Makefile Re-remove dependency on the DLL of pythonxx.def file. 2014-11-02 21:45:01 -05:00
nls.mk Translation updates 2014-12-15 00:23:25 -05:00
plpy_cursorobject.c Prevent leakage of SPI tuple tables during subtransaction abort. 2013-07-25 16:46:14 -04:00
plpy_cursorobject.h Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
plpy_elog.c pgindent run for 9.4 2014-05-06 12:12:18 -04:00
plpy_elog.h Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
plpy_exec.c Fix thinko in plpython error message 2015-01-06 15:16:29 -03:00
plpy_exec.h Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
plpy_main.c Fix some functions that were declared static then defined not-static. 2015-01-12 16:08:46 -05:00
plpy_main.h Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
plpy_planobject.c PL/Python: Add argument names to function declarations 2011-12-29 22:55:49 +02:00
plpy_planobject.h Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
plpy_plpymodule.c Fix some functions that were declared static then defined not-static. 2015-01-12 16:08:46 -05:00
plpy_plpymodule.h Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
plpy_procedure.c Change the way we mark tuples as frozen. 2013-12-22 15:49:09 -05:00
plpy_procedure.h Fix plpython's handling of functions used as triggers on multiple tables. 2013-01-25 16:59:36 -05:00
plpy_resultobject.c PL/Python: Add result object str handler 2013-02-03 00:31:01 -05:00
plpy_resultobject.h Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
plpy_spi.c Add new to_reg* functions for error-free OID lookups. 2014-04-08 10:27:56 -04:00
plpy_spi.h Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
plpy_subxactobject.c Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
plpy_subxactobject.h add #includes to plpy_subxactobject.h to make it compile standalone 2012-08-28 16:13:41 -04:00
plpy_typeio.c pgindent run for 9.4 2014-05-06 12:12:18 -04:00
plpy_typeio.h Split tuple struct defs from htup.h to htup_details.h 2012-08-30 16:52:35 -04:00
plpy_util.c pgindent run for 9.4 2014-05-06 12:12:18 -04:00
plpy_util.h Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
plpython.h Revert error-throwing wrappers for the printf family of functions. 2015-05-19 18:16:19 -04:00
plpython2u--1.0.sql Put comments on the installable procedural languages. 2011-07-03 19:03:51 -04:00
plpython2u--unpackaged--1.0.sql Create extension infrastructure for the core procedural languages. 2011-03-04 21:51:14 -05:00
plpython2u.control Create extension infrastructure for the core procedural languages. 2011-03-04 21:51:14 -05:00
plpython3u--1.0.sql Put comments on the installable procedural languages. 2011-07-03 19:03:51 -04:00
plpython3u--unpackaged--1.0.sql Create extension infrastructure for the core procedural languages. 2011-03-04 21:51:14 -05:00
plpython3u.control Create extension infrastructure for the core procedural languages. 2011-03-04 21:51:14 -05:00
plpythonu--1.0.sql Put comments on the installable procedural languages. 2011-07-03 19:03:51 -04:00
plpythonu--unpackaged--1.0.sql Create extension infrastructure for the core procedural languages. 2011-03-04 21:51:14 -05:00
plpythonu.control Create extension infrastructure for the core procedural languages. 2011-03-04 21:51:14 -05:00