pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: waldump: fix use-after-free in search_directory().
5+ messages / 1 participants
[nested] [flat]

* pgsql: waldump: fix use-after-free in search_directory().
@ 2022-03-28 01:29  Andres Freund <andres@anarazel.de>
  0 siblings, 0 replies; 5+ messages in thread

From: Andres Freund @ 2022-03-28 01:29 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

waldump: fix use-after-free in search_directory().

After closedir() dirent->d_name is not valid anymore. As there alerady are a
few places relying on the limited lifetime of pg_waldump, do so here as well,
and just pg_strdup() the string.

The bug was introduced in fc49e24fa69a.

Found by UBSan, run locally.

Backpatch: 11-, like fc49e24fa69 itself.

Branch
------
REL_14_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/6839aa7a6921d133a51e6162b9ee710ab712293d

Modified Files
--------------
src/bin/pg_waldump/pg_waldump.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)



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

* pgsql: waldump: fix use-after-free in search_directory().
@ 2022-03-28 01:29  Andres Freund <andres@anarazel.de>
  0 siblings, 0 replies; 5+ messages in thread

From: Andres Freund @ 2022-03-28 01:29 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

waldump: fix use-after-free in search_directory().

After closedir() dirent->d_name is not valid anymore. As there alerady are a
few places relying on the limited lifetime of pg_waldump, do so here as well,
and just pg_strdup() the string.

The bug was introduced in fc49e24fa69a.

Found by UBSan, run locally.

Backpatch: 11-, like fc49e24fa69 itself.

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/264d284929e0d5a419821f94f16f766b5497c87a

Modified Files
--------------
src/bin/pg_waldump/pg_waldump.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)



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

* pgsql: waldump: fix use-after-free in search_directory().
@ 2022-03-28 01:29  Andres Freund <andres@anarazel.de>
  0 siblings, 0 replies; 5+ messages in thread

From: Andres Freund @ 2022-03-28 01:29 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

waldump: fix use-after-free in search_directory().

After closedir() dirent->d_name is not valid anymore. As there alerady are a
few places relying on the limited lifetime of pg_waldump, do so here as well,
and just pg_strdup() the string.

The bug was introduced in fc49e24fa69a.

Found by UBSan, run locally.

Backpatch: 11-, like fc49e24fa69 itself.

Branch
------
REL_11_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/7d935bdf7af71aaa1654366b9fd051581660326a

Modified Files
--------------
src/bin/pg_waldump/pg_waldump.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)



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

* pgsql: waldump: fix use-after-free in search_directory().
@ 2022-03-28 01:29  Andres Freund <andres@anarazel.de>
  0 siblings, 0 replies; 5+ messages in thread

From: Andres Freund @ 2022-03-28 01:29 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

waldump: fix use-after-free in search_directory().

After closedir() dirent->d_name is not valid anymore. As there alerady are a
few places relying on the limited lifetime of pg_waldump, do so here as well,
and just pg_strdup() the string.

The bug was introduced in fc49e24fa69a.

Found by UBSan, run locally.

Backpatch: 11-, like fc49e24fa69 itself.

Branch
------
REL_12_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/5ebd262dcbacddbd359d08c032fa04bfdf839b36

Modified Files
--------------
src/bin/pg_waldump/pg_waldump.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)



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

* pgsql: waldump: fix use-after-free in search_directory().
@ 2022-03-28 01:29  Andres Freund <andres@anarazel.de>
  0 siblings, 0 replies; 5+ messages in thread

From: Andres Freund @ 2022-03-28 01:29 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

waldump: fix use-after-free in search_directory().

After closedir() dirent->d_name is not valid anymore. As there alerady are a
few places relying on the limited lifetime of pg_waldump, do so here as well,
and just pg_strdup() the string.

The bug was introduced in fc49e24fa69a.

Found by UBSan, run locally.

Backpatch: 11-, like fc49e24fa69 itself.

Branch
------
REL_13_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/344d89abf36b9ea559a4b25543bbc7d4206988f5

Modified Files
--------------
src/bin/pg_waldump/pg_waldump.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)



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


end of thread, other threads:[~2022-03-28 01:29 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2022-03-28 01:29 pgsql: waldump: fix use-after-free in search_directory(). Andres Freund <andres@anarazel.de>
2022-03-28 01:29 pgsql: waldump: fix use-after-free in search_directory(). Andres Freund <andres@anarazel.de>
2022-03-28 01:29 pgsql: waldump: fix use-after-free in search_directory(). Andres Freund <andres@anarazel.de>
2022-03-28 01:29 pgsql: waldump: fix use-after-free in search_directory(). Andres Freund <andres@anarazel.de>
2022-03-28 01:29 pgsql: waldump: fix use-after-free in search_directory(). Andres Freund <andres@anarazel.de>

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