postgresql/src/backend
Tom Lane 5f93c37805 Add defenses against running with a wrong selection of LOBLKSIZE.
It's critical that the backend's idea of LOBLKSIZE match the way data has
actually been divided up in pg_largeobject.  While we don't provide any
direct way to adjust that value, doing so is a one-line source code change
and various people have expressed interest recently in changing it.  So,
just as with TOAST_MAX_CHUNK_SIZE, it seems prudent to record the value in
pg_control and cross-check that the backend's compiled-in setting matches
the on-disk data.

Also tweak the code in inv_api.c so that fetches from pg_largeobject
explicitly verify that the length of the data field is not more than
LOBLKSIZE.  Formerly we just had Asserts() for that, which is no protection
at all in production builds.  In some of the call sites an overlength data
value would translate directly to a security-relevant stack clobber, so it
seems worth one extra runtime comparison to be sure.

In the back branches, we can't change the contents of pg_control; but we
can still make the extra checks in inv_api.c, which will offer some amount
of protection against running with the wrong value of LOBLKSIZE.
2014-06-05 11:31:06 -04:00
..
access Add defenses against running with a wrong selection of LOBLKSIZE. 2014-06-05 11:31:06 -04:00
bootstrap Revert "Fix bogus %name-prefix option syntax in all our Bison files." 2014-05-28 19:21:01 -04:00
catalog Consistently spell a replication slot's name as slot_name. 2014-06-05 16:29:20 +02:00
commands Prevent auto_explain from changing the output of a user's EXPLAIN. 2014-05-20 12:20:47 -04:00
executor Improve comment for tricky aspect of index-only scans. 2014-05-06 19:27:43 -07:00
foreign Update copyright for 2014 2014-01-07 16:05:30 -05:00
lib pgindent run for 9.4 2014-05-06 12:12:18 -04:00
libpq pgindent run for 9.4 2014-05-06 12:12:18 -04:00
main Make fallback implementation of pg_memory_barrier() work. 2014-05-17 18:29:46 -04:00
nodes pgindent run for 9.4 2014-05-06 12:12:18 -04:00
optimizer Revert "Auto-tune effective_cache size to be 4x shared buffers" 2014-05-08 20:49:38 -04:00
parser Revert "Fix bogus %name-prefix option syntax in all our Bison files." 2014-05-28 19:21:01 -04:00
po Translation updates 2014-05-10 22:16:59 -04:00
port pgindent run for 9.4 2014-05-06 12:12:18 -04:00
postmaster Save pg_stat_statements statistics file into $PGDATA/pg_stat directory at shutdown. 2014-06-04 12:09:45 +09:00
regex pgindent run for 9.4 2014-05-06 12:12:18 -04:00
replication Revert "Fix bogus %name-prefix option syntax in all our Bison files." 2014-05-28 19:21:01 -04:00
rewrite pgindent run for 9.4 2014-05-06 12:12:18 -04:00
snowball Prefer pg_any_to_server/pg_server_to_any over pg_do_encoding_conversion. 2014-02-23 16:59:05 -05:00
storage Add defenses against running with a wrong selection of LOBLKSIZE. 2014-06-05 11:31:06 -04:00
tcop Set the process latch when processing recovery conflict interrupts. 2014-06-03 14:02:54 +02:00
tsearch pgindent run for 9.4 2014-05-06 12:12:18 -04:00
utils Add btree and hash opclasses for pg_lsn. 2014-06-04 20:45:56 -04:00
.gitignore Add gitignore for mingw/cygwin build outputs 2011-06-09 18:11:47 +02:00
common.mk Remove maintainer-check target, fold into normal build 2013-10-10 20:11:56 -04:00
Makefile Get rid of use of dlltool in Mingw builds. 2014-02-11 12:56:20 -05:00
nls.mk Add libpgcommon to backend gettext source files 2013-10-19 13:49:05 -04:00