pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Revert error-throwing wrappers for the printf family of function
6+ messages / 1 participants
[nested] [flat]

* pgsql: Revert error-throwing wrappers for the printf family of function
@ 2015-05-19 22:20 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2015-05-19 22:20 UTC (permalink / raw)
  To: pgsql-committers

Revert error-throwing wrappers for the printf family of functions.

This reverts commit 16304a013432931e61e623c8d85e9fe24709d9ba, except
for its changes in src/port/snprintf.c; as well as commit
cac18a76bb6b08f1ecc2a85e46c9d2ab82dd9d23 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

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/0c071936e94c6859afb2ec8d2c8dddf7bcdab7ee

Modified Files
--------------
src/include/port.h                        |   80 +++++----------
src/interfaces/ecpg/compatlib/Makefile    |    1 -
src/interfaces/ecpg/ecpglib/.gitignore    |    1 -
src/interfaces/ecpg/ecpglib/Makefile      |    6 +-
src/interfaces/ecpg/pgtypeslib/.gitignore |    1 -
src/interfaces/ecpg/pgtypeslib/Makefile   |    6 +-
src/interfaces/libpq/.gitignore           |    1 -
src/interfaces/libpq/Makefile             |    6 +-
src/interfaces/libpq/bcc32.mak            |    7 --
src/interfaces/libpq/win32.mak            |    7 --
src/pl/plperl/plperl.h                    |   12 ++-
src/pl/plpython/plpython.h                |   12 ++-
src/port/Makefile                         |    2 +-
src/port/snprintf.c                       |    3 +-
src/port/syswrap.c                        |  155 -----------------------------
src/tools/msvc/Mkvcbuild.pm               |    2 +-
16 files changed, 52 insertions(+), 250 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Revert error-throwing wrappers for the printf family of function
@ 2015-05-19 22:20 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2015-05-19 22:20 UTC (permalink / raw)
  To: pgsql-committers

Revert error-throwing wrappers for the printf family of functions.

This reverts commit 16304a013432931e61e623c8d85e9fe24709d9ba, except
for its changes in src/port/snprintf.c; as well as commit
cac18a76bb6b08f1ecc2a85e46c9d2ab82dd9d23 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

Branch
------
REL9_4_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/2eb2fcd56b76ff7aef03f7de772e7459997e61ad

Modified Files
--------------
src/include/port.h                        |   82 +++++----------
src/interfaces/ecpg/compatlib/Makefile    |    1 -
src/interfaces/ecpg/ecpglib/.gitignore    |    1 -
src/interfaces/ecpg/ecpglib/Makefile      |    6 +-
src/interfaces/ecpg/pgtypeslib/.gitignore |    1 -
src/interfaces/ecpg/pgtypeslib/Makefile   |    6 +-
src/interfaces/libpq/.gitignore           |    1 -
src/interfaces/libpq/Makefile             |    6 +-
src/interfaces/libpq/bcc32.mak            |    7 --
src/interfaces/libpq/win32.mak            |    7 --
src/pl/plperl/plperl.h                    |   12 ++-
src/pl/plpython/plpython.h                |   12 ++-
src/port/Makefile                         |    2 +-
src/port/snprintf.c                       |    3 +-
src/port/syswrap.c                        |  155 -----------------------------
src/tools/msvc/Mkvcbuild.pm               |    2 +-
16 files changed, 53 insertions(+), 251 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Revert error-throwing wrappers for the printf family of function
@ 2015-05-19 22:20 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2015-05-19 22:20 UTC (permalink / raw)
  To: pgsql-committers

Revert error-throwing wrappers for the printf family of functions.

This reverts commit 16304a013432931e61e623c8d85e9fe24709d9ba, except
for its changes in src/port/snprintf.c; as well as commit
cac18a76bb6b08f1ecc2a85e46c9d2ab82dd9d23 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

Branch
------
REL9_3_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/13341276ec57fe21956239fa733ed69e1c1938fd

Modified Files
--------------
src/include/port.h                        |   82 +++++----------
src/interfaces/ecpg/compatlib/Makefile    |    1 -
src/interfaces/ecpg/ecpglib/.gitignore    |    1 -
src/interfaces/ecpg/ecpglib/Makefile      |    6 +-
src/interfaces/ecpg/pgtypeslib/.gitignore |    1 -
src/interfaces/ecpg/pgtypeslib/Makefile   |    6 +-
src/interfaces/libpq/.gitignore           |    1 -
src/interfaces/libpq/Makefile             |    6 +-
src/interfaces/libpq/bcc32.mak            |    7 --
src/interfaces/libpq/win32.mak            |    7 --
src/pl/plperl/plperl.h                    |   12 ++-
src/pl/plpython/plpython.h                |   12 ++-
src/port/Makefile                         |    2 +-
src/port/snprintf.c                       |    3 +-
src/port/syswrap.c                        |  155 -----------------------------
src/tools/msvc/Mkvcbuild.pm               |    2 +-
16 files changed, 53 insertions(+), 251 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Revert error-throwing wrappers for the printf family of function
@ 2015-05-19 22:20 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2015-05-19 22:20 UTC (permalink / raw)
  To: pgsql-committers

Revert error-throwing wrappers for the printf family of functions.

This reverts commit 16304a013432931e61e623c8d85e9fe24709d9ba, except
for its changes in src/port/snprintf.c; as well as commit
cac18a76bb6b08f1ecc2a85e46c9d2ab82dd9d23 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

Branch
------
REL9_2_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/221f7a9494d28b938de8a72ead5f6dae39da03da

Modified Files
--------------
src/include/port.h                        |   82 +++++----------
src/interfaces/ecpg/compatlib/Makefile    |    1 -
src/interfaces/ecpg/ecpglib/.gitignore    |    1 -
src/interfaces/ecpg/ecpglib/Makefile      |    6 +-
src/interfaces/ecpg/pgtypeslib/.gitignore |    1 -
src/interfaces/ecpg/pgtypeslib/Makefile   |    6 +-
src/interfaces/libpq/.gitignore           |    1 -
src/interfaces/libpq/Makefile             |    6 +-
src/interfaces/libpq/bcc32.mak            |    7 --
src/interfaces/libpq/win32.mak            |    7 --
src/pl/plperl/plperl.h                    |   12 ++-
src/pl/plpython/plpython.h                |   12 ++-
src/port/Makefile                         |    2 +-
src/port/snprintf.c                       |    3 +-
src/port/syswrap.c                        |  155 -----------------------------
src/tools/msvc/Mkvcbuild.pm               |    2 +-
16 files changed, 53 insertions(+), 251 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Revert error-throwing wrappers for the printf family of function
@ 2015-05-19 22:20 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2015-05-19 22:20 UTC (permalink / raw)
  To: pgsql-committers

Revert error-throwing wrappers for the printf family of functions.

This reverts commit 16304a013432931e61e623c8d85e9fe24709d9ba, except
for its changes in src/port/snprintf.c; as well as commit
cac18a76bb6b08f1ecc2a85e46c9d2ab82dd9d23 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

Branch
------
REL9_1_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/0510cff6e8018882a578512b52120989ea164681

Modified Files
--------------
src/include/port.h                        |   82 +++++----------
src/interfaces/ecpg/compatlib/Makefile    |    1 -
src/interfaces/ecpg/ecpglib/.gitignore    |    1 -
src/interfaces/ecpg/ecpglib/Makefile      |    6 +-
src/interfaces/ecpg/pgtypeslib/.gitignore |    1 -
src/interfaces/ecpg/pgtypeslib/Makefile   |    6 +-
src/interfaces/libpq/.gitignore           |    1 -
src/interfaces/libpq/Makefile             |    6 +-
src/interfaces/libpq/bcc32.mak            |    7 --
src/interfaces/libpq/win32.mak            |    7 --
src/pl/plperl/plperl.h                    |   12 ++-
src/port/Makefile                         |    2 +-
src/port/snprintf.c                       |    3 +-
src/port/syswrap.c                        |  155 -----------------------------
src/tools/msvc/Mkvcbuild.pm               |    2 +-
15 files changed, 45 insertions(+), 247 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Revert error-throwing wrappers for the printf family of function
@ 2015-05-19 22:20 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2015-05-19 22:20 UTC (permalink / raw)
  To: pgsql-committers

Revert error-throwing wrappers for the printf family of functions.

This reverts commit 16304a013432931e61e623c8d85e9fe24709d9ba, except
for its changes in src/port/snprintf.c; as well as commit
cac18a76bb6b08f1ecc2a85e46c9d2ab82dd9d23 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

Branch
------
REL9_0_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/cf893530aff6d3acb893e0fbd80fd9d814605b74

Modified Files
--------------
src/include/port.h                        |   82 +++++----------
src/interfaces/ecpg/compatlib/Makefile    |    1 -
src/interfaces/ecpg/ecpglib/.gitignore    |    1 -
src/interfaces/ecpg/ecpglib/Makefile      |    6 +-
src/interfaces/ecpg/pgtypeslib/.gitignore |    1 -
src/interfaces/ecpg/pgtypeslib/Makefile   |    6 +-
src/interfaces/libpq/.gitignore           |    1 -
src/interfaces/libpq/Makefile             |    6 +-
src/interfaces/libpq/bcc32.mak            |    7 --
src/interfaces/libpq/win32.mak            |    7 --
src/port/Makefile                         |    2 +-
src/port/snprintf.c                       |    3 +-
src/port/syswrap.c                        |  155 -----------------------------
src/tools/msvc/Mkvcbuild.pm               |    2 +-
14 files changed, 37 insertions(+), 243 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


^ permalink  raw  reply  [nested|flat] 6+ messages in thread


end of thread, other threads:[~2015-05-19 22:20 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2015-05-19 22:20 pgsql: Revert error-throwing wrappers for the printf family of function Tom Lane <tgl@sss.pgh.pa.us>
2015-05-19 22:20 pgsql: Revert error-throwing wrappers for the printf family of function Tom Lane <tgl@sss.pgh.pa.us>
2015-05-19 22:20 pgsql: Revert error-throwing wrappers for the printf family of function Tom Lane <tgl@sss.pgh.pa.us>
2015-05-19 22:20 pgsql: Revert error-throwing wrappers for the printf family of function Tom Lane <tgl@sss.pgh.pa.us>
2015-05-19 22:20 pgsql: Revert error-throwing wrappers for the printf family of function Tom Lane <tgl@sss.pgh.pa.us>
2015-05-19 22:20 pgsql: Revert error-throwing wrappers for the printf family of function Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox