-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Commit f744c82
Fix GH-19706: dba stream resource mismanagement
This regressed in 8.4 when dba started mixing objects and resources
(streams).
The streams are first destroyed at a first step in shutdown, and in slow
shutdown then the symbol table is destroyed which destroys the dba
objects. The dba objects still use the streams but they have been
destroyed already, causing a UAF. Using dtor_obj instead of free_obj
would work around this but would cause issues like memory leaks because
dtor_obj may be skipped while free_obj may not be.
Instead, use the same solution as mysqlnd uses in that we fully manage
the stream lifecycle ourselves. This also avoids users from meddling
with the stream through get_resources().
This would be fixed 'automatically' in the future when we are using
objects for everything.
Closes GH-19710.1 parent c583124 commit f744c82
3 files changed
+45
-2
lines changedLines changed: 3 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
23 | 23 |
| |
24 | 24 |
| |
25 | 25 |
| |
26 | + | ||
27 | + | ||
28 | + | ||
26 | 29 |
| |
27 | 30 |
| |
28 | 31 |
| |
|
Lines changed: 22 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
256 | 256 |
| |
257 | 257 |
| |
258 | 258 |
| |
259 | - | ||
259 | + | ||
260 | 260 |
| |
261 | 261 |
| |
262 | 262 |
| |
263 | 263 |
| |
264 | 264 |
| |
265 | 265 |
| |
266 | - | ||
266 | + | ||
267 | 267 |
| |
268 | 268 |
| |
269 | 269 |
| |
| |||
518 | 518 |
| |
519 | 519 |
| |
520 | 520 |
| |
521 | + | ||
522 | + | ||
523 | + | ||
524 | + | ||
525 | + | ||
526 | + | ||
527 | + | ||
528 | + | ||
529 | + | ||
530 | + | ||
531 | + | ||
521 | 532 |
| |
522 | 533 |
| |
523 | 534 |
| |
| |||
831 | 842 |
| |
832 | 843 |
| |
833 | 844 |
| |
845 | + | ||
846 | + | ||
847 | + | ||
834 | 848 |
| |
835 | 849 |
| |
836 | 850 |
| |
| |||
844 | 858 |
| |
845 | 859 |
| |
846 | 860 |
| |
861 | + | ||
862 | + | ||
863 | + | ||
847 | 864 |
| |
848 | 865 |
| |
849 | 866 |
| |
| |||
880 | 897 |
| |
881 | 898 |
| |
882 | 899 |
| |
900 | + | ||
901 | + | ||
902 | + | ||
883 | 903 |
| |
884 | 904 |
| |
885 | 905 |
| |
|
Lines changed: 20 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 | + | ||
2 | + | ||
3 | + | ||
4 | + | ||
5 | + | ||
6 | + | ||
7 | + | ||
8 | + | ||
9 | + | ||
10 | + | ||
11 | + | ||
12 | + | ||
13 | + | ||
14 | + | ||
15 | + | ||
16 | + | ||
17 | + | ||
18 | + | ||
19 | + | ||
20 | + |
0 commit comments