pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix use-after-free bug with AfterTriggersTableData.storeslot
4+ messages / 1 participants
[nested] [flat]

* pgsql: Fix use-after-free bug with AfterTriggersTableData.storeslot
@ 2021-02-27 21:10 Alvaro Herrera <alvherre@alvh.no-ip.org>
  0 siblings, 0 replies; 4+ messages in thread

From: Alvaro Herrera @ 2021-02-27 21:10 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix use-after-free bug with AfterTriggersTableData.storeslot

AfterTriggerSaveEvent() wrongly allocates the slot in execution-span
memory context, whereas the correct thing is to allocate it in
a transaction-span context, because that's where the enclosing
AfterTriggersTableData instance belongs into.

Backpatch to 12 (the test back to 11, where it works well with no code
changes, and it's good to have to confirm that the case was previously
well supported); this bug seems introduced by commit ff11e7f4b9ae.

Reported-by: Bertrand Drouvot <bdrouvot@amazon.com>
Author: Amit Langote <amitlangote09@gmail.com>
Discussion: https://postgr.es/m/39a71864-b120-5a5c-8cc5-c632b6f16761@amazon.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/25936fd46c97039aad042ae8d46917d38d132fe4

Modified Files
--------------
src/backend/commands/trigger.c         | 52 +++++++++++++++++----------
src/test/regress/expected/triggers.out | 59 ++++++++++++++++++++++++++++++
src/test/regress/sql/triggers.sql      | 65 ++++++++++++++++++++++++++++++++++
3 files changed, 157 insertions(+), 19 deletions(-)



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

* pgsql: Fix use-after-free bug with AfterTriggersTableData.storeslot
@ 2021-02-27 21:10 Alvaro Herrera <alvherre@alvh.no-ip.org>
  0 siblings, 0 replies; 4+ messages in thread

From: Alvaro Herrera @ 2021-02-27 21:10 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix use-after-free bug with AfterTriggersTableData.storeslot

AfterTriggerSaveEvent() wrongly allocates the slot in execution-span
memory context, whereas the correct thing is to allocate it in
a transaction-span context, because that's where the enclosing
AfterTriggersTableData instance belongs into.

Backpatch to 12 (the test back to 11, where it works well with no code
changes, and it's good to have to confirm that the case was previously
well supported); this bug seems introduced by commit ff11e7f4b9ae.

Reported-by: Bertrand Drouvot <bdrouvot@amazon.com>
Author: Amit Langote <amitlangote09@gmail.com>
Discussion: https://postgr.es/m/39a71864-b120-5a5c-8cc5-c632b6f16761@amazon.com

Branch
------
REL_13_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/2688852a49ea52e5663c09f91cdcf43697e10814

Modified Files
--------------
src/backend/commands/trigger.c         | 52 +++++++++++++++++----------
src/test/regress/expected/triggers.out | 59 ++++++++++++++++++++++++++++++
src/test/regress/sql/triggers.sql      | 65 ++++++++++++++++++++++++++++++++++
3 files changed, 157 insertions(+), 19 deletions(-)



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

* pgsql: Fix use-after-free bug with AfterTriggersTableData.storeslot
@ 2021-02-27 21:10 Alvaro Herrera <alvherre@alvh.no-ip.org>
  0 siblings, 0 replies; 4+ messages in thread

From: Alvaro Herrera @ 2021-02-27 21:10 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix use-after-free bug with AfterTriggersTableData.storeslot

AfterTriggerSaveEvent() wrongly allocates the slot in execution-span
memory context, whereas the correct thing is to allocate it in
a transaction-span context, because that's where the enclosing
AfterTriggersTableData instance belongs into.

Backpatch to 12 (the test back to 11, where it works well with no code
changes, and it's good to have to confirm that the case was previously
well supported); this bug seems introduced by commit ff11e7f4b9ae.

Reported-by: Bertrand Drouvot <bdrouvot@amazon.com>
Author: Amit Langote <amitlangote09@gmail.com>
Discussion: https://postgr.es/m/39a71864-b120-5a5c-8cc5-c632b6f16761@amazon.com

Branch
------
REL_12_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/262eb990c72097bd804e5c747fe38bf9b3a1ded9

Modified Files
--------------
src/backend/commands/trigger.c         | 52 +++++++++++++++++----------
src/test/regress/expected/triggers.out | 59 ++++++++++++++++++++++++++++++
src/test/regress/sql/triggers.sql      | 65 ++++++++++++++++++++++++++++++++++
3 files changed, 157 insertions(+), 19 deletions(-)



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

* pgsql: Fix use-after-free bug with AfterTriggersTableData.storeslot
@ 2021-02-27 21:10 Alvaro Herrera <alvherre@alvh.no-ip.org>
  0 siblings, 0 replies; 4+ messages in thread

From: Alvaro Herrera @ 2021-02-27 21:10 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix use-after-free bug with AfterTriggersTableData.storeslot

AfterTriggerSaveEvent() wrongly allocates the slot in execution-span
memory context, whereas the correct thing is to allocate it in
a transaction-span context, because that's where the enclosing
AfterTriggersTableData instance belongs into.

Backpatch to 12 (the test back to 11, where it works well with no code
changes, and it's good to have to confirm that the case was previously
well supported); this bug seems introduced by commit ff11e7f4b9ae.

Reported-by: Bertrand Drouvot <bdrouvot@amazon.com>
Author: Amit Langote <amitlangote09@gmail.com>
Discussion: https://postgr.es/m/39a71864-b120-5a5c-8cc5-c632b6f16761@amazon.com

Branch
------
REL_11_STABLE

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

Modified Files
--------------
src/test/regress/expected/triggers.out | 59 ++++++++++++++++++++++++++++++
src/test/regress/sql/triggers.sql      | 65 ++++++++++++++++++++++++++++++++++
2 files changed, 124 insertions(+)



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


end of thread, other threads:[~2021-02-27 21:10 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-02-27 21:10 pgsql: Fix use-after-free bug with AfterTriggersTableData.storeslot Alvaro Herrera <alvherre@alvh.no-ip.org>
2021-02-27 21:10 pgsql: Fix use-after-free bug with AfterTriggersTableData.storeslot Alvaro Herrera <alvherre@alvh.no-ip.org>
2021-02-27 21:10 pgsql: Fix use-after-free bug with AfterTriggersTableData.storeslot Alvaro Herrera <alvherre@alvh.no-ip.org>
2021-02-27 21:10 pgsql: Fix use-after-free bug with AfterTriggersTableData.storeslot Alvaro Herrera <alvherre@alvh.no-ip.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