pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Validate the OID argument of pg_import_system_collations().
5+ messages / 1 participants
[nested] [flat]

* pgsql: Validate the OID argument of pg_import_system_collations().
@ 2021-03-08 23:22 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 5+ messages in thread

From: Tom Lane @ 2021-03-08 23:22 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Validate the OID argument of pg_import_system_collations().

"SELECT pg_import_system_collations(0)" caused an assertion failure.
With a random nonzero argument --- or indeed with zero, in non-assert
builds --- it would happily make pg_collation entries with garbage
values of collnamespace.  These are harmless as far as I can tell
(unless maybe the OID happens to become used for a schema, later on?).
In any case this isn't a security issue, since the function is
superuser-only.  But it seems like a gotcha for unwary DBAs, so let's
add a check that the given OID belongs to some schema.

Back-patch to v10 where this function was introduced.

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/5c06abb9b97b69513a3998cccf89556e73052e02

Modified Files
--------------
src/backend/commands/collationcmds.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* pgsql: Validate the OID argument of pg_import_system_collations().
@ 2021-03-08 23:22 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 5+ messages in thread

From: Tom Lane @ 2021-03-08 23:22 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Validate the OID argument of pg_import_system_collations().

"SELECT pg_import_system_collations(0)" caused an assertion failure.
With a random nonzero argument --- or indeed with zero, in non-assert
builds --- it would happily make pg_collation entries with garbage
values of collnamespace.  These are harmless as far as I can tell
(unless maybe the OID happens to become used for a schema, later on?).
In any case this isn't a security issue, since the function is
superuser-only.  But it seems like a gotcha for unwary DBAs, so let's
add a check that the given OID belongs to some schema.

Back-patch to v10 where this function was introduced.

Branch
------
REL_13_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/fe2b5386b2edb7d454fcab36bb3dfbbe272d362f

Modified Files
--------------
src/backend/commands/collationcmds.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* pgsql: Validate the OID argument of pg_import_system_collations().
@ 2021-03-08 23:22 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 5+ messages in thread

From: Tom Lane @ 2021-03-08 23:22 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Validate the OID argument of pg_import_system_collations().

"SELECT pg_import_system_collations(0)" caused an assertion failure.
With a random nonzero argument --- or indeed with zero, in non-assert
builds --- it would happily make pg_collation entries with garbage
values of collnamespace.  These are harmless as far as I can tell
(unless maybe the OID happens to become used for a schema, later on?).
In any case this isn't a security issue, since the function is
superuser-only.  But it seems like a gotcha for unwary DBAs, so let's
add a check that the given OID belongs to some schema.

Back-patch to v10 where this function was introduced.

Branch
------
REL_12_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/8fff8a87493a238b45ecf6635baf334c4051b9df

Modified Files
--------------
src/backend/commands/collationcmds.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* pgsql: Validate the OID argument of pg_import_system_collations().
@ 2021-03-08 23:22 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 5+ messages in thread

From: Tom Lane @ 2021-03-08 23:22 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Validate the OID argument of pg_import_system_collations().

"SELECT pg_import_system_collations(0)" caused an assertion failure.
With a random nonzero argument --- or indeed with zero, in non-assert
builds --- it would happily make pg_collation entries with garbage
values of collnamespace.  These are harmless as far as I can tell
(unless maybe the OID happens to become used for a schema, later on?).
In any case this isn't a security issue, since the function is
superuser-only.  But it seems like a gotcha for unwary DBAs, so let's
add a check that the given OID belongs to some schema.

Back-patch to v10 where this function was introduced.

Branch
------
REL_11_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/ea42ccbced4baeff9df9be0cb8ec3e4d42070089

Modified Files
--------------
src/backend/commands/collationcmds.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* pgsql: Validate the OID argument of pg_import_system_collations().
@ 2021-03-08 23:22 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 5+ messages in thread

From: Tom Lane @ 2021-03-08 23:22 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Validate the OID argument of pg_import_system_collations().

"SELECT pg_import_system_collations(0)" caused an assertion failure.
With a random nonzero argument --- or indeed with zero, in non-assert
builds --- it would happily make pg_collation entries with garbage
values of collnamespace.  These are harmless as far as I can tell
(unless maybe the OID happens to become used for a schema, later on?).
In any case this isn't a security issue, since the function is
superuser-only.  But it seems like a gotcha for unwary DBAs, so let's
add a check that the given OID belongs to some schema.

Back-patch to v10 where this function was introduced.

Branch
------
REL_10_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/37228ecde1f061ce47a2f60fcaa0f64a93af4ea8

Modified Files
--------------
src/backend/commands/collationcmds.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)



^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2021-03-08 23:22 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-03-08 23:22 pgsql: Validate the OID argument of pg_import_system_collations(). Tom Lane <tgl@sss.pgh.pa.us>
2021-03-08 23:22 pgsql: Validate the OID argument of pg_import_system_collations(). Tom Lane <tgl@sss.pgh.pa.us>
2021-03-08 23:22 pgsql: Validate the OID argument of pg_import_system_collations(). Tom Lane <tgl@sss.pgh.pa.us>
2021-03-08 23:22 pgsql: Validate the OID argument of pg_import_system_collations(). Tom Lane <tgl@sss.pgh.pa.us>
2021-03-08 23:22 pgsql: Validate the OID argument of pg_import_system_collations(). Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox