forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitccc8194
committed
Fix use-after-free in parallel_vacuum_reset_dead_items
parallel_vacuum_reset_dead_items used a local variable to hold apointer from the passed vacrel, purely as a shorthand. This pointerwas later freed and a new allocation was made and stored to thestruct. Then the local pointer was mistakenly referenced again.This apparently happened not to break anything since the freed chunkwould have been put on the context's freelist, so it was accidentallythe same pointer anyway, in which case the DSA handle was correctlyupdated. The minimal fix is to change two places so they accessdead_items through the vacrel. This coding style is a maintenancehazard, so while at it get rid of most other similar usages, whichwere inconsistently used anyway.Analysis and patch by Vallimaharajan G, with further defensive codingby meBackpath to v17, when TidStore came inDiscussion:https://postgr.es/m/1936493cc38.68cb2ef27266.7456585136086197135@zohocorp.com1 parent7727049 commitccc8194
File tree
2 files changed
+9
-15
lines changed- src/backend
- access/heap
- commands
2 files changed
+9
-15
lines changedLines changed: 6 additions & 11 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
828 | 828 |
| |
829 | 829 |
| |
830 | 830 |
| |
831 |
| - | |
832 |
| - | |
833 | 831 |
| |
834 | 832 |
| |
835 | 833 |
| |
| |||
841 | 839 |
| |
842 | 840 |
| |
843 | 841 |
| |
844 |
| - | |
| 842 | + | |
845 | 843 |
| |
846 | 844 |
| |
847 | 845 |
| |
| |||
884 | 882 |
| |
885 | 883 |
| |
886 | 884 |
| |
887 |
| - | |
| 885 | + | |
888 | 886 |
| |
889 | 887 |
| |
890 | 888 |
| |
| |||
1054 | 1052 |
| |
1055 | 1053 |
| |
1056 | 1054 |
| |
1057 |
| - | |
| 1055 | + | |
1058 | 1056 |
| |
1059 | 1057 |
| |
1060 | 1058 |
| |
| |||
2895 | 2893 |
| |
2896 | 2894 |
| |
2897 | 2895 |
| |
2898 |
| - | |
2899 | 2896 |
| |
2900 | 2897 |
| |
2901 | 2898 |
| |
2902 | 2899 |
| |
2903 | 2900 |
| |
2904 | 2901 |
| |
2905 |
| - | |
| 2902 | + | |
2906 | 2903 |
| |
2907 | 2904 |
| |
2908 | 2905 |
| |
2909 | 2906 |
| |
2910 |
| - | |
| 2907 | + | |
2911 | 2908 |
| |
2912 | 2909 |
| |
2913 | 2910 |
| |
| |||
2917 | 2914 |
| |
2918 | 2915 |
| |
2919 | 2916 |
| |
2920 |
| - | |
2921 |
| - | |
2922 | 2917 |
| |
2923 | 2918 |
| |
2924 | 2919 |
| |
2925 | 2920 |
| |
2926 | 2921 |
| |
2927 | 2922 |
| |
2928 | 2923 |
| |
2929 |
| - | |
| 2924 | + | |
2930 | 2925 |
| |
2931 | 2926 |
| |
2932 | 2927 |
| |
|
Lines changed: 3 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
474 | 474 |
| |
475 | 475 |
| |
476 | 476 |
| |
477 |
| - | |
478 | 477 |
| |
479 | 478 |
| |
480 | 479 |
| |
481 | 480 |
| |
482 | 481 |
| |
483 | 482 |
| |
484 | 483 |
| |
485 |
| - | |
| 484 | + | |
486 | 485 |
| |
487 | 486 |
| |
488 | 487 |
| |
489 | 488 |
| |
490 |
| - | |
491 |
| - | |
| 489 | + | |
| 490 | + | |
492 | 491 |
| |
493 | 492 |
| |
494 | 493 |
| |
|
0 commit comments
Comments
(0)