pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix corner case with PGP decompression in pgcrypto
7+ messages / 1 participants
[nested] [flat]

* pgsql: Fix corner case with PGP decompression in pgcrypto
@ 2020-07-22 05:54 Michael Paquier <michael@paquier.xyz>
  0 siblings, 0 replies; 7+ messages in thread

From: Michael Paquier @ 2020-07-22 05:54 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix corner case with PGP decompression in pgcrypto

A compressed stream may end with an empty packet, and PGP decompression
finished before reading this empty packet in the remaining stream.  This
caused a failure in pgcrypto, handling this case as corrupted data.
This commit makes sure to consume such extra data, avoiding a failure
when decompression the entire stream.  This corner case was reproducible
with a data length of 16kB, and existed since its introduction in
e94dd6a.  A cheap regression test is added to cover this case.

Thanks to Jeff Janes for the extra investigation.

Reported-by: Frank Gagnepain
Author: Kyotaro Horiguchi, Michael Paquier
Discussion: https://postgr.es/m/16476-692ef7b84e5fb893@postgresql.org
Backpatch-through: 9.5

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/9e108984fb35d8f9e2c2bffa10c0034f9161e802

Modified Files
--------------
contrib/pgcrypto/expected/pgp-compression.out | 30 +++++++++++++++++++++++++++
contrib/pgcrypto/pgp-compress.c               | 22 ++++++++++----------
contrib/pgcrypto/sql/pgp-compression.sql      | 21 +++++++++++++++++++
3 files changed, 62 insertions(+), 11 deletions(-)



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

* pgsql: Fix corner case with PGP decompression in pgcrypto
@ 2020-07-22 05:54 Michael Paquier <michael@paquier.xyz>
  0 siblings, 0 replies; 7+ messages in thread

From: Michael Paquier @ 2020-07-22 05:54 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix corner case with PGP decompression in pgcrypto

A compressed stream may end with an empty packet, and PGP decompression
finished before reading this empty packet in the remaining stream.  This
caused a failure in pgcrypto, handling this case as corrupted data.
This commit makes sure to consume such extra data, avoiding a failure
when decompression the entire stream.  This corner case was reproducible
with a data length of 16kB, and existed since its introduction in
e94dd6a.  A cheap regression test is added to cover this case.

Thanks to Jeff Janes for the extra investigation.

Reported-by: Frank Gagnepain
Author: Kyotaro Horiguchi, Michael Paquier
Discussion: https://postgr.es/m/16476-692ef7b84e5fb893@postgresql.org
Backpatch-through: 9.5

Branch
------
REL_13_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/35e142202b14fa12f8edbd7e58b33c39d3c03c62

Modified Files
--------------
contrib/pgcrypto/expected/pgp-compression.out | 30 +++++++++++++++++++++++++++
contrib/pgcrypto/pgp-compress.c               | 22 ++++++++++----------
contrib/pgcrypto/sql/pgp-compression.sql      | 21 +++++++++++++++++++
3 files changed, 62 insertions(+), 11 deletions(-)



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

* pgsql: Fix corner case with PGP decompression in pgcrypto
@ 2020-07-22 05:54 Michael Paquier <michael@paquier.xyz>
  0 siblings, 0 replies; 7+ messages in thread

From: Michael Paquier @ 2020-07-22 05:54 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix corner case with PGP decompression in pgcrypto

A compressed stream may end with an empty packet, and PGP decompression
finished before reading this empty packet in the remaining stream.  This
caused a failure in pgcrypto, handling this case as corrupted data.
This commit makes sure to consume such extra data, avoiding a failure
when decompression the entire stream.  This corner case was reproducible
with a data length of 16kB, and existed since its introduction in
e94dd6a.  A cheap regression test is added to cover this case.

Thanks to Jeff Janes for the extra investigation.

Reported-by: Frank Gagnepain
Author: Kyotaro Horiguchi, Michael Paquier
Discussion: https://postgr.es/m/16476-692ef7b84e5fb893@postgresql.org
Backpatch-through: 9.5

Branch
------
REL_12_STABLE

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

Modified Files
--------------
contrib/pgcrypto/expected/pgp-compression.out | 30 +++++++++++++++++++++++++++
contrib/pgcrypto/pgp-compress.c               | 22 ++++++++++----------
contrib/pgcrypto/sql/pgp-compression.sql      | 21 +++++++++++++++++++
3 files changed, 62 insertions(+), 11 deletions(-)



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

* pgsql: Fix corner case with PGP decompression in pgcrypto
@ 2020-07-22 05:54 Michael Paquier <michael@paquier.xyz>
  0 siblings, 0 replies; 7+ messages in thread

From: Michael Paquier @ 2020-07-22 05:54 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix corner case with PGP decompression in pgcrypto

A compressed stream may end with an empty packet, and PGP decompression
finished before reading this empty packet in the remaining stream.  This
caused a failure in pgcrypto, handling this case as corrupted data.
This commit makes sure to consume such extra data, avoiding a failure
when decompression the entire stream.  This corner case was reproducible
with a data length of 16kB, and existed since its introduction in
e94dd6a.  A cheap regression test is added to cover this case.

Thanks to Jeff Janes for the extra investigation.

Reported-by: Frank Gagnepain
Author: Kyotaro Horiguchi, Michael Paquier
Discussion: https://postgr.es/m/16476-692ef7b84e5fb893@postgresql.org
Backpatch-through: 9.5

Branch
------
REL_11_STABLE

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

