pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Don't read fields of a misaligned ExpandedObjectHeader or AnyArr
5+ messages / 1 participants
[nested] [flat]

* pgsql: Don't read fields of a misaligned ExpandedObjectHeader or AnyArr
@ 2019-07-01 00:36 Noah Misch <noah@leadboat.com>
  0 siblings, 0 replies; 5+ messages in thread

From: Noah Misch @ 2019-07-01 00:36 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Don't read fields of a misaligned ExpandedObjectHeader or AnyArrayType.

UBSan complains about this.  Instead, cast to a suitable type requiring
only 4-byte alignment.  DatumGetAnyArrayP() already assumes one can cast
between AnyArrayType and ArrayType, so this doesn't introduce a new
assumption.  Back-patch to 9.5, where AnyArrayType was introduced.

Reviewed by Tom Lane.

Discussion: https://postgr.es/m/20190629210334.GA1244217@rfd.leadboat.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/459c3cdb4ad8323bfe6bcae0186a3831e0c89c94

Modified Files
--------------
src/backend/utils/adt/arrayfuncs.c |  2 +-
src/include/utils/array.h          | 19 +++++++++++++------
src/include/utils/arrayaccess.h    |  4 ++--
src/include/utils/expandeddatum.h  |  2 +-
4 files changed, 17 insertions(+), 10 deletions(-)



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

* pgsql: Don't read fields of a misaligned ExpandedObjectHeader or AnyArr
@ 2019-07-01 00:36 Noah Misch <noah@leadboat.com>
  0 siblings, 0 replies; 5+ messages in thread

From: Noah Misch @ 2019-07-01 00:36 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Don't read fields of a misaligned ExpandedObjectHeader or AnyArrayType.

UBSan complains about this.  Instead, cast to a suitable type requiring
only 4-byte alignment.  DatumGetAnyArrayP() already assumes one can cast
between AnyArrayType and ArrayType, so this doesn't introduce a new
assumption.  Back-patch to 9.5, where AnyArrayType was introduced.

Reviewed by Tom Lane.

Discussion: https://postgr.es/m/20190629210334.GA1244217@rfd.leadboat.com

Branch
------
REL_11_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/4b85f20f948d885875a1e1b89979e627b86e6e64

Modified Files
--------------
src/backend/utils/adt/arrayfuncs.c |  2 +-
src/include/utils/array.h          | 19 +++++++++++++------
src/include/utils/arrayaccess.h    |  4 ++--
src/include/utils/expandeddatum.h  |  2 +-
4 files changed, 17 insertions(+), 10 deletions(-)



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

* pgsql: Don't read fields of a misaligned ExpandedObjectHeader or AnyArr
@ 2019-07-01 00:36 Noah Misch <noah@leadboat.com>
  0 siblings, 0 replies; 5+ messages in thread

From: Noah Misch @ 2019-07-01 00:36 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Don't read fields of a misaligned ExpandedObjectHeader or AnyArrayType.

UBSan complains about this.  Instead, cast to a suitable type requiring
only 4-byte alignment.  DatumGetAnyArrayP() already assumes one can cast
between AnyArrayType and ArrayType, so this doesn't introduce a new
assumption.  Back-patch to 9.5, where AnyArrayType was introduced.

Reviewed by Tom Lane.

Discussion: https://postgr.es/m/20190629210334.GA1244217@rfd.leadboat.com

Branch
------
REL_10_STABLE

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

Modified Files
--------------
src/backend/utils/adt/arrayfuncs.c |  2 +-
src/include/utils/array.h          | 19 +++++++++++++------
src/include/utils/arrayaccess.h    |  4 ++--
src/include/utils/expandeddatum.h  |  2 +-
4 files changed, 17 insertions(+), 10 deletions(-)



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

* pgsql: Don't read fields of a misaligned ExpandedObjectHeader or AnyArr
@ 2019-07-01 00:36 Noah Misch <noah@leadboat.com>
  0 siblings, 0 replies; 5+ messages in thread

From: Noah Misch @ 2019-07-01 00:36 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Don't read fields of a misaligned ExpandedObjectHeader or AnyArrayType.

UBSan complains about this.  Instead, cast to a suitable type requiring
only 4-byte alignment.  DatumGetAnyArrayP() already assumes one can cast
between AnyArrayType and ArrayType, so this doesn't introduce a new
assumption.  Back-patch to 9.5, where AnyArrayType was introduced.

Reviewed by Tom Lane.

Discussion: https://postgr.es/m/20190629210334.GA1244217@rfd.leadboat.com

Branch
------
REL9_6_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/2938aa2a5b1cebb41f9e54c1ea289c286139c21e

Modified Files
--------------
src/backend/utils/adt/arrayfuncs.c |  2 +-
src/include/utils/array.h          | 19 +++++++++++++------
src/include/utils/arrayaccess.h    |  4 ++--
src/include/utils/expandeddatum.h  |  2 +-
4 files changed, 17 insertions(+), 10 deletions(-)



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

* pgsql: Don't read fields of a misaligned ExpandedObjectHeader or AnyArr
@ 2019-07-01 00:36 Noah Misch <noah@leadboat.com>
  0 siblings, 0 replies; 5+ messages in thread

From: Noah Misch @ 2019-07-01 00:36 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Don't read fields of a misaligned ExpandedObjectHeader or AnyArrayType.

UBSan complains about this.  Instead, cast to a suitable type requiring
only 4-byte alignment.  DatumGetAnyArrayP() already assumes one can cast
between AnyArrayType and ArrayType, so this doesn't introduce a new
assumption.  Back-patch to 9.5, where AnyArrayType was introduced.

Reviewed by Tom Lane.

Discussion: https://postgr.es/m/20190629210334.GA1244217@rfd.leadboat.com

Branch
------
REL9_5_STABLE

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

Modified Files
--------------
src/backend/utils/adt/arrayfuncs.c |  2 +-
src/include/utils/array.h          | 19 +++++++++++++------
src/include/utils/arrayaccess.h    |  4 ++--
src/include/utils/expandeddatum.h  |  2 +-
4 files changed, 17 insertions(+), 10 deletions(-)



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


end of thread, other threads:[~2019-07-01 00:36 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2019-07-01 00:36 pgsql: Don't read fields of a misaligned ExpandedObjectHeader or AnyArr Noah Misch <noah@leadboat.com>
2019-07-01 00:36 pgsql: Don't read fields of a misaligned ExpandedObjectHeader or AnyArr Noah Misch <noah@leadboat.com>
2019-07-01 00:36 pgsql: Don't read fields of a misaligned ExpandedObjectHeader or AnyArr Noah Misch <noah@leadboat.com>
2019-07-01 00:36 pgsql: Don't read fields of a misaligned ExpandedObjectHeader or AnyArr Noah Misch <noah@leadboat.com>
2019-07-01 00:36 pgsql: Don't read fields of a misaligned ExpandedObjectHeader or AnyArr Noah Misch <noah@leadboat.com>

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