Re: 12.1 not useable: clientlib fails after a dozen queries (GSSAPI ?)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter <pmc(at)citylink(dot)dinoex(dot)sub(dot)org>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org, Stephen Frost <sfrost(at)snowman(dot)net>
Subject: Re: 12.1 not useable: clientlib fails after a dozen queries (GSSAPI ?)
Date: 2020-01-10 17:59:09
Message-ID: 12348.1578679149@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

[ redirecting to -hackers ]

Peter <pmc(at)citylink(dot)dinoex(dot)sub(dot)org> writes:
> But I just recognize something of interest (which I had taken for
> granted when importing the database): the flaw does NOT appear when
> accessing the database from the server's local system (with TCP and
> GSSAPI encryption active). Only from remote system.
> But then, if I go on the local system, and change the mtu:
> # ifconfig lo0 mtu 1500
> and restart the server, then I get the exact same errors locally.

Oh-ho, that is interesting.

Looking at our regression tests for gssenc, I observe that they
only try to transport a negligible amount of data (viz, single-row
boolean results). So we'd not notice any problem that involved
multiple-packet messages.

I modified the kerberos test so that it tries a query with a less
negligible amount of data, and what I find is:

* passes on Fedora 30, with either default or 1500 mtu
* passes on FreeBSD 12.0 with default mtu
* FAILS on FreeBSD 12.0 with mtu = 1500

I haven't run it further to ground than that, but there's definitely
something fishy here. Based on just these results one would be hard
pressed to say if it's our bug or FreeBSD's, but your report that you
don't see the failure with PG 11 makes it sound like our problem.

OTOH, I also find that there's some hysteresis in the behavior:
once it's failed, reverting the mtu to the default setting doesn't
necessarily make subsequent runs pass. It's really hard to explain
that behavior if it's our bug.

I tested today's HEAD of our code with up-to-date FreeBSD 12.0-RELEASE-p12
running on amd64 bare metal, no jails or emulators or VIMAGE or anything.

Attached are proposed test patch, as well as client-side regression log
output from a failure. (There's no evidence of distress in the
postmaster log, same as your report.)

regards, tom lane

Attachment Content-Type Size
check-gssenc-data-transport-1.patch text/x-diff 1.5 KB
regress_log_001_auth text/plain 40.6 KB

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message dagamier 2020-01-10 18:01:25 pg_repack in cluster
Previous Message Israel Brewster 2020-01-10 17:39:27 Re: UPDATE many records

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephen Frost 2020-01-10 19:18:59 Re: Removing pg_pltemplate and creating "trustable" extensions
Previous Message Fujii Masao 2020-01-10 17:12:15 Re: Add pg_file_sync() to adminpack