Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 29dd6d8

Browse files
committed
Prevent non-superusers from reading pg_backend_memory_contexts, by default.
pg_backend_memory_contexts view contains some internal information of memory contexts. Since exposing them to any users by default may cause security issue, this commit allows only superusers to read this view, by default, like we do for pg_shmem_allocations view. Bump catalog version. Author: Atsushi Torikoshi Reviewed-by: Michael Paquier, Fujii Masao Discussion: https://postgr.es/m/1414992.1597849297@sss.pgh.pa.us
1 parent c34605d commit 29dd6d8

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

doc/src/sgml/catalogs.sgml

+4
Original file line numberDiff line numberDiff line change
@@ -9697,6 +9697,10 @@ SCRAM-SHA-256$<replaceable>&lt;iteration count&gt;</replaceable>:<replaceable>&l
96979697
</tgroup>
96989698
</table>
96999699

9700+
<para>
9701+
By default, the <structname>pg_backend_memory_contexts</structname> view can be
9702+
read only by superusers.
9703+
</para>
97009704
</sect1>
97019705

97029706
<sect1 id="view-pg-config">

src/backend/catalog/system_views.sql

+3
Original file line numberDiff line numberDiff line change
@@ -557,6 +557,9 @@ REVOKE EXECUTE ON FUNCTION pg_get_shmem_allocations() FROM PUBLIC;
557557
CREATE VIEW pg_backend_memory_contexts AS
558558
SELECT * FROM pg_get_backend_memory_contexts();
559559

560+
REVOKE ALL ON pg_backend_memory_contexts FROM PUBLIC;
561+
REVOKE EXECUTE ON FUNCTION pg_get_backend_memory_contexts() FROM PUBLIC;
562+
560563
-- Statistics views
561564

562565
CREATE VIEW pg_stat_all_tables AS

src/include/catalog/catversion.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,6 @@
5353
*/
5454

5555
/* yyyymmddN */
56-
#define CATALOG_VERSION_NO 202008191
56+
#define CATALOG_VERSION_NO 202008261
5757

5858
#endif

0 commit comments

Comments
 (0)