pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Fix two violations of the ResourceOwnerEnlarge/Remember protocol 6+ messages / 1 participants [nested] [flat]
* pgsql: Fix two violations of the ResourceOwnerEnlarge/Remember protocol @ 2017-11-08 21:53 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2017-11-08 21:53 UTC (permalink / raw) To: pgsql-committers Fix two violations of the ResourceOwnerEnlarge/Remember protocol. The point of having separate ResourceOwnerEnlargeFoo and ResourceOwnerRememberFoo functions is so that resource allocation can happen in between. Doing it in some other order is just wrong. OpenTemporaryFile() did open(), enlarge, remember, which would leak the open file if the enlarge step ran out of memory. Because fd.c has its own layer of resource-remembering, the consequences look like they'd be limited to an intratransaction FD leak, but it's still not good. IncrBufferRefCount() did enlarge, remember, incr-refcount, which would blow up if the incr-refcount step ever failed. It was safe enough when written, but since the introduction of PrivateRefCountHash, I think the assumption that no error could happen there is pretty shaky. The odds of real problems from either bug are probably small, but still, back-patch to supported branches. Thomas Munro and Tom Lane, per a comment from Andres Freund Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/c5269472ea9bb4a6fbb8a0510f7d676d725933ab Modified Files -------------- src/backend/storage/buffer/bufmgr.c | 2 +- src/backend/storage/file/fd.c | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Fix two violations of the ResourceOwnerEnlarge/Remember protocol @ 2017-11-08 21:53 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2017-11-08 21:53 UTC (permalink / raw) To: pgsql-committers Fix two violations of the ResourceOwnerEnlarge/Remember protocol. The point of having separate ResourceOwnerEnlargeFoo and ResourceOwnerRememberFoo functions is so that resource allocation can happen in between. Doing it in some other order is just wrong. OpenTemporaryFile() did open(), enlarge, remember, which would leak the open file if the enlarge step ran out of memory. Because fd.c has its own layer of resource-remembering, the consequences look like they'd be limited to an intratransaction FD leak, but it's still not good. IncrBufferRefCount() did enlarge, remember, incr-refcount, which would blow up if the incr-refcount step ever failed. It was safe enough when written, but since the introduction of PrivateRefCountHash, I think the assumption that no error could happen there is pretty shaky. The odds of real problems from either bug are probably small, but still, back-patch to supported branches. Thomas Munro and Tom Lane, per a comment from Andres Freund Branch ------ REL_10_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/442bc4160caee01579f5c112c23d9bb5f121f6b6 Modified Files -------------- src/backend/storage/buffer/bufmgr.c | 2 +- src/backend/storage/file/fd.c | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Fix two violations of the ResourceOwnerEnlarge/Remember protocol @ 2017-11-08 21:53 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2017-11-08 21:53 UTC (permalink / raw) To: pgsql-committers Fix two violations of the ResourceOwnerEnlarge/Remember protocol. The point of having separate ResourceOwnerEnlargeFoo and ResourceOwnerRememberFoo functions is so that resource allocation can happen in between. Doing it in some other order is just wrong. OpenTemporaryFile() did open(), enlarge, remember, which would leak the open file if the enlarge step ran out of memory. Because fd.c has its own layer of resource-remembering, the consequences look like they'd be limited to an intratransaction FD leak, but it's still not good. IncrBufferRefCount() did enlarge, remember, incr-refcount, which would blow up if the incr-refcount step ever failed. It was safe enough when written, but since the introduction of PrivateRefCountHash, I think the assumption that no error could happen there is pretty shaky. The odds of real problems from either bug are probably small, but still, back-patch to supported branches. Thomas Munro and Tom Lane, per a comment from Andres Freund Branch ------ REL9_6_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/b89ad383da7dfcf1c5888076d60bb914c6169ec6 Modified Files -------------- src/backend/storage/buffer/bufmgr.c | 2 +- src/backend/storage/file/fd.c | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Fix two violations of the ResourceOwnerEnlarge/Remember protocol @ 2017-11-08 21:53 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2017-11-08 21:53 UTC (permalink / raw) To: pgsql-committers Fix two violations of the ResourceOwnerEnlarge/Remember protocol. The point of having separate ResourceOwnerEnlargeFoo and ResourceOwnerRememberFoo functions is so that resource allocation can happen in between. Doing it in some other order is just wrong. OpenTemporaryFile() did open(), enlarge, remember, which would leak the open file if the enlarge step ran out of memory. Because fd.c has its own layer of resource-remembering, the consequences look like they'd be limited to an intratransaction FD leak, but it's still not good. IncrBufferRefCount() did enlarge, remember, incr-refcount, which would blow up if the incr-refcount step ever failed. It was safe enough when written, but since the introduction of PrivateRefCountHash, I think the assumption that no error could happen there is pretty shaky. The odds of real problems from either bug are probably small, but still, back-patch to supported branches. Thomas Munro and Tom Lane, per a comment from Andres Freund Branch ------ REL9_5_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/d7f59347bc06cb26fe3eff283f9104ac1b26d177 Modified Files -------------- src/backend/storage/buffer/bufmgr.c | 2 +- src/backend/storage/file/fd.c | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Fix two violations of the ResourceOwnerEnlarge/Remember protocol @ 2017-11-08 21:53 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2017-11-08 21:53 UTC (permalink / raw) To: pgsql-committers Fix two violations of the ResourceOwnerEnlarge/Remember protocol. The point of having separate ResourceOwnerEnlargeFoo and ResourceOwnerRememberFoo functions is so that resource allocation can happen in between. Doing it in some other order is just wrong. OpenTemporaryFile() did open(), enlarge, remember, which would leak the open file if the enlarge step ran out of memory. Because fd.c has its own layer of resource-remembering, the consequences look like they'd be limited to an intratransaction FD leak, but it's still not good. IncrBufferRefCount() did enlarge, remember, incr-refcount, which would blow up if the incr-refcount step ever failed. It was safe enough when written, but since the introduction of PrivateRefCountHash, I think the assumption that no error could happen there is pretty shaky. The odds of real problems from either bug are probably small, but still, back-patch to supported branches. Thomas Munro and Tom Lane, per a comment from Andres Freund Branch ------ REL9_4_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/1786cdab113701f154ca804537fe1c21d23e4ce8 Modified Files -------------- src/backend/storage/buffer/bufmgr.c | 2 +- src/backend/storage/file/fd.c | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Fix two violations of the ResourceOwnerEnlarge/Remember protocol @ 2017-11-08 21:53 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2017-11-08 21:53 UTC (permalink / raw) To: pgsql-committers Fix two violations of the ResourceOwnerEnlarge/Remember protocol. The point of having separate ResourceOwnerEnlargeFoo and ResourceOwnerRememberFoo functions is so that resource allocation can happen in between. Doing it in some other order is just wrong. OpenTemporaryFile() did open(), enlarge, remember, which would leak the open file if the enlarge step ran out of memory. Because fd.c has its own layer of resource-remembering, the consequences look like they'd be limited to an intratransaction FD leak, but it's still not good. IncrBufferRefCount() did enlarge, remember, incr-refcount, which would blow up if the incr-refcount step ever failed. It was safe enough when written, but since the introduction of PrivateRefCountHash, I think the assumption that no error could happen there is pretty shaky. The odds of real problems from either bug are probably small, but still, back-patch to supported branches. Thomas Munro and Tom Lane, per a comment from Andres Freund Branch ------ REL9_3_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/13492fcf9bb1a25034db3e5ec200a999b1efc371 Modified Files -------------- src/backend/storage/buffer/bufmgr.c | 2 +- src/backend/storage/file/fd.c | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers ^ permalink raw reply [nested|flat] 6+ messages in thread
end of thread, other threads:[~2017-11-08 21:53 UTC | newest] Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2017-11-08 21:53 pgsql: Fix two violations of the ResourceOwnerEnlarge/Remember protocol Tom Lane <tgl@sss.pgh.pa.us> 2017-11-08 21:53 pgsql: Fix two violations of the ResourceOwnerEnlarge/Remember protocol Tom Lane <tgl@sss.pgh.pa.us> 2017-11-08 21:53 pgsql: Fix two violations of the ResourceOwnerEnlarge/Remember protocol Tom Lane <tgl@sss.pgh.pa.us> 2017-11-08 21:53 pgsql: Fix two violations of the ResourceOwnerEnlarge/Remember protocol Tom Lane <tgl@sss.pgh.pa.us> 2017-11-08 21:53 pgsql: Fix two violations of the ResourceOwnerEnlarge/Remember protocol Tom Lane <tgl@sss.pgh.pa.us> 2017-11-08 21:53 pgsql: Fix two violations of the ResourceOwnerEnlarge/Remember protocol Tom Lane <tgl@sss.pgh.pa.us>
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