diff options
| author | Qu Wenruo <wqu@suse.com> | 2026-10-09 08:43:39 +1030 |
|---|---|---|
| committer | David Sterba <dsterba@suse.com> | 2026-10-12 19:18:10 +0200 |
| commit | 940983a3000361ddff834a1c55bdb0e9e47ed88b (patch) | |
| tree | 440c98e68b5cd77565084e97fcbab3f72d8abef1 /tools/perf/scripts/python/stackcollapse.py | |
| parent | 9985f1643ac3f8595862e2f82108f0ccae4cf959 (diff) | |
| download | linux-940983a3000361ddff834a1c55bdb0e9e47ed88b.tar.gz linux-940983a3000361ddff834a1c55bdb0e9e47ed88b.zip | |
btrfs: prevent use-after-free in btrfs_transaction::switch_commits
If a transaction is aborted during committing,
btrfs_transaction::switch_commits can be non-empty, but the
btrfs_transaction structure can be freed at the last
btrfs_put_transaction() inside cleanup_transaction().
The btrfs_root::dirty_list entry still linked into switch_commits will
point to already released memory, causing use-after-free.
Address this problem by manually deleting all entries inside
btrfs_transaction::switch_commits.
And since we're here, also release the dirty_log_pages and qgroup
swapped blocks for that root, which are only released during a
successful switch_commit_roots() call.
Reviewed-by: Boris Burkov <boris@bur.io>
Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'tools/perf/scripts/python/stackcollapse.py')
0 files changed, 0 insertions, 0 deletions
