Add missing checks to some of pageinspect's BRIN functions
authorAlvaro Herrera
Mon, 28 Mar 2016 13:57:42 +0000 (10:57 -0300)
committerAlvaro Herrera
Mon, 28 Mar 2016 13:57:46 +0000 (10:57 -0300)
commitbf78a6f107949fdfb513d1b45e30cefe04e09e4f
treeac3bc38bd83f4178d0694fccfb17bc9eb8780cdc
parentdb69e58a0642ef7fa46d62f6c4cf2460c3a1b41b
Add missing checks to some of pageinspect's BRIN functions

brin_page_type() and brin_metapage_info() did not enforce being called
by superuser, like other pageinspect functions that take bytea do.
Since they don't verify the passed page thoroughly, it is possible to
use them to read the server memory with a carefully crafted bytea value,
up to a file kilobytes from where the input bytea is located.

Have them throw errors if called by a non-superuser.

Report and initial patch: Andreas Seltenreich

Security: CVE-2016-3065
contrib/pageinspect/brinfuncs.c