Skip to content

btrfs-progs: image: various LLM found memory

Qu Wenruo linux-btrfs 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest12 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/12btrfs-progs: image: destroy chunk tree after all pthreads finishedimage/image-restore.c+11 -100 replies
2/12btrfs-progs: image: only remove a chunk map from physical tree if non-emptyimage/image-restore.c+3 -10 replies
3/12btrfs-progs: image: cleanup pending ordered works after an errorimage/image-create.c+14 -50 replies
4/12btrfs-progs: image: do not cleanup the thread that failed to be createdimage/image-create.c+1 -10 replies
5/12btrfs-progs: image: free the buffer if output allocation failedimage/image-create.c+1 -00 replies
6/12btrfs-progs: image: avoid NULL-ptr-deref in build_chunk_tree()image/image-restore.c+1 -10 replies
7/12btrfs-progs: image: fix the error handling of build_chunk_tree()image/image-restore.c+5 -40 replies
8/12btrfs-progs: image: fix memory leak on async_work for restoreimage/image-restore.c+10 -00 replies
9/12btrfs-progs: image: fix overwritten ret in restore_metadump()image/image-restore.c+3 -30 replies
10/12btrfs-progs: image: validate the nritems before reading the contentimage/image-restore.c+16 -00 replies
11/12btrfs-progs: image: reject incorrect super block sizeimage/image-restore.c image/metadump.h+43 -60 replies
12/12btrfs-progs: image: properly error out when fseek() failedimage/image-restore.c+1 -00 replies

Reviews trailers per patch

None of the 12 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchJohannes Thumshirn
SeriesR-b
1/12
2/12
3/12
4/12
5/12
6/12
7/12
8/12
9/12
10/12
11/12
12/12

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 00/12] btrfs-progs: image: various LLM found memory

The btrfs-image code base is pretty old (and to be honest, not written to be read easily), and some stupid LLM-script-kiddies are reporting those as security problems.

I don't want to argue with those guys, so just fix obvious memory related problems for now.

There are still some left, mostly related to the corrupted tree blocks handling, those will be addressed later, as I'm still trying to figure out what's the best way to address them (e.g. tree-checker or adhoc fixes).

There is also a problem in the filename image/sanitize.c, but that only affects the filename sanitization, thus it's a very low priority item.

Qu Wenruo (12):
btrfs-progs: image: destroy chunk tree after all pthreads finished
btrfs-progs: image: only remove a chunk map from physical tree if
non-empty
btrfs-progs: image: cleanup pending ordered works after an error
btrfs-progs: image: do not cleanup the thread that failed to be
created
btrfs-progs: image: free the buffer if output allocation failed
btrfs-progs: image: avoid NULL-ptr-deref in build_chunk_tree()
btrfs-progs: image: fix the error handling of build_chunk_tree()
btrfs-progs: image: fix memory leak on async_work for restore
btrfs-progs: image: fix overwritten ret in restore_metadump()
btrfs-progs: image: validate the nritems before reading the content
btrfs-progs: image: reject incorrect super block size
btrfs-progs: image: properly error out when fseek() failed

 image/image-create.c  |  22 ++++++---
 image/image-restore.c | 109 +++++++++++++++++++++++++++++++++---------
 image/metadump.h      |   7 ++-
 3 files changed, 108 insertions(+), 30 deletions(-)

--
2.56.0