pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix out-of-bounds read in json_lex_string
5+ messages / 4 participants
[nested] [flat]

* pgsql: Fix out-of-bounds read in json_lex_string
@ 2022-07-12 04:27 John Naylor <john.naylor@postgresql.org>
  2022-07-12 05:44 ` Re: pgsql: Fix out-of-bounds read in json_lex_string John Naylor <john.naylor@enterprisedb.com>
  0 siblings, 1 reply; 5+ messages in thread

From: John Naylor @ 2022-07-12 04:27 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix out-of-bounds read in json_lex_string

Commit 3838fa269 added a lookahead loop to allow building strings multiple
bytes at a time. This loop could exit because it reached the end of input,
yet did not check for that before checking if we reached the end of a
valid string. To fix, put the end of string check back in the outer loop.

Per Valgrind animal skink

Branch
------
master

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

Modified Files
--------------
src/common/jsonapi.c | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)



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

* Re: pgsql: Fix out-of-bounds read in json_lex_string
  2022-07-12 04:27 pgsql: Fix out-of-bounds read in json_lex_string John Naylor <john.naylor@postgresql.org>
@ 2022-07-12 05:44 ` John Naylor <john.naylor@enterprisedb.com>
  2022-07-12 06:00   ` Re: pgsql: Fix out-of-bounds read in json_lex_string Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 5+ messages in thread

From: John Naylor @ 2022-07-12 05:44 UTC (permalink / raw)
  To: John Naylor <john.naylor@postgresql.org>; +Cc: pgsql-committers@lists.postgresql.org

On Tue, Jul 12, 2022 at 11:27 AM John Naylor <john.naylor@postgresql.org> wrote:
>
> Fix out-of-bounds read in json_lex_string

The failure on peripatus (FreeBSD HEAD) seems completely unrelated to
the changes in the commit:

ld: error: unable to find library -lldap_r
clang: error: linker command failed with exit code 1 (use -v to see invocation)
gmake[3]: *** [../../../src/Makefile.shlib:258: libpq.so.5] Error 1


-- 
John Naylor
EDB: http://www.enterprisedb.com





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

* Re: pgsql: Fix out-of-bounds read in json_lex_string
  2022-07-12 04:27 pgsql: Fix out-of-bounds read in json_lex_string John Naylor <john.naylor@postgresql.org>
  2022-07-12 05:44 ` Re: pgsql: Fix out-of-bounds read in json_lex_string John Naylor <john.naylor@enterprisedb.com>
@ 2022-07-12 06:00   ` Tom Lane <tgl@sss.pgh.pa.us>
  2022-07-12 06:07     ` Re: pgsql: Fix out-of-bounds read in json_lex_string Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 5+ messages in thread

From: Tom Lane @ 2022-07-12 06:00 UTC (permalink / raw)
  To: John Naylor <john.naylor@enterprisedb.com>; +Cc: ler@lerctr.org; pgsql-committers@lists.postgresql.org

John Naylor <john.naylor@enterprisedb.com> writes:
> On Tue, Jul 12, 2022 at 11:27 AM John Naylor <john.naylor@postgresql.org> wrote:
>> Fix out-of-bounds read in json_lex_string

> The failure on peripatus (FreeBSD HEAD) seems completely unrelated to
> the changes in the commit:
> ld: error: unable to find library -lldap_r

Agreed, that looks like some unrelated platform change.  Larry?

			regards, tom lane





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

* Re: pgsql: Fix out-of-bounds read in json_lex_string
  2022-07-12 04:27 pgsql: Fix out-of-bounds read in json_lex_string John Naylor <john.naylor@postgresql.org>
  2022-07-12 05:44 ` Re: pgsql: Fix out-of-bounds read in json_lex_string John Naylor <john.naylor@enterprisedb.com>
  2022-07-12 06:00   ` Re: pgsql: Fix out-of-bounds read in json_lex_string Tom Lane <tgl@sss.pgh.pa.us>
@ 2022-07-12 06:07     ` Tom Lane <tgl@sss.pgh.pa.us>
  2022-07-12 15:29       ` Re: pgsql: Fix out-of-bounds read in json_lex_string Larry Rosenman <ler@lerctr.org>
  0 siblings, 1 reply; 5+ messages in thread

From: Tom Lane @ 2022-07-12 06:07 UTC (permalink / raw)
  To: ler@lerctr.org; +Cc: John Naylor <john.naylor@enterprisedb.com>; pgsql-committers@lists.postgresql.org

I wrote:
> John Naylor <john.naylor@enterprisedb.com> writes:
>> ld: error: unable to find library -lldap_r

> Agreed, that looks like some unrelated platform change.  Larry?

Upon further thought, this looks like fallout from an upgrade to
OpenLDAP 2.5, which eliminated libldap_r.  That should be fine,
but you might need to blow away the animal's accache files to
make configure reconsider the situation.

			regards, tom lane





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

* Re: pgsql: Fix out-of-bounds read in json_lex_string
  2022-07-12 04:27 pgsql: Fix out-of-bounds read in json_lex_string John Naylor <john.naylor@postgresql.org>
  2022-07-12 05:44 ` Re: pgsql: Fix out-of-bounds read in json_lex_string John Naylor <john.naylor@enterprisedb.com>
  2022-07-12 06:00   ` Re: pgsql: Fix out-of-bounds read in json_lex_string Tom Lane <tgl@sss.pgh.pa.us>
  2022-07-12 06:07     ` Re: pgsql: Fix out-of-bounds read in json_lex_string Tom Lane <tgl@sss.pgh.pa.us>
@ 2022-07-12 15:29       ` Larry Rosenman <ler@lerctr.org>
  0 siblings, 0 replies; 5+ messages in thread

From: Larry Rosenman @ 2022-07-12 15:29 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: John Naylor <john.naylor@enterprisedb.com>; pgsql-committers@lists.postgresql.org

On 07/12/2022 1:07 am, Tom Lane wrote:
> I wrote:
>> John Naylor <john.naylor@enterprisedb.com> writes:
>>> ld: error: unable to find library -lldap_r
> 
>> Agreed, that looks like some unrelated platform change.  Larry?
> 
> Upon further thought, this looks like fallout from an upgrade to
> OpenLDAP 2.5, which eliminated libldap_r.  That should be fine,
> but you might need to blow away the animal's accache files to
> make configure reconsider the situation.
> 
> 			regards, tom lane

I've killed the accache and ccache files, and it's flipped back to OK.
Yes, ports deprecated/removed openldap24 and replaced it with 
openldap26, and the host got
updated last night.
Sorry for the grief :)

-- 
Larry Rosenman                     http://www.lerctr.org/~ler
Phone: +1 214-642-9640                 E-Mail: ler@lerctr.org
US Mail: 5708 Sabbia Dr, Round Rock, TX 78665-2106





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


end of thread, other threads:[~2022-07-12 15:29 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2022-07-12 04:27 pgsql: Fix out-of-bounds read in json_lex_string John Naylor <john.naylor@postgresql.org>
2022-07-12 05:44 ` John Naylor <john.naylor@enterprisedb.com>
2022-07-12 06:00   ` Tom Lane <tgl@sss.pgh.pa.us>
2022-07-12 06:07     ` Tom Lane <tgl@sss.pgh.pa.us>
2022-07-12 15:29       ` Larry Rosenman <ler@lerctr.org>

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