pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Don't assume GSSAPI result strings are null-terminated. 6+ messages / 1 participants [nested] [flat]
* pgsql: Don't assume GSSAPI result strings are null-terminated. @ 2021-06-23 18:01 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2021-06-23 18:01 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Don't assume GSSAPI result strings are null-terminated. Our uses of gss_display_status() and gss_display_name() assumed that the gss_buffer_desc strings returned by those functions are null-terminated. It appears that they generally are, given the lack of field complaints up to now. However, the available documentation does not promise this, and some man pages for gss_display_status() show examples that rely on the gss_buffer_desc.length field instead of expecting null termination. Also, we now have a report that on some implementations, clang's address sanitizer is of the opinion that the byte after the specified length is undefined. Hence, change the code to rely on the length field instead. This might well be cosmetic rather than fixing any real bug, but it's hard to be sure, so back-patch to all supported branches. While here, also back-patch the v12 changes that made pg_GSS_error deal honestly with multiple messages available from gss_display_status. Per report from Sudheer H R. Discussion: https://postgr.es/m/5372B6D4-8276-42C0-B8FB-BD0918826FC3@tekenlight.com Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/126cdaf47af275f76b2f2ddb023bfdc6f018ae30 Modified Files -------------- src/backend/libpq/auth.c | 27 ++++++++++++++++++--------- src/backend/libpq/be-gssapi-common.c | 11 ++++++----- src/interfaces/libpq/fe-gssapi-common.c | 3 ++- 3 files changed, 26 insertions(+), 15 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Don't assume GSSAPI result strings are null-terminated. @ 2021-06-23 18:01 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2021-06-23 18:01 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Don't assume GSSAPI result strings are null-terminated. Our uses of gss_display_status() and gss_display_name() assumed that the gss_buffer_desc strings returned by those functions are null-terminated. It appears that they generally are, given the lack of field complaints up to now. However, the available documentation does not promise this, and some man pages for gss_display_status() show examples that rely on the gss_buffer_desc.length field instead of expecting null termination. Also, we now have a report that on some implementations, clang's address sanitizer is of the opinion that the byte after the specified length is undefined. Hence, change the code to rely on the length field instead. This might well be cosmetic rather than fixing any real bug, but it's hard to be sure, so back-patch to all supported branches. While here, also back-patch the v12 changes that made pg_GSS_error deal honestly with multiple messages available from gss_display_status. Per report from Sudheer H R. Discussion: https://postgr.es/m/5372B6D4-8276-42C0-B8FB-BD0918826FC3@tekenlight.com Branch ------ REL_13_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/13f3655683bac3cb8dc32f84f15b8141592ab281 Modified Files -------------- src/backend/libpq/auth.c | 25 +++++++++++++++++-------- src/backend/libpq/be-gssapi-common.c | 11 ++++++----- src/interfaces/libpq/fe-gssapi-common.c | 3 ++- 3 files changed, 25 insertions(+), 14 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Don't assume GSSAPI result strings are null-terminated. @ 2021-06-23 18:01 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2021-06-23 18:01 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Don't assume GSSAPI result strings are null-terminated. Our uses of gss_display_status() and gss_display_name() assumed that the gss_buffer_desc strings returned by those functions are null-terminated. It appears that they generally are, given the lack of field complaints up to now. However, the available documentation does not promise this, and some man pages for gss_display_status() show examples that rely on the gss_buffer_desc.length field instead of expecting null termination. Also, we now have a report that on some implementations, clang's address sanitizer is of the opinion that the byte after the specified length is undefined. Hence, change the code to rely on the length field instead. This might well be cosmetic rather than fixing any real bug, but it's hard to be sure, so back-patch to all supported branches. While here, also back-patch the v12 changes that made pg_GSS_error deal honestly with multiple messages available from gss_display_status. Per report from Sudheer H R. Discussion: https://postgr.es/m/5372B6D4-8276-42C0-B8FB-BD0918826FC3@tekenlight.com Branch ------ REL_12_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/7eaf65451483a871056036e92e4f0fa0350b5504 Modified Files -------------- src/backend/libpq/auth.c | 25 +++++++++++++++++-------- src/backend/libpq/be-gssapi-common.c | 11 ++++++----- src/interfaces/libpq/fe-gssapi-common.c | 3 ++- 3 files changed, 25 insertions(+), 14 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Don't assume GSSAPI result strings are null-terminated. @ 2021-06-23 18:01 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2021-06-23 18:01 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Don't assume GSSAPI result strings are null-terminated. Our uses of gss_display_status() and gss_display_name() assumed that the gss_buffer_desc strings returned by those functions are null-terminated. It appears that they generally are, given the lack of field complaints up to now. However, the available documentation does not promise this, and some man pages for gss_display_status() show examples that rely on the gss_buffer_desc.length field instead of expecting null termination. Also, we now have a report that on some implementations, clang's address sanitizer is of the opinion that the byte after the specified length is undefined. Hence, change the code to rely on the length field instead. This might well be cosmetic rather than fixing any real bug, but it's hard to be sure, so back-patch to all supported branches. While here, also back-patch the v12 changes that made pg_GSS_error deal honestly with multiple messages available from gss_display_status. Per report from Sudheer H R. Discussion: https://postgr.es/m/5372B6D4-8276-42C0-B8FB-BD0918826FC3@tekenlight.com Branch ------ REL_11_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/361acef7e4c0e5e8bfe881a1854e006f0aafed18 Modified Files -------------- src/backend/libpq/auth.c | 100 +++++++++++++++++++++++++++-------------- src/interfaces/libpq/fe-auth.c | 4 +- 2 files changed, 69 insertions(+), 35 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Don't assume GSSAPI result strings are null-terminated. @ 2021-06-23 18:01 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2021-06-23 18:01 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Don't assume GSSAPI result strings are null-terminated. Our uses of gss_display_status() and gss_display_name() assumed that the gss_buffer_desc strings returned by those functions are null-terminated. It appears that they generally are, given the lack of field complaints up to now. However, the available documentation does not promise this, and some man pages for gss_display_status() show examples that rely on the gss_buffer_desc.length field instead of expecting null termination. Also, we now have a report that on some implementations, clang's address sanitizer is of the opinion that the byte after the specified length is undefined. Hence, change the code to rely on the length field instead. This might well be cosmetic rather than fixing any real bug, but it's hard to be sure, so back-patch to all supported branches. While here, also back-patch the v12 changes that made pg_GSS_error deal honestly with multiple messages available from gss_display_status. Per report from Sudheer H R. Discussion: https://postgr.es/m/5372B6D4-8276-42C0-B8FB-BD0918826FC3@tekenlight.com Branch ------ REL_10_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/d3a845d1fd0fca8255f15aea508a6f86e2f5a852 Modified Files -------------- src/backend/libpq/auth.c | 100 +++++++++++++++++++++++++++-------------- src/interfaces/libpq/fe-auth.c | 4 +- 2 files changed, 69 insertions(+), 35 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Don't assume GSSAPI result strings are null-terminated. @ 2021-06-23 18:01 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2021-06-23 18:01 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Don't assume GSSAPI result strings are null-terminated. Our uses of gss_display_status() and gss_display_name() assumed that the gss_buffer_desc strings returned by those functions are null-terminated. It appears that they generally are, given the lack of field complaints up to now. However, the available documentation does not promise this, and some man pages for gss_display_status() show examples that rely on the gss_buffer_desc.length field instead of expecting null termination. Also, we now have a report that on some implementations, clang's address sanitizer is of the opinion that the byte after the specified length is undefined. Hence, change the code to rely on the length field instead. This might well be cosmetic rather than fixing any real bug, but it's hard to be sure, so back-patch to all supported branches. While here, also back-patch the v12 changes that made pg_GSS_error deal honestly with multiple messages available from gss_display_status. Per report from Sudheer H R. Discussion: https://postgr.es/m/5372B6D4-8276-42C0-B8FB-BD0918826FC3@tekenlight.com Branch ------ REL9_6_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/006a829b2d1427974a4d7ae58f1191be2d0ae705 Modified Files -------------- src/backend/libpq/auth.c | 100 +++++++++++++++++++++++++++-------------- src/interfaces/libpq/fe-auth.c | 4 +- 2 files changed, 69 insertions(+), 35 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
end of thread, other threads:[~2021-06-23 18:01 UTC | newest] Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2021-06-23 18:01 pgsql: Don't assume GSSAPI result strings are null-terminated. Tom Lane <tgl@sss.pgh.pa.us> 2021-06-23 18:01 pgsql: Don't assume GSSAPI result strings are null-terminated. Tom Lane <tgl@sss.pgh.pa.us> 2021-06-23 18:01 pgsql: Don't assume GSSAPI result strings are null-terminated. Tom Lane <tgl@sss.pgh.pa.us> 2021-06-23 18:01 pgsql: Don't assume GSSAPI result strings are null-terminated. Tom Lane <tgl@sss.pgh.pa.us> 2021-06-23 18:01 pgsql: Don't assume GSSAPI result strings are null-terminated. Tom Lane <tgl@sss.pgh.pa.us> 2021-06-23 18:01 pgsql: Don't assume GSSAPI result strings are null-terminated. 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