pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: ryancaicse@gmail.com
Subject: BUG #17186: In connect.c, the lock connections_mutex is not correctly released(Line 463) at the return(Line 522)
Date: Fri, 10 Sep 2021 04:29:36 +0000
Message-ID: <17186-b4cfd8f0eb4d1dee@postgresql.org> (raw)

The following bug has been logged on the website:

Bug reference:      17186
Logged by:          An improper locking bug due to the unreleased lock connections_mutex in
/ecpg/ecpglib/connect.c
Email address:      ryancaicse@gmail.com
PostgreSQL version: 14beta3
Operating system:   All
Description:        

This is a possible improper locking bug, which can lead to resource leaks
and even deadlock. I am not sure whether it can lead to a security
problem.
The problem is that the lock connections_mutex should be released at the end
of the function. But it not released when conn_keywords == NULL ||
conn_values == NULL (ecpg_alloc got errors and return NULL).
Thank you for your checking.

Locations:
https://github.com/postgres/postgres/blob/c30f54ad732ca5c8762bb68bbe0f51de9137dd72/src/interfaces/ec...
https://github.com/postgres/postgres/blob/c30f54ad732ca5c8762bb68bbe0f51de9137dd72/src/interfaces/ec...



view thread (4+ messages)  latest in thread

Message-ID: <17186-b4cfd8f0eb4d1dee@postgresql.org>
Permalink:  ../17186-b4cfd8f0eb4d1dee@postgresql.org/
Also on:    postgresql.org/message-id/17186-b4cfd8f0eb4d1dee@postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: noreply@postgresql.org, pgsql-bugs@lists.postgresql.org, ryancaicse@gmail.com
  Subject: Re: BUG #17186: In connect.c, the lock connections_mutex is not correctly released(Line 463) at the return(Line 522)
  In-Reply-To: <17186-b4cfd8f0eb4d1dee@postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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