btrfs-progs: btrfs path leak fix, part 1
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest5 patches 0 repliesNew
- v15 patches 0 repliesSuperseded
Changes in v2 from the cover letter
- Drop unused cleanup functions
Those functions uses "auto" attribute, which we didn't define.
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/5 | btrfs-progs: introduce compiler_attributes.hinclude/ include/ kernel-lib/ | +35 | 0 replies | |
| 2/5 | btrfs-progs: utilize __cleanup__ attribute for btrfs_pathconfigure.ac include/ kernel-shared/ +1 more | +62 | 0 replies | |
| 3/5 | btrfs-progs: sync btrfs_translate_remap() to fix a path leakkernel-shared/ | +13 | 0 replies | |
| 4/5 | btrfs-progs: fix a path leak in alloc_reserved_tree_block()kernel-shared/ | +2 | 0 replies | |
| 5/5 | btrfs-progs: fix several memory bugs in btrfs-corrupt-blockbtrfs-corrupt-block.c | +23 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.
Cover letter [PATCH v2 0/5] btrfs-progs: btrfs path leak fix, part 1
[CHANGELOG]
v2:
- Drop unused cleanup functions
Those functions uses "auto" attribute, which we didn't define.
Considering we don't use them yet, just remove them.
To avoid future LLM script kiddos, we need to fix path leaks.
This is part 1, focusing on leaks on btrfs_alloc_path().
The most important part is the second patch, which introduces BTRFS_PATH_AUTO_(FREE|RELEASE), so that we can finally get the same capability.
Unfortunately this will require the compiler support for the __cleanup__ attribute. If not supported, configure will reject the build.
Then several fixes using BTRFS_PATH_AUTO_FREE().
The last one has several other small fixes batched together, as they are all inside the same btrfs-corrupt-block.
Part 2 will focus on the on-stack paths, which can still leak the ebs, and are the most common sites in btrfs-progs.
Qu Wenruo (5):
btrfs-progs: introduce compiler_attributes.h
btrfs-progs: utilize __cleanup__ attribute for btrfs_path
btrfs-progs: sync btrfs_translate_remap() to fix a path leak
btrfs-progs: fix a path leak in alloc_reserved_tree_block()
btrfs-progs: fix several memory bugs in btrfs-corrupt-block
btrfs-corrupt-block.c | 34 +++++++++++++++------- configure.ac | 15 ++++++++++ include/compiler_attributes.h | 39 +++++++++++++++++++++++++ include/kerncompat.h | 7 +---- kernel-lib/overflow.h | 8 +---- kernel-shared/cleanup.h | 31 ++++++++++++++++++++ kernel-shared/ctree.h | 10 +++++++ kernel-shared/extent-tree.c | 4 +-- kernel-shared/volumes.c | 55 +++++++++-------------------------- 9 files changed, 135 insertions(+), 68 deletions(-) create mode 100644 include/compiler_attributes.h create mode 100644 kernel-shared/cleanup.h
--
2.56.0