model-writtenrun 258 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- shihao zhong proposed making pg_stat_get_backend_subxact() follow existing statistics permissions, with tests and documentation, in #1; Michael Paquier had advised treating this as a consistency improvement on the development branch rather than a security vulnerability.
- Jim Jones identified the same missing checks in backend IO, WAL, and lock functions, added explicit pg_read_all_stats coverage, and noticed the C tuple-descriptor naming mismatch in #2.
- Michael requested one combined permission patch with a shared test role and a separately backpatchable documentation correction in #3, and Jim supplied that split in #4.
- Michael committed the documentation-only portion of #4 as ce420353fa, correcting subxact_overflow to subxact_overflowed without changing the submitted hunk, and announced it in #5.
- shihao resumed the remaining permission work in #6, changing the owner test to exercise inherited role privileges and clarifying that restricted functions can return NULL, no rows, or an insufficient-privilege indication.
- Michael separately extracted the unchanged C tuple-descriptor correction from #6 into 92aaf50e23 and invited Bertrand Drouvot to review the remaining permission changes in #7.
- Bertrand supported restricting per-backend statistics but found that cached statistics could belong to an older backend occupying the same ProcNumber in #8; shihao reproduced unauthorized access and proposed adding PID to statistics keys in #9.
- Michael rejected PID-bearing keys because they removed the natural shared-memory bound supplied by ProcNumber reuse in #10, leading shihao to store and validate PID inside statistics entries in #11 and repair the patch presentation in #12.
- Michael explained that authorization must use ownership stored with the statistics themselves in #13, while Bertrand advocated retaining PID matching as well in #14; shihao implemented both fields and reset preservation in #17.
- Bertrand identified a separate race between copying backend status and reading transaction counters, and raised stable-branch field-layout concerns in #18; shihao moved the new fields to the structure's end and added a separate PID check under ProcArrayLock in #19.
- Michael argued that cumulative-statistics PID filtering would change cache and snapshot behavior and that identity handling should be considered across statistics kinds in #20; shihao consequently removed that PID tracking while retaining userid-based authorization and the optional transaction-status check in #21.
- Bertrand accepted userid-only authorization and requested a comment explaining cached statistics from reused ProcNumbers in #22; shihao added that comment while retaining the separate transaction-status proposal in #23.
- Michael objected that the transaction-status PID argument complicated the ProcNumberGetTransactionIds() API contract in #24, so shihao withdrew that patch and submitted the unchanged permission patch alone in #25.
- solai v reported successful regression and targeted permission tests in #26, then explicitly confirmed the final patch's ownership handling, reset preservation, and documentation in #27; the two naming fixes had landed, while the permission change remained under review and both proposed PID checks had been dropped.