Modified Files
--------------
contrib/pgcrypto/expected/pgp-compression.out | 30 +++++++++++++++++++++++++++
contrib/pgcrypto/pgp-compress.c               | 22 ++++++++++----------
contrib/pgcrypto/sql/pgp-compression.sql      | 21 +++++++++++++++++++
3 files changed, 62 insertions(+), 11 deletions(-)



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

* pgsql: Fix corner case with PGP decompression in pgcrypto
@ 2020-07-22 05:54 Michael Paquier <michael@paquier.xyz>
  0 siblings, 0 replies; 7+ messages in thread

From: Michael Paquier @ 2020-07-22 05:54 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix corner case with PGP decompression in pgcrypto

A compressed stream may end with an empty packet, and PGP decompression
finished before reading this empty packet in the remaining stream.  This
caused a failure in pgcrypto, handling this case as corrupted data.
This commit makes sure to consume such extra data, avoiding a failure
when decompression the entire stream.  This corner case was reproducible
with a data length of 16kB, and existed since its introduction in
e94dd6a.  A cheap regression test is added to cover this case.

Thanks to Jeff Janes for the extra investigation.

Reported-by: Frank Gagnepain
Author: Kyotaro Horiguchi, Michael Paquier
Discussion: https://postgr.es/m/16476-692ef7b84e5fb893@postgresql.org
Backpatch-through: 9.5

Branch
------
REL_10_STABLE

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

Modified Files
--------------
contrib/pgcrypto/expected/pgp-compression.out | 30 +++++++++++++++++++++++++++
contrib/pgcrypto/pgp-compress.c               | 22 ++++++++++----------
contrib/pgcrypto/sql/pgp-compression.sql      | 21 +++++++++++++++++++
3 files changed, 62 insertions(+), 11 deletions(-)



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

* pgsql: Fix corner case with PGP decompression in pgcrypto
@ 2020-07-22 05:54 Michael Paquier <michael@paquier.xyz>
  0 siblings, 0 replies; 7+ messages in thread

From: Michael Paquier @ 2020-07-22 05:54 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix corner case with PGP decompression in pgcrypto

A compressed stream may end with an empty packet, and PGP decompression
finished before reading this empty packet in the remaining stream.  This
caused a failure in pgcrypto, handling this case as corrupted data.
This commit makes sure to consume such extra data, avoiding a failure
when decompression the entire stream.  This corner case was reproducible
with a data length of 16kB, and existed since its introduction in
e94dd6a.  A cheap regression test is added to cover this case.

Thanks to Jeff Janes for the extra investigation.

Reported-by: Frank Gagnepain
Author: Kyotaro Horiguchi, Michael Paquier
Discussion: https://postgr.es/m/16476-692ef7b84e5fb893@postgresql.org
Backpatch-through: 9.5

Branch
------
REL9_6_STABLE

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

Modified Files
--------------
contrib/pgcrypto/expected/pgp-compression.out | 30 +++++++++++++++++++++++++++
contrib/pgcrypto/pgp-compress.c               | 22 ++++++++++----------
contrib/pgcrypto/sql/pgp-compression.sql      | 21 +++++++++++++++++++
3 files changed, 62 insertions(+), 11 deletions(-)



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

* pgsql: Fix corner case with PGP decompression in pgcrypto
@ 2020-07-22 05:54 Michael Paquier <michael@paquier.xyz>
  0 siblings, 0 replies; 7+ messages in thread

From: Michael Paquier @ 2020-07-22 05:54 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix corner case with PGP decompression in pgcrypto

A compressed stream may end with an empty packet, and PGP decompression
finished before reading this empty packet in the remaining stream.  This
caused a failure in pgcrypto, handling this case as corrupted data.
This commit makes sure to consume such extra data, avoiding a failure
when decompression the entire stream.  This corner case was reproducible
with a data length of 16kB, and existed since its introduction in
e94dd6a.  A cheap regression test is added to cover this case.

Thanks to Jeff Janes for the extra investigation.

Reported-by: Frank Gagnepain
Author: Kyotaro Horiguchi, Michael Paquier
Discussion: https://postgr.es/m/16476-692ef7b84e5fb893@postgresql.org
Backpatch-through: 9.5

Branch
------
REL9_5_STABLE

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

Modified Files
--------------
contrib/pgcrypto/expected/pgp-compression.out | 30 +++++++++++++++++++++++++++
contrib/pgcrypto/pgp-compress.c               | 22 ++++++++++----------
contrib/pgcrypto/sql/pgp-compression.sql      | 21 +++++++++++++++++++
3 files changed, 62 insertions(+), 11 deletions(-)



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


end of thread, other threads:[~2020-07-22 05:54 UTC | newest]

Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-07-22 05:54 pgsql: Fix corner case with PGP decompression in pgcrypto Michael Paquier <michael@paquier.xyz>
2020-07-22 05:54 pgsql: Fix corner case with PGP decompression in pgcrypto Michael Paquier <michael@paquier.xyz>
2020-07-22 05:54 pgsql: Fix corner case with PGP decompression in pgcrypto Michael Paquier <michael@paquier.xyz>
2020-07-22 05:54 pgsql: Fix corner case with PGP decompression in pgcrypto Michael Paquier <michael@paquier.xyz>
2020-07-22 05:54 pgsql: Fix corner case with PGP decompression in pgcrypto Michael Paquier <michael@paquier.xyz>
2020-07-22 05:54 pgsql: Fix corner case with PGP decompression in pgcrypto Michael Paquier <michael@paquier.xyz>
2020-07-22 05:54 pgsql: Fix corner case with PGP decompression in pgcrypto Michael Paquier <michael@paquier.xyz>

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