forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commita117ceb
committed
Make relation-enumerating operations be security-restricted operations.
When a feature enumerates relations and runs functions associated withall found relations, the feature's user shall not need to trust everyuser having permission to create objects. BRIN-specific functionalityin autovacuum neglected to account for this, as did pg_amcheck andCLUSTER. An attacker having permission to create non-temp objects in atleast one schema could execute arbitrary SQL functions under theidentity of the bootstrap superuser. CREATE INDEX (not arelation-enumerating operation) and REINDEX protected themselves toolate. This change extends to the non-enumerating amcheck interface.Back-patch to v10 (all supported versions).Sergey Shinderuk, reviewed (in earlier versions) by Alexander Lakhin.Reported by Alexander Lakhin.Security:CVE-2022-15521 parentf45f8b7 commita117ceb
File tree
10 files changed
+378
-48
lines changed- contrib/amcheck
- expected
- sql
- src
- backend
- access/brin
- catalog
- commands
- utils/init
- test/regress
- expected
- sql
10 files changed
+378
-48
lines changedLines changed: 23 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
177 | 177 |
| |
178 | 178 |
| |
179 | 179 |
| |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
180 | 202 |
| |
181 | 203 |
| |
182 | 204 |
| |
183 | 205 |
| |
184 | 206 |
| |
185 | 207 |
| |
| 208 | + | |
186 | 209 |
| |
187 | 210 |
|
Lines changed: 21 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
115 | 115 |
| |
116 | 116 |
| |
117 | 117 |
| |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
118 | 138 |
| |
119 | 139 |
| |
120 | 140 |
| |
121 | 141 |
| |
122 | 142 |
| |
123 | 143 |
| |
| 144 | + | |
124 | 145 |
| |
125 | 146 |
|
Lines changed: 27 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
249 | 249 |
| |
250 | 250 |
| |
251 | 251 |
| |
| 252 | + | |
| 253 | + | |
| 254 | + | |
252 | 255 |
| |
253 | 256 |
| |
254 | 257 |
| |
| |||
265 | 268 |
| |
266 | 269 |
| |
267 | 270 |
| |
| 271 | + | |
268 | 272 |
| |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
269 | 284 |
| |
| 285 | + | |
270 | 286 |
| |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
271 | 292 |
| |
272 | 293 |
| |
273 | 294 |
| |
| |||
326 | 347 |
| |
327 | 348 |
| |
328 | 349 |
| |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
329 | 356 |
| |
330 | 357 |
| |
331 | 358 |
| |
|
Lines changed: 28 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1008 | 1008 |
| |
1009 | 1009 |
| |
1010 | 1010 |
| |
| 1011 | + | |
| 1012 | + | |
| 1013 | + | |
1011 | 1014 |
| |
1012 | 1015 |
| |
1013 | 1016 |
| |
| |||
1031 | 1034 |
| |
1032 | 1035 |
| |
1033 | 1036 |
| |
| 1037 | + | |
1034 | 1038 |
| |
| 1039 | + | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
1035 | 1053 |
| |
1036 | 1054 |
| |
1037 | 1055 |
| |
| |||
1046 | 1064 |
| |
1047 | 1065 |
| |
1048 | 1066 |
| |
1049 |
| - | |
| 1067 | + | |
1050 | 1068 |
| |
1051 | 1069 |
| |
1052 | 1070 |
| |
| |||
1064 | 1082 |
| |
1065 | 1083 |
| |
1066 | 1084 |
| |
| 1085 | + | |
| 1086 | + | |
| 1087 | + | |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
1067 | 1091 |
| |
1068 | 1092 |
| |
1069 | 1093 |
| |
| |||
1102 | 1126 |
| |
1103 | 1127 |
| |
1104 | 1128 |
| |
| 1129 | + | |
| 1130 | + | |
| 1131 | + | |
1105 | 1132 |
| |
1106 | 1133 |
| |
1107 | 1134 |
| |
|
Lines changed: 51 additions & 14 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1445 | 1445 |
| |
1446 | 1446 |
| |
1447 | 1447 |
| |
| 1448 | + | |
| 1449 | + | |
| 1450 | + | |
1448 | 1451 |
| |
1449 | 1452 |
| |
1450 | 1453 |
| |
| |||
1454 | 1457 |
| |
1455 | 1458 |
| |
1456 | 1459 |
| |
1457 |
| - | |
| 1460 | + | |
| 1461 | + | |
| 1462 | + | |
| 1463 | + | |
| 1464 | + | |
| 1465 | + | |
| 1466 | + | |
| 1467 | + | |
| 1468 | + | |
| 1469 | + | |
1458 | 1470 |
| |
1459 | 1471 |
| |
1460 | 1472 |
| |
| |||
1470 | 1482 |
| |
1471 | 1483 |
| |
1472 | 1484 |
| |
| 1485 | + | |
| 1486 | + | |
| 1487 | + | |
| 1488 | + | |
| 1489 | + | |
| 1490 | + | |
1473 | 1491 |
| |
1474 | 1492 |
| |
1475 | 1493 |
| |
| |||
3299 | 3317 |
| |
3300 | 3318 |
| |
3301 | 3319 |
| |
3302 |
| - | |
| 3320 | + | |
| 3321 | + | |
| 3322 | + | |
| 3323 | + | |
| 3324 | + | |
| 3325 | + | |
| 3326 | + | |
| 3327 | + | |
| 3328 | + | |
| 3329 | + | |
| 3330 | + | |
3303 | 3331 |
| |
3304 | 3332 |
| |
3305 | 3333 |
| |
| |||
3312 | 3340 |
| |
3313 | 3341 |
| |
3314 | 3342 |
| |
3315 |
| - | |
3316 |
| - | |
3317 |
| - | |
3318 |
| - | |
3319 |
| - | |
3320 |
| - | |
3321 |
| - | |
3322 |
| - | |
3323 |
| - | |
3324 |
| - | |
3325 | 3343 |
| |
3326 | 3344 |
| |
3327 | 3345 |
| |
| |||
3530 | 3548 |
| |
3531 | 3549 |
| |
3532 | 3550 |
| |
| 3551 | + | |
| 3552 | + | |
| 3553 | + | |
3533 | 3554 |
| |
3534 | 3555 |
| |
3535 | 3556 |
| |
| |||
3557 | 3578 |
| |
3558 | 3579 |
| |
3559 | 3580 |
| |
| 3581 | + | |
| 3582 | + | |
| 3583 | + | |
| 3584 | + | |
| 3585 | + | |
| 3586 | + | |
| 3587 | + | |
| 3588 | + | |
| 3589 | + | |
| 3590 | + | |
3560 | 3591 |
| |
3561 | 3592 |
| |
3562 | 3593 |
| |
| |||
3775 | 3806 |
| |
3776 | 3807 |
| |
3777 | 3808 |
| |
3778 |
| - | |
3779 |
| - | |
| 3809 | + | |
| 3810 | + | |
| 3811 | + | |
| 3812 | + | |
| 3813 | + | |
3780 | 3814 |
| |
3781 | 3815 |
| |
3782 | 3816 |
| |
3783 | 3817 |
| |
| 3818 | + | |
| 3819 | + | |
| 3820 | + | |
3784 | 3821 |
| |
3785 | 3822 |
| |
3786 | 3823 |
| |
|
0 commit comments
Comments
(0)