lp://staging/ubuntu/lucid-security/postgresql-8.4

Created by James Westby and last modified
Get this branch:
bzr branch lp://staging/ubuntu/lucid-security/postgresql-8.4
Members of Ubuntu branches can upload to this branch. Log in for directions.

Branch merges

Related bugs

Related blueprints

Branch information

Owner:
Ubuntu branches
Review team:
Ubuntu Development Team
Status:
Mature

Recent revisions

22. By Martin Pitt

* Add 15-to_char_buffer_overflow.patch and 16-to_char_buffer_overflow_time.patch:
  Fix buffer overruns in to_char() [CVE-2015-0241]
* Add 17-pgcrypto_pullf_read_max_overflow.patch and 18-pgcrypto_imath_fixes.patch:
  Fix buffer overruns in contrib/pgcrypto [CVE-2015-0243]
* Add 19-ensure_frontend_backend_sync.patch:
  Fix possible loss of frontend/backend protocol synchronization after an
  error [CVE-2015-0244]
* Add 20-column_privilege_leak.patch:
  Fix information leak via constraint-violation error messages
  [CVE-2014-8161]
* Note: CVE-2015-0242 does not affect Ubuntu packages as we use glibc's
  snprintf().

21. By Martin Pitt

* New upstream security/bugfix release. (LP: #1282677)
  - Shore up GRANT ... WITH ADMIN OPTION restrictions.
    Granting a role without ADMIN OPTION is supposed to prevent the grantee
    from adding or removing members from the granted role, but this
    restriction was easily bypassed by doing SET ROLE first. The security
    impact is mostly that a role member can revoke the access of others,
    contrary to the wishes of his grantor. Unapproved role member additions
    are a lesser concern, since an uncooperative role member could provide
    most of his rights to others anyway by creating views or SECURITY
    DEFINER functions. (CVE-2014-0060)
  - Prevent privilege escalation via manual calls to PL validator functions.
    The primary role of PL validator functions is to be called implicitly
    during CREATE FUNCTION, but they are also normal SQL functions that a
    user can call explicitly. Calling a validator on a function actually
    written in some other language was not checked for and could be
    exploited for privilege-escalation purposes. The fix involves adding a
    call to a privilege-checking function in each validator function.
    Non-core procedural languages will also need to make this change to
    their own validator functions, if any. (CVE-2014-0061)
  - Avoid multiple name lookups during table and index DDL.
    If the name lookups come to different conclusions due to concurrent
    activity, we might perform some parts of the DDL on a different table
    than other parts. At least in the case of CREATE INDEX, this can be used
    to cause the permissions checks to be performed against a different
    table than the index creation, allowing for a privilege escalation
    attack. (CVE-2014-0062)
  - Prevent buffer overrun with long datetime strings.
    The MAXDATELEN constant was too small for the longest possible value of
    type interval, allowing a buffer overrun in interval_out(). Although the
    datetime input functions were more careful about avoiding buffer
    overrun, the limit was short enough to cause them to reject some valid
    inputs, such as input containing a very long timezone name. The ecpg
    library contained these vulnerabilities along with some of its own.
    (CVE-2014-0063)
  - Prevent buffer overrun due to integer overflow in size calculations.
    Several functions, mostly type input functions, calculated an allocation
    size without checking for overflow. If overflow did occur, a too-small
    buffer would be allocated and then written past. (CVE-2014-0064)
  - Prevent overruns of fixed-size buffers.
    Use strlcpy() and related functions to provide a clear guarantee that
    fixed-size buffers are not overrun. Unlike the preceding items, it is
    unclear whether these cases really represent live issues, since in most
    cases there appear to be previous constraints on the size of the input
    string. Nonetheless it seems prudent to silence all Coverity warnings of
    this type. (CVE-2014-0065)
  - Avoid crashing if crypt() returns NULL.
    There are relatively few scenarios in which crypt() could return NULL,
    but contrib/chkpass would crash if it did. One practical case in which
    this could be an issue is if libc is configured to refuse to execute
    unapproved hashing algorithms (e.g., "FIPS mode"). (CVE-2014-0066)
  - Document risks of make check in the regression testing instructions
    Since the temporary server started by make check uses "trust"
    authentication, another user on the same machine could connect to it as
    database superuser, and then potentially exploit the privileges of the
    operating-system user who started the tests. A future release will
    probably incorporate changes in the testing procedure to prevent this
    risk, but some public discussion is needed first. So for the moment,
    just warn people against using make check when there are untrusted users
    on the same machine. (CVE-2014-0067)
* The upstream tarballs no longer contain a plain HISTORY file, but point to
  the html documentation. Add 70-history.patch to note the location of these
  files in our changelog.gz file.

20. By Martin Pitt

* New upstream security/bug fix release: (LP: #1163184)
  - Reset OpenSSL randomness state in each postmaster child process.
    This avoids a scenario wherein random numbers generated by
    "contrib/pgcrypto" functions might be relatively easy for another
    database user to guess. The risk is only significant when the
    postmaster is configured with ssl = on but most connections don't
    use SSL encryption. [CVE-2013-1900]
  - Fix GiST indexes to not use "fuzzy" geometric comparisons when it's
    not appropriate to do so.
    The core geometric types perform comparisons using "fuzzy"
    equality, but gist_box_same must do exact comparisons, else GiST
    indexes using it might become inconsistent. After installing this
    update, users should "REINDEX" any GiST indexes on box, polygon,
    circle, or point columns, since all of these use gist_box_same.
  - Fix erroneous range-union and penalty logic in GiST indexes that
    use "contrib/btree_gist" for variable-width data types, that is
    text, bytea, bit, and numeric columns.
    These errors could result in inconsistent indexes in which some
    keys that are present would not be found by searches, and also in
    useless index bloat. Users are advised to "REINDEX" such indexes
    after installing this update.
  - Fix bugs in GiST page splitting code for multi-column indexes.
    These errors could result in inconsistent indexes in which some
    keys that are present would not be found by searches, and also in
    indexes that are unnecessarily inefficient to search. Users are
    advised to "REINDEX" multi-column GiST indexes after installing
    this update.
  - See HISTORY/changelog.gz for the other bug fixes.

19. By Martin Pitt

* New upstream security/bug fix release: (LP: #1116336)
  - Prevent execution of enum_recv from SQL
    The function was misdeclared, allowing a simple SQL command to crash the
    server. In principle an attacker might be able to use it to examine the
    contents of server memory. Our thanks to Sumit Soni (via Secunia SVCRP)
    for reporting this issue. (CVE-2013-0255)
  - See HISTORY/changelog.gz for the other bug fixes.

18. By Jamie Strandboge

* New upstream security/bug fix release:
 - Prevent access to external files/URLs via XML entity references
   (Noah Misch, Tom Lane)
   xml_parse() would attempt to fetch external files or URLs as needed
   to resolve DTD and entity references in an XML value, thus allowing
   unprivileged database users to attempt to fetch data with the
   privileges of the database server. While the external data wouldn't
   get returned directly to the user, portions of it could be exposed
   in error messages if the data didn't parse as valid XML; and in any
   case the mere ability to check existence of a file might be useful
   to an attacker. (CVE-2012-3489)
 - Prevent access to external files/URLs via "contrib/xml2"'s
   xslt_process() (Peter Eisentraut)
   libxslt offers the ability to read and write both files and URLs
   through stylesheet commands, thus allowing unprivileged database
   users to both read and write data with the privileges of the
   database server. Disable that through proper use of libxslt's
   security options. (CVE-2012-3488)
   Also, remove xslt_process()'s ability to fetch documents and
   stylesheets from external files/URLs. While this was a documented
   "feature", it was long regarded as a bad idea. The fix for
   CVE-2012-3489 broke that capability, and rather than expend effort
   on trying to fix it, we're just going to summarily remove it.
 - Prevent too-early recycling of btree index pages (Noah Misch)
   When we allowed read-only transactions to skip assigning XIDs, we
   introduced the possibility that a deleted btree page could be
   recycled while a read-only transaction was still in flight to it.
   This would result in incorrect index search results. The
   probability of such an error occurring in the field seems very low
   because of the timing requirements, but nonetheless it should be
   fixed.
 - Fix crash-safety bug with newly-created-or-reset sequences (Tom
   Lane)
   If "ALTER SEQUENCE" was executed on a freshly created or reset
   sequence, and then precisely one nextval() call was made on it, and
   then the server crashed, WAL replay would restore the sequence to a
   state in which it appeared that no nextval() had been done, thus
   allowing the first sequence value to be returned again by the next
   nextval() call. In particular this could manifest for serial
   columns, since creation of a serial column's sequence includes an
   "ALTER SEQUENCE OWNED BY" step.
 - Ensure the "backup_label" file is fsync'd after pg_start_backup()
   (Dave Kerr)
 - Back-patch 9.1 improvement to compress the fsync request queue
   (Robert Haas)
   This improves performance during checkpoints. The 9.1 change has
   now seen enough field testing to seem safe to back-patch.
 - Only allow autovacuum to be auto-canceled by a directly blocked
   process (Tom Lane)
   The original coding could allow inconsistent behavior in some
   cases; in particular, an autovacuum could get canceled after less
   than deadlock_timeout grace period.
 - Improve logging of autovacuum cancels (Robert Haas)
 - Fix log collector so that log_truncate_on_rotation works during the
   very first log rotation after server start (Tom Lane)
 - Fix WITH attached to a nested set operation
   (UNION/INTERSECT/EXCEPT) (Tom Lane)
 - Ensure that a whole-row reference to a subquery doesn't include any
   extra GROUP BY or ORDER BY columns (Tom Lane)
 - Disallow copying whole-row references in CHECK constraints and
   index definitions during "CREATE TABLE" (Tom Lane)
   This situation can arise in "CREATE TABLE" with LIKE or INHERITS.
   The copied whole-row variable was incorrectly labeled with the row
   type of the original table not the new one. Rejecting the case
   seems reasonable for LIKE, since the row types might well diverge
   later. For INHERITS we should ideally allow it, with an implicit
   coercion to the parent table's row type; but that will require more
   work than seems safe to back-patch.
 - Fix memory leak in ARRAY(SELECT ...) subqueries (Heikki
   Linnakangas, Tom Lane)
 - Fix extraction of common prefixes from regular expressions (Tom
   Lane)
   The code could get confused by quantified parenthesized
   subexpressions, such as ^(foo)?bar. This would lead to incorrect
   index optimization of searches for such patterns.
 - Fix bugs with parsing signed "hh":"mm" and "hh":"mm":"ss" fields in
   interval constants (Amit Kapila, Tom Lane)
 - Report errors properly in "contrib/xml2"'s xslt_process() (Tom
   Lane)
 - Update time zone data files to tzdata release 2012e for DST law
   changes in Morocco and Tokelau

17. By Martin Pitt

* New upstream security/bug fix release: (LP: #1008317)
  - Fix incorrect password transformation in "contrib/pgcrypto"'s DES
    crypt() function.
    If a password string contained the byte value 0x80, the remainder
    of the password was ignored, causing the password to be much weaker
    than it appeared. With this fix, the rest of the string is properly
    included in the DES hash. Any stored password values that are
    affected by this bug will thus no longer match, so the stored
    values may need to be updated. (CVE-2012-2143)
  - Ignore SECURITY DEFINER and SET attributes for a procedural
    language's call handler.
    Applying such attributes to a call handler could crash the server.
    (CVE-2012-2655)
  - Allow numeric timezone offsets in timestamp input to be up to 16
    hours away from UTC.
    Some historical time zones have offsets larger than 15 hours, the
    previous limit. This could result in dumped data values being
    rejected during reload.
  - Fix timestamp conversion to cope when the given time is exactly the
    last DST transition time for the current timezone.
    This oversight has been there a long time, but was not noticed
    previously because most DST-using zones are presumed to have an
    indefinite sequence of future DST transitions.
  - Fix text to name and char to name casts to perform string
    truncation correctly in multibyte encodings.
  - Fix memory copying bug in to_tsquery().
  - Fix planner's handling of outer PlaceHolderVars within subqueries.
    This bug concerns sub-SELECTs that reference variables coming from
    the nullable side of an outer join of the surrounding query. In
    9.1, queries affected by this bug would fail with "ERROR:
    Upper-level PlaceHolderVar found where not expected". But in 9.0
    and 8.4, you'd silently get possibly-wrong answers, since the value
    transmitted into the subquery wouldn't go to null when it should.
  - Fix slow session startup when pg_attribute is very large.
    If pg_attribute exceeds one-fourth of shared_buffers, cache
    rebuilding code that is sometimes needed during session start would
    trigger the synchronized-scan logic, causing it to take many times
    longer than normal. The problem was particularly acute if many new
    sessions were starting at once.
  - Ensure sequential scans check for query cancel reasonably often.
    A scan encountering many consecutive pages that contain no live
    tuples would not respond to interrupts meanwhile.
  - Ensure the Windows implementation of PGSemaphoreLock() clears
    ImmediateInterruptOK before returning.
    This oversight meant that a query-cancel interrupt received later
    in the same query could be accepted at an unsafe time, with
    unpredictable but not good consequences.
  - Show whole-row variables safely when printing views or rules.
    Corner cases involving ambiguous names (that is, the name could be
    either a table or column name of the query) were printed in an
    ambiguous way, risking that the view or rule would be interpreted
    differently after dump and reload. Avoid the ambiguous case by
    attaching a no-op cast.
  - Fix "COPY FROM" to properly handle null marker strings that
    correspond to invalid encoding.
    A null marker string such as E'\\0' should work, and did work in
    the past, but the case got broken in 8.4.
  - Ensure autovacuum worker processes perform stack depth checking
    properly.
    Previously, infinite recursion in a function invoked by
    auto-"ANALYZE" could crash worker processes.
  - Fix logging collector to not lose log coherency under high load.
    The collector previously could fail to reassemble large messages if
    it got too busy.
  - Fix logging collector to ensure it will restart file rotation after
    receiving SIGHUP.
  - Fix WAL replay logic for GIN indexes to not fail if the index was
    subsequently dropped>
  - Fix memory leak in PL/pgSQL's "RETURN NEXT" command.
  - Fix PL/pgSQL's "GET DIAGNOSTICS" command when the target is the
    function's first variable.
  - Fix potential access off the end of memory in psql's expanded
    display ("\x") mode.
  - Fix several performance problems in pg_dump when the database
    contains many objects.
    pg_dump could get very slow if the database contained many schemas,
    or if many objects are in dependency loops, or if there are many
    owned sequences.
  - Fix "contrib/dblink"'s dblink_exec() to not leak temporary database
    connections upon error.
  - Fix "contrib/dblink" to report the correct connection name in error
    messages.

16. By Martin Pitt

* New upstream bug fix/security release: (LP: #941912)
  - Require execute permission on the trigger function for "CREATE
    TRIGGER".
    This missing check could allow another user to execute a trigger
    function with forged input data, by installing it on a table he
    owns. This is only of significance for trigger functions marked
    SECURITY DEFINER, since otherwise trigger functions run as the
    table owner anyway. (CVE-2012-0866)
  - Remove arbitrary limitation on length of common name in SSL
    certificates.
    Both libpq and the server truncated the common name extracted from
    an SSL certificate at 32 bytes. Normally this would cause nothing
    worse than an unexpected verification failure, but there are some
    rather-implausible scenarios in which it might allow one
    certificate holder to impersonate another. The victim would have to
    have a common name exactly 32 bytes long, and the attacker would
    have to persuade a trusted CA to issue a certificate in which the
    common name has that string as a prefix. Impersonating a server
    would also require some additional exploit to redirect client
    connections. (CVE-2012-0867)
  - Convert newlines to spaces in names written in pg_dump comments.
    pg_dump was incautious about sanitizing object names that are
    emitted within SQL comments in its output script. A name containing
    a newline would at least render the script syntactically incorrect.
    Maliciously crafted object names could present a SQL injection risk
    when the script is reloaded. (CVE-2012-0868)
  - Fix btree index corruption from insertions concurrent with
    vacuuming.
    An index page split caused by an insertion could sometimes cause a
    concurrently-running "VACUUM" to miss removing index entries that
    it should remove. After the corresponding table rows are removed,
    the dangling index entries would cause errors (such as "could not
    read block N in file ...") or worse, silently wrong query results
    after unrelated rows are re-inserted at the now-free table
    locations. This bug has been present since release 8.2, but occurs
    so infrequently that it was not diagnosed until now. If you have
    reason to suspect that it has happened in your database, reindexing
    the affected index will fix things.
  - Update per-column permissions, not only per-table permissions, when
    changing table owner.
    Failure to do this meant that any previously granted column
    permissions were still shown as having been granted by the old
    owner. This meant that neither the new owner nor a superuser could
    revoke the now-untraceable-to-table-owner permissions.
  - Allow non-existent values for some settings in "ALTER USER/DATABASE
    SET".
    Allow default_text_search_config, default_tablespace, and
    temp_tablespaces to be set to names that are not known. This is
    because they might be known in another database where the setting
    is intended to be used, or for the tablespace cases because the
    tablespace might not be created yet. The same issue was previously
    recognized for search_path, and these settings now act like that
    one.
  - Avoid crashing when we have problems deleting table files
    post-commit.
    Dropping a table should lead to deleting the underlying disk files
    only after the transaction commits. In event of failure then (for
    instance, because of wrong file permissions) the code is supposed
    to just emit a warning message and go on, since it's too late to
    abort the transaction. This logic got broken as of release 8.4,
    causing such situations to result in a PANIC and an unrestartable
    database.
  - Track the OID counter correctly during WAL replay, even when it
    wraps around.
    Previously the OID counter would remain stuck at a high value until
    the system exited replay mode. The practical consequences of that
    are usually nil, but there are scenarios wherein a standby server
    that's been promoted to master might take a long time to advance
    the OID counter to a reasonable value once values are needed.
  - Fix regular expression back-references with - attached.
    Rather than enforcing an exact string match, the code would
    effectively accept any string that satisfies the pattern
    sub-expression referenced by the back-reference symbol.
    A similar problem still afflicts back-references that are embedded
    in a larger quantified expression, rather than being the immediate
    subject of the quantifier. This will be addressed in a future
    PostgreSQL release.
  - Fix recently-introduced memory leak in processing of inet/cidr
    values.
  - Fix dangling pointer after "CREATE TABLE AS"/"SELECT INTO" in a
    SQL-language function.
    In most cases this only led to an assertion failure in
    assert-enabled builds, but worse consequences seem possible.
  - Fix I/O-conversion-related memory leaks in plpgsql.
  - Improve pg_dump's handling of inherited table columns.
    pg_dump mishandled situations where a child column has a different
    default expression than its parent column. If the default is
    textually identical to the parent's default, but not actually the
    same (for instance, because of schema search path differences) it
    would not be recognized as different, so that after dump and
    restore the child would be allowed to inherit the parent's default.
    Child columns that are NOT NULL where their parent is not could
    also be restored subtly incorrectly.
  - Fix pg_restore's direct-to-database mode for INSERT-style table
    data.
    Direct-to-database restores from archive files made with
    "--inserts" or "--column-inserts" options fail when using
    pg_restore from a release dated September or December 2011, as a
    result of an oversight in a fix for another problem. The archive
    file itself is not at fault, and text-mode output is okay.
  - Allow AT option in ecpg DEALLOCATE statements.
    The infrastructure to support this has been there for awhile, but
    through an oversight there was still an error check rejecting the
    case.
  - Fix error in "contrib/intarray"'s int[] & int[] operator.
    If the smallest integer the two input arrays have in common is 1,
    and there are smaller values in either array, then 1 would be
    incorrectly omitted from the result.
  - Fix error detection in "contrib/pgcrypto"'s encrypt_iv() and
    decrypt_iv().
    These functions failed to report certain types of invalid-input
    errors, and would instead return random garbage values for
    incorrect input.
  - Fix one-byte buffer overrun in "contrib/test_parser".
    The code would try to read one more byte than it should, which
    would crash in corner cases. Since "contrib/test_parser" is only
    example code, this is not a security issue in itself, but bad
    example code is still bad.
  - Use __sync_lock_test_and_set() for spinlocks on ARM, if available.
    This function replaces our previous use of the SWPB instruction,
    which is deprecated and not available on ARMv6 and later. Reports
    suggest that the old code doesn't fail in an obvious way on recent
    ARM boards, but simply doesn't interlock concurrent accesses,
    leading to bizarre failures in multiprocess operation.
  - Use "-fexcess-precision=standard" option when building with gcc
    versions that accept it.
    This prevents assorted scenarios wherein recent versions of gcc
    will produce creative results.
  - Allow use of threaded Python on FreeBSD.
    Our configure script previously believed that this combination
    wouldn't work; but FreeBSD fixed the problem, so remove that error
    check.
* Drop 00git_inet_cidr_unpack.patch, 04-armel-tas.patch: applied upstream.

15. By Martin Pitt

* New upstream bug fix/security release: (LP: #866049)
  - Fix bugs in indexing of in-doubt HOT-updated tuples.
    These bugs could result in index corruption after reindexing a
    system catalog. They are not believed to affect user indexes.
  - Fix multiple bugs in GiST index page split processing.
    The probability of occurrence was low, but these could lead to
    index corruption.
  - Fix possible buffer overrun in tsvector_concat().
    The function could underestimate the amount of memory needed for
    its result, leading to server crashes.
  - Fix crash in xml_recv when processing a "standalone" parameter.
  - Make pg_options_to_table return NULL for an option with no value.
    Previously such cases would result in a server crash.
  - Avoid possibly accessing off the end of memory in "ANALYZE" and in
    SJIS-2004 encoding conversion.
    This fixes some very-low-probability server crash scenarios.
  - Prevent intermittent hang in interactions of startup process with
    bgwriter process.
    This affected recovery in non-hot-standby cases.
  - Fix race condition in relcache init file invalidation.
    There was a window wherein a new backend process could read a stale
    init file but miss the inval messages that would tell it the data
    is stale. The result would be bizarre failures in catalog accesses,
    typically "could not read block 0 in file ..." later during
    startup.
  - Fix memory leak at end of a GiST index scan.
    Commands that perform many separate GiST index scans, such as
    verification of a new GiST-based exclusion constraint on a table
    already containing many rows, could transiently require large
    amounts of memory due to this leak.
  - Fix incorrect memory accounting (leading to possible memory bloat)
    in tuplestores supporting holdable cursors and plpgsql's RETURN
    NEXT command.
  - Fix performance problem when constructing a large, lossy bitmap.
  - Fix join selectivity estimation for unique columns.
    This fixes an erroneous planner heuristic that could lead to poor
    estimates of the result size of a join.
  - Fix nested PlaceHolderVar expressions that appear only in
    sub-select target lists. This mistake could result in outputs of an
    outer join incorrectly appearing as NULL.
  - Allow nested EXISTS queries to be optimized properly.
  - Fix array- and path-creating functions to ensure padding bytes are
    zeroes. This avoids some situations where the planner will think that
    semantically-equal constants are not equal, resulting in poor
    optimization.
  - Fix "EXPLAIN" to handle gating Result nodes within inner-indexscan
    subplans. The usual symptom of this oversight was "bogus varno" errors.
  - Work around gcc 4.6.0 bug that breaks WAL replay. This could lead to
    loss of committed transactions after a server crash.
  - Fix dump bug for VALUES in a view.
  - Disallow SELECT FOR UPDATE/SHARE on sequences.
    This operation doesn't work as expected and can lead to failures.
  - Fix "VACUUM" so that it always updates pg_class.reltuples/relpages.
    This fixes some scenarios where autovacuum could make increasingly
    poor decisions about when to vacuum tables.
  - Defend against integer overflow when computing size of a hash table.
  - Fix cases where "CLUSTER" might attempt to access already-removed
    TOAST data.
  - Fix portability bugs in use of credentials control messages for
    "peer" authentication.
  - Fix SSPI login when multiple roundtrips are required.
    The typical symptom of this problem was "The function requested is
    not supported" errors during SSPI login.
  - Throw an error if "pg_hba.conf" contains hostssl but SSL is
    disabled. This was concluded to be more user-friendly than the
    previous behavior of silently ignoring such lines.
  - Fix typo in pg_srand48 seed initialization.
    This led to failure to use all bits of the provided seed. This
    function is not used on most platforms (only those without
    srandom), and the potential security exposure from a
    less-random-than-expected seed seems minimal in any case.
  - Avoid integer overflow when the sum of LIMIT and OFFSET values
    exceeds 2^63.
  - Add overflow checks to int4 and int8 versions of generate_series().
  - Fix trailing-zero removal in to_char(). In a format with FM and no
    digit positions after the decimal point, zeroes to the left of the
    decimal point could be removed incorrectly.
  - Fix pg_size_pretty() to avoid overflow for inputs close to 2^63.
  - Weaken plpgsql's check for typmod matching in record values.
    An overly enthusiastic check could lead to discarding length
    modifiers that should have been kept.
  - Fix pg_upgrade to preserve toast tables' relfrozenxids during an
    upgrade from 8.3. Failure to do this could lead to "pg_clog" files
    being removed too soon after the upgrade.
  - Fix psql's counting of script file line numbers during COPY from a
    different file.
  - Fix pg_restore's direct-to-database mode for
    standard_conforming_strings. pg_restore could emit incorrect commands
    when restoring directly to a database server from an archive file that
    had been made with standard_conforming_strings set to on.
  - Be more user-friendly about unsupported cases for parallel
    pg_restore. This change ensures that such cases are detected and
    reported before any restore actions have been taken.
  - Fix write-past-buffer-end and memory leak in libpq's LDAP service
    lookup code.
  - In libpq, avoid failures when using nonblocking I/O and an SSL
    connection.
  - Improve libpq's handling of failures during connection startup.
    In particular, the response to a server report of fork() failure
    during SSL connection startup is now saner.
  - Improve libpq's error reporting for SSL failures.
  - Fix PQsetvalue() to avoid possible crash when adding a new tuple to
    a PGresult originally obtained from a server query.
  - Make ecpglib write double values with 15 digits precision.
  - In ecpglib, be sure LC_NUMERIC setting is restored after an error.
  - Apply upstream fix for blowfish signed-character bug
    (CVE-2011-2483) (Closes: #631285)
    "contrib/pg_crypto"'s blowfish encryption code could give wrong
    results on platforms where char is signed (which is most), leading
    to encrypted passwords being weaker than they should be.
  - Fix memory leak in "contrib/seg".
  - Fix pgstatindex() to give consistent results for empty indexes.
  - Allow building with perl 5.14. (Closes: #628503)

14. By Martin Pitt

* New upstream security/bug fix release: (LP: #711318)
  - Fix buffer overrun in "contrib/intarray"'s input function for the
    query_int type.
    This bug is a security risk since the function's return address
    could be overwritten. Thanks to Apple Inc's security team for
    reporting this issue and supplying the fix. (CVE-2010-4015)
  - Avoid failures when "EXPLAIN" tries to display a simple-form CASE
    expression.
    If the CASE's test expression was a constant, the planner could
    simplify the CASE into a form that confused the expression-display
    code, resulting in "unexpected CASE WHEN clause" errors.
  - Fix assignment to an array slice that is before the existing range
    of subscripts.
    If there was a gap between the newly added subscripts and the first
    pre-existing subscript, the code miscalculated how many entries
    needed to be copied from the old array's null bitmap, potentially
    leading to data corruption or crash.
  - Avoid unexpected conversion overflow in planner for very distant
    date values.
    The date type supports a wider range of dates than can be
    represented by the timestamp types, but the planner assumed it
    could always convert a date to timestamp with impunity.
  - Fix pg_restore's text output for large objects (BLOBs) when
    standard_conforming_strings is on.
    Although restoring directly to a database worked correctly, string
    escaping was incorrect if pg_restore was asked for SQL text output
    and standard_conforming_strings had been enabled in the source
    database.
  - Fix erroneous parsing of tsquery values containing ... &
    !(subexpression) | ... .
    Queries containing this combination of operators were not executed
    correctly. The same error existed in "contrib/intarray"'s query_int
    type and "contrib/ltree"'s ltxtquery type.
  - Fix bug in "contrib/seg"'s GiST picksplit algorithm.
    This could result in considerable inefficiency, though not actually
    incorrect answers, in a GiST index on a seg column. If you have
    such an index, consider "REINDEX"ing it after installing this
    update. (This is identical to the bug that was fixed in
    "contrib/cube" in the previous update.)

13. By Martin Pitt

* New upstream security/bug fix update: (LP: #655293)
  - Use a separate interpreter for each calling SQL userid in PL/Perl
    and PL/Tcl.
    This change prevents security problems that can be caused by
    subverting Perl or Tcl code that will be executed later in the same
    session under another SQL user identity (for example, within a
    SECURITY DEFINER function). Most scripting languages offer numerous
    ways that that might be done, such as redefining standard functions
    or operators called by the target function. Without this change,
    any SQL user with Perl or Tcl language usage rights can do
    essentially anything with the SQL privileges of the target
    function's owner.
    The cost of this change is that intentional communication among
    Perl and Tcl functions becomes more difficult. To provide an escape
    hatch, PL/PerlU and PL/TclU functions continue to use only one
    interpreter per session. This is not considered a security issue
    since all such functions execute at the trust level of a database
    superuser already.
    It is likely that third-party procedural languages that claim to
    offer trusted execution have similar security issues. We advise
    contacting the authors of any PL you are depending on for
    security-critical purposes.
    Our thanks to Tim Bunce for pointing out this issue
    (CVE-2010-3433).
  - Prevent possible crashes in pg_get_expr() by disallowing it from
    being called with an argument that is not one of the system catalog
    columns it's intended to be used with.
  - Fix incorrect placement of placeholder evaluation.
    This bug could result in query outputs being non-null when they
    should be null, in cases where the inner side of an outer join is a
    sub-select with non-strict expressions in its output list.
  - Fix possible duplicate scans of UNION ALL member relations.
  - Fix "cannot handle unplanned sub-select" error.
    This occurred when a sub-select contains a join alias reference
    that expands into an expression containing another sub-select.
  - Fix mishandling of whole-row Vars that reference a view or
    sub-select and appear within a nested sub-select.
  - Fix mishandling of cross-type IN comparisons.
    This could result in failures if the planner tried to implement an
    IN join with a sort-then-unique-then-plain-join plan.
  - Fix computation of "ANALYZE" statistics for tsvector columns.
    The original coding could produce incorrect statistics, leading to
    poor plan choices later.
  - Improve planner's estimate of memory used by array_agg(),
    string_agg(), and similar aggregate functions.
    The previous drastic underestimate could lead to out-of-memory
    failures due to inappropriate choice of a hash-aggregation plan.
  - Fix failure to mark cached plans as transient.
    If a plan is prepared while "CREATE INDEX CONCURRENTLY" is in
    progress for one of the referenced tables, it is supposed to be
    re-planned once the index is ready for use. This was not happening
    reliably.
  - Reduce PANIC to ERROR in some occasionally-reported btree failure
    cases, and provide additional detail in the resulting error
    messages.
    This should improve the system's robustness with corrupted indexes.
  - Fix incorrect search logic for partial-match queries with GIN
    indexes.
    Cases involving AND/OR combination of several GIN index conditions
    didn't always give the right answer, and were sometimes much slower
    than necessary.
  - Prevent show_session_authorization() from crashing within
    autovacuum processes.
  - Defend against functions returning setof record where not all the
    returned rows are actually of the same rowtype.
  - Fix possible corruption of pending trigger event lists during
    subtransaction rollback.
    This could lead to a crash or incorrect firing of triggers.
  - Fix possible failure when hashing a pass-by-reference function
    result.
  - Improve merge join's handling of NULLs in the join columns.
    A merge join can now stop entirely upon reaching the first NULL, if
    the sort order is such that NULLs sort high.
  - Take care to fsync the contents of lockfiles (both "postmaster.pid"
    and the socket lockfile) while writing them.
    This omission could result in corrupted lockfile contents if the
    machine crashes shortly after postmaster start. That could in turn
    prevent subsequent attempts to start the postmaster from
    succeeding, until the lockfile is manually removed.
  - Avoid recursion while assigning XIDs to heavily-nested
    subtransactions.
    The original coding could result in a crash if there was limited
    stack space.
  - Avoid holding open old WAL segments in the walwriter process.
    The previous coding would prevent removal of no-longer-needed
    segments.
  - Fix log_line_prefix's %i escape, which could produce junk early in
    backend startup.
  - Prevent misinterpretation of partially-specified relation options
    for TOAST tables.
    In particular, fillfactor would be read as zero if any other
    reloption had been set for the table, leading to serious bloat.
  - Fix inheritance count tracking in "ALTER TABLE ... ADD CONSTRAINT"
  - Fix possible data corruption in "ALTER TABLE ... SET TABLESPACE"
    when archiving is enabled.
  - Allow "CREATE DATABASE" and "ALTER DATABASE ... SET TABLESPACE" to
    be interrupted by query-cancel.
  - Improve "CREATE INDEX"'s checking of whether proposed index
    expressions are immutable.
  - Fix "REASSIGN OWNED" to handle operator classes and families.
  - Fix possible core dump when comparing two empty tsquery values.
  - Fix LIKE's handling of patterns containing % followed by _.
    We've fixed this before, but there were still some
    incorrectly-handled cases.
  - Re-allow input of Julian dates prior to 0001-01-01 AD.
    Input such as 'J100000'::date worked before 8.4, but was
    unintentionally broken by added error-checking.
  - Fix PL/pgSQL to throw an error, not crash, if a cursor is closed
    within a FOR loop that is iterating over that cursor.
  - In PL/Python, defend against null pointer results from
    PyCObject_AsVoidPtr and PyCObject_FromVoidPtr.
  - In libpq, fix full SSL certificate verification for the case where
    both host and hostaddr are specified.
  - Make psql recognize "DISCARD ALL" as a command that should not be
    encased in a transaction block in autocommit-off mode.
  - Fix some issues in pg_dump's handling of SQL/MED objects.
    Notably, pg_dump would always fail if run by a non-superuser, which
    was not intended.
  - Improve pg_dump and pg_restore's handling of non-seekable archive
    files.
    This is important for proper functioning of parallel restore.
  - Improve parallel pg_restore's ability to cope with selective
    restore (-L option).
    The original code tended to fail if the -L file commanded a
    non-default restore ordering.
  - Fix ecpg to process data from RETURNING clauses correctly.
  - Fix some memory leaks in ecpg.
  - Improve "contrib/dblink"'s handling of tables containing dropped
    columns.
  - Fix connection leak after "duplicate connection name" errors in
    "contrib/dblink".
  - Fix "contrib/dblink" to handle connection names longer than 62
    bytes correctly.
  - Add hstore(text, text) function to "contrib/hstore".
    This function is the recommended substitute for the now-deprecated
    => operator. It was back-patched so that future-proofed code can be
    used with older server versions. Note that the patch will be
    effective only after "contrib/hstore" is installed or reinstalled
    in a particular database. Users might prefer to execute the "CREATE
    FUNCTION" command by hand, instead.
  - Update build infrastructure and documentation to reflect the source
    code repository's move from CVS to Git.

Branch metadata

Branch format:
Branch format 7
Repository format:
Bazaar repository format 2a (needs bzr 1.16 or later)
Stacked on:
lp://staging/ubuntu/maverick/postgresql-8.4
This branch contains Public information 
Everyone can see this information.

Subscribers