postgresql/src/include
Tom Lane 0776cb2116 Fix assorted security-grade bugs in the regex engine. All of these problems
are shared with Tcl, since it's their code to begin with, and the patches
have been copied from Tcl 8.5.0.  Problems:

CVE-2007-4769: Inadequate check on the range of backref numbers allows
crash due to out-of-bounds read.
CVE-2007-4772: Infinite loop in regex optimizer for pattern '($|^)*'.
CVE-2007-6067: Very slow optimizer cleanup for regex with a large NFA
representation, as well as crash if we encounter an out-of-memory condition
during NFA construction.

Part of the response to CVE-2007-6067 is to put a limit on the number of
states in the NFA representation of a regex.  This seems needed even though
the within-the-code problems have been corrected, since otherwise the code
could try to use very large amounts of memory for a suitably-crafted regex,
leading to potential DOS by driving the system into swap, activating a kernel
OOM killer, etc.

Although there are certainly plenty of ways to drive the system into effective
DOS with poorly-written SQL queries, these problems seem worth treating as
security issues because many applications might accept regex search patterns
from untrustworthy sources.

Thanks to Will Drewry of Google for reporting these problems.  Patches by Will
Drewry and Tom Lane.

Security: CVE-2007-4769, CVE-2007-4772, CVE-2007-6067
2008-01-03 20:49:15 +00:00
..
access Repair PANIC condition in hash indexes when a previous index extension attempt 2007-04-19 20:24:36 +00:00
bootstrap Update copyrights to 2003. 2003-08-04 02:40:20 +00:00
catalog Mark to_number() and the numeric-type variants of to_char() as stable, not 2006-11-28 19:19:16 +00:00
commands Defend against crash while processing Describe Statement or Describe Portal 2005-12-14 17:07:00 +00:00
executor Repair "Halloween problem" in EvalPlanQual: a tuple that's been inserted by 2006-01-12 21:49:32 +00:00
lib Update copyrights to 2003. 2003-08-04 02:40:20 +00:00
libpq Repair bug that would allow libpq to think a command had succeeded when 2004-09-26 00:26:56 +00:00
mb Change the backend to reject strings containing invalidly-encoded multibyte 2006-05-21 20:06:45 +00:00
nodes Fix dynahash.c to suppress hash bucket splits while a hash_seq_search() scan 2007-04-26 23:25:41 +00:00
optimizer Keep the planner from failing on "WHERE false AND something IN (SELECT ...)". 2007-10-04 20:45:17 +00:00
parser Add a new GUC parameter backslash_quote, which determines whether the SQL 2006-05-21 20:11:58 +00:00
port Fix failure to restart Postgres when Linux kernel returns EIDRM for shmctl(). 2007-07-02 20:12:21 +00:00
regex Fix assorted security-grade bugs in the regex engine. All of these problems 2008-01-03 20:49:15 +00:00
rewrite Update copyrights to 2003. 2003-08-04 02:40:20 +00:00
storage Fix failure to guarantee that a checkpoint will write out pg_clog updates 2004-08-11 04:08:02 +00:00
tcop Push enable/disable of notify and catchup interrupts all the way down 2005-06-02 21:04:08 +00:00
utils Fix dynahash.c to suppress hash bucket splits while a hash_seq_search() scan 2007-04-26 23:25:41 +00:00
c.h Change the backend to reject strings containing invalidly-encoded multibyte 2006-05-21 20:06:45 +00:00
fmgr.h Update copyrights to 2003. 2003-08-04 02:40:20 +00:00
funcapi.h Fix some copyright notices that weren't updated. Improve copyright tool 2003-08-04 23:59:41 +00:00
getaddrinfo.h Workaround for platforms that have getaddrinfo() without AI_NUMERICHOST. 2003-08-14 18:32:55 +00:00
getopt_long.h Another pgindent run with updated typedefs. 2003-08-08 21:42:59 +00:00
Makefile Install all the headers files that the ones that are already installed 2003-11-25 19:10:15 +00:00
miscadmin.h Repair some REINDEX problems per recent discussions. The relcache is 2003-09-24 18:54:02 +00:00
pg_config.h.in Add port support for unsetenv() in back branches. Needed for locale 2006-01-05 00:51:25 +00:00
pg_config.h.win32 Stamp releases 8.2.5, 8.1.10, 8.0.14, 7.4.18, 7.3.20. 2007-09-11 17:36:45 +00:00
pg_config_manual.h Arrange to align shared disk buffers on at least 32-byte boundaries, 2003-09-21 17:57:21 +00:00
pgstat.h pgindent run. 2003-08-04 00:43:34 +00:00
port.h Add port support for unsetenv() in back branches. Needed for locale 2006-01-05 00:51:25 +00:00
postgres.h Update copyrights to 2003. 2003-08-04 02:40:20 +00:00
postgres_ext.h Share PG_DIAG_* macros between client and server and use them internally. 2003-08-27 00:33:34 +00:00
postgres_fe.h Update copyrights to 2003. 2003-08-04 02:40:20 +00:00
rusagestub.h Update copyrights to 2003. 2003-08-04 02:40:20 +00:00
strdup.h Another PGINDENT run that changes variable indenting and case label indenting. Also static variable indenting. 1997-09-08 02:41:22 +00:00