- Notifications
You must be signed in to change notification settings - Fork4.9k
Commit0d9114b
committed
aio: Fix crash potential for pg_aios views due to late state update
pgaio_io_reclaim() reset the fields in PgAioHandle before updating the stateto IDLE or incrementing the generation. For most things that's OK, but forpg_get_aios() it is not - if it copied the PgAioHandle while fields were beingreset, we wouldn't detect that and could callpgaio_io_get_target_description() with ioh->target == PGAIO_TID_INVALID,leading to a crash.Fix this issue by incrementing the generation and state earlier, beforeresetting.Also add an assertion to pgaio_io_get_target_description() for the target tobe valid - that'd have made this case a bit easier to debug. While at it,add/update a few related assertions.Author: Alexander Lakhin <exclusion@gmail.com>Discussion:https://postgr.es/m/062daca9-dfad-4750-9da8-b13388301ad9@gmail.com1 parent76d52e7 commit0d9114b
2 files changed
+24
-9
lines changedLines changed: 15 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
670 | 670 |
| |
671 | 671 |
| |
672 | 672 |
| |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
673 | 688 |
| |
674 | 689 |
| |
675 | 690 |
| |
| |||
679 | 694 |
| |
680 | 695 |
| |
681 | 696 |
| |
682 |
| - | |
683 |
| - | |
684 |
| - | |
685 |
| - | |
686 |
| - | |
687 |
| - | |
688 | 697 |
| |
689 | 698 |
| |
690 | 699 |
| |
|
Lines changed: 9 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
49 | 49 |
| |
50 | 50 |
| |
51 | 51 |
| |
52 |
| - | |
| 52 | + | |
| 53 | + | |
53 | 54 |
| |
54 | 55 |
| |
55 | 56 |
| |
| |||
82 | 83 |
| |
83 | 84 |
| |
84 | 85 |
| |
| 86 | + | |
| 87 | + | |
| 88 | + | |
85 | 89 |
| |
86 | 90 |
| |
87 | 91 |
| |
| |||
98 | 102 |
| |
99 | 103 |
| |
100 | 104 |
| |
| 105 | + | |
| 106 | + | |
101 | 107 |
| |
102 | 108 |
| |
103 | 109 |
| |
| |||
109 | 115 |
| |
110 | 116 |
| |
111 | 117 |
| |
112 |
| - | |
113 |
| - | |
| 118 | + | |
| 119 | + | |
114 | 120 |
| |
115 | 121 |
| |
116 | 122 |
|
0 commit comments
Comments
(0)