- Notifications
You must be signed in to change notification settings - Fork5
Commitef1b5af
committed
Do not let PostmasterContext survive into background workers.
We don't want postmaster child processes to contain a copy of thepostmaster's PostmasterContext. That would be a waste of memory at least,and at worst a security issue, since there are copies of the semi-sensitivepg_hba and pg_ident data in there. All other child process types deletethe PostmasterContext after forking, but the original coding of thebackground worker patch (commitda07a1e) did not do so. It appearsthat the only reason for that was to avoid copying the bgworker'sMyBgworkerEntry out of that context; but the couple of additionalstatements needed to do so are hardly good justification for it. Hence,copy that data and then clear the context as other child processes do.Because this patch changes the memory context in which a bgworker functiongains control, back-patching it would be a bit risky, so we won't fix thisin back branches. The "security" complaint is pretty thin anyway forgeneric bgworkers; only with the introduction of parallel query is thereany question of running untrusted code in a bgworker process.Discussion: <14111.1470082717@sss.pgh.pa.us>1 parent6a9e09c commitef1b5af
2 files changed
+20
-7
lines changedLines changed: 14 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
5181 | 5181 |
| |
5182 | 5182 |
| |
5183 | 5183 |
| |
5184 |
| - | |
| 5184 | + | |
5185 | 5185 |
| |
5186 | 5186 |
| |
5187 | 5187 |
| |
| |||
5529 | 5529 |
| |
5530 | 5530 |
| |
5531 | 5531 |
| |
5532 |
| - | |
| 5532 | + | |
| 5533 | + | |
| 5534 | + | |
| 5535 | + | |
| 5536 | + | |
| 5537 | + | |
| 5538 | + | |
| 5539 | + | |
| 5540 | + | |
| 5541 | + | |
| 5542 | + | |
| 5543 | + | |
5533 | 5544 |
| |
5534 |
| - | |
5535 | 5545 |
| |
5536 | 5546 |
| |
5537 | 5547 |
| |
5538 | 5548 |
| |
5539 | 5549 |
| |
5540 | 5550 |
| |
5541 | 5551 |
| |
| 5552 | + | |
5542 | 5553 |
| |
5543 | 5554 |
| |
5544 | 5555 |
| |
|
Lines changed: 6 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
160 | 160 |
| |
161 | 161 |
| |
162 | 162 |
| |
163 |
| - | |
164 |
| - | |
165 |
| - | |
166 |
| - | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
167 | 169 |
| |
168 | 170 |
| |
169 | 171 |
| |
|
0 commit comments
Comments
(0)