Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lwEZ1-0007C1-0f for pgsql-bugs@arkaria.postgresql.org; Thu, 24 Jun 2021 01:53:55 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lwEYy-0007Fy-7I for pgsql-bugs@arkaria.postgresql.org; Thu, 24 Jun 2021 01:53:52 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lwEYx-0007Fo-Ux for pgsql-bugs@lists.postgresql.org; Thu, 24 Jun 2021 01:53:52 +0000 Received: from mail-pg1-x52b.google.com ([2607:f8b0:4864:20::52b]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lwEYt-0006PN-D6 for pgsql-bugs@lists.postgresql.org; Thu, 24 Jun 2021 01:53:50 +0000 Received: by mail-pg1-x52b.google.com with SMTP id t9so3375995pgn.4 for ; Wed, 23 Jun 2021 18:53:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tekenlight.com; s=google; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=5jKE66g0vt/ke7UJzR0WCI0wrOtdK7MeGO7Zfkdbaq4=; b=SIbMEgZuHaUVIAL3BsspRoQoqxdPmKdodBoOfJ+NPIyHyzCvCZwudqlxtQjymjc4o3 DvtybCb2DIrsF9ny3UqS/WG74xm96fjMxmm6Nosza/Tea4AzBeFZzCSjiOWSN96QRg4j OD+MwN2T64i7EVURoT94j0qI3z+uFeCfx2+EP1fp3eX+00lYquys951NmgzhQ6QtBkdv t8xcPij3ixkvhk/0aSEOY//KPMvCuUQc434zRMC6FU2NvPI4R6+zjZ0i/XRaTPrR6rBk eigDrP7kOwRe0m+pRjK5k89jEuIlGxOJo49BfyA2TVPGf9YIBHY6p0wP0ZV6XFd3vsAZ jyrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=5jKE66g0vt/ke7UJzR0WCI0wrOtdK7MeGO7Zfkdbaq4=; b=OJCQBSpEgs+4oHzupR20z6L23ize7C0+GumU/z8jJzukdy7+jm/GnFejV5q+rVQR4K LwT4PPJF5FMSXVW3yYACev1wAw87BsKutKNU+xIH8tzaTH5TGniKY1Qy9xUn3mC7mfd+ fAa29kATcXxe5mw1GPG5/dXRDSYSVdaqt4u+XIuO54rOA9JmA+fFew85vcMrrY5a6Mj9 3KYR76iSnbnAiW9LJ8hIdA9huNmxcvxeMGbkfMxvdXzWF1ArhNbCTSCcGgEAOALHT0mZ 6LWiY8Juv0G05c+oHSroW6cWMSvbvpR4Nt8QOgyMx29myqj3ZH7dpbo+bopQMSbtNCo+ DF9w== X-Gm-Message-State: AOAM533r4rV4bJ0bQNPohleW5ns+l3BilFX5Fs/7BzZ8AU5Nap4c4dsn ebxYTx8J+nUZQrQcbGR01dLpIQ== X-Google-Smtp-Source: ABdhPJzns8haczWTj76wQFp4fJrtWENgiBaUlh4w1G+GDDDnNSlDHDuM6qUIuiSwXkAWK8QiD653pg== X-Received: by 2002:a63:70e:: with SMTP id 14mr2364699pgh.200.1624499624815; Wed, 23 Jun 2021 18:53:44 -0700 (PDT) Received: from smtpclient.apple ([106.203.200.69]) by smtp.gmail.com with ESMTPSA id j19sm362021pgm.44.2021.06.23.18.53.43 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Jun 2021 18:53:44 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.100.0.2.22\)) Subject: Re: Found a buffer-overflow defect in asynchronous database connection API PQconnectPoll From: Sudheer H R In-Reply-To: <2338837.1624471430@sss.pgh.pa.us> Date: Thu, 24 Jun 2021 07:23:37 +0530 Cc: pgsql-bugs@lists.postgresql.org Content-Transfer-Encoding: 7bit Message-Id: <54573F29-636F-4889-9673-7DE8C6645629@tekenlight.com> References: <5372B6D4-8276-42C0-B8FB-BD0918826FC3@tekenlight.com> <2080223.1624454678@sss.pgh.pa.us> <96EB194C-6EF0-4F79-A855-F28CD7DE4F95@tekenlight.com> <205CACC4-0EBF-4672-95F4-2E1949371FE7@tekenlight.com> <2081383.1624455807@sss.pgh.pa.us> <2081779.1624456225@sss.pgh.pa.us> <0988202C-570F-4919-B14E-135CCFCDB1C6@tekenlight.com> <2249065.1624464160@sss.pgh.pa.us> <2338837.1624471430@sss.pgh.pa.us> To: Tom Lane X-Mailer: Apple Mail (2.3654.100.0.2.22) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Thanks a lot > On 23-Jun-2021, at 11:33 PM, Tom Lane wrote: > > I wrote: >> Hmph. I can't reproduce this on RHEL8: so far as I can tell, the string >> is physically null-terminated, and clang's address sanitizer doesn't >> complain either. Still, given the vagueness of the spec for >> gss_display_status, it seems wise to not assume that every GSS >> implementation acts the same. > > I've committed fixes to make our code rely on the returned length > field instead. Hopefully that won't expose any new bugs in other > GSS implementations :-( > > regards, tom lane