Skip to content

block: fix zones_cond memory leak in blk_revalidate_disk_zones()#708

Open
blktests-ci[bot] wants to merge 1 commit intolinus-master_basefrom
series/1075054=>linus-master
Open

block: fix zones_cond memory leak in blk_revalidate_disk_zones()#708
blktests-ci[bot] wants to merge 1 commit intolinus-master_basefrom
series/1075054=>linus-master

Conversation

@blktests-ci
Copy link
Copy Markdown

@blktests-ci blktests-ci bot commented Mar 31, 2026

Pull request for series with
subject: block: fix zones_cond memory leak in blk_revalidate_disk_zones()
version: 1
url: https://patchwork.kernel.org/project/linux-block/list/?series=1075054

@blktests-ci
Copy link
Copy Markdown
Author

blktests-ci bot commented Mar 31, 2026

Upstream branch: 7aaa804
series: https://patchwork.kernel.org/project/linux-block/list/?series=1075054
version: 1

@blktests-ci
Copy link
Copy Markdown
Author

blktests-ci bot commented Mar 31, 2026

Upstream branch: 7aaa804
series: https://patchwork.kernel.org/project/linux-block/list/?series=1075093
version: 2

@blktests-ci blktests-ci bot added V2 and removed V1 V1-ci-fail labels Mar 31, 2026
@blktests-ci blktests-ci bot force-pushed the series/1075054=>linus-master branch from 0a7035b to 8d51a57 Compare March 31, 2026 10:05
@blktests-ci blktests-ci bot force-pushed the linus-master_base branch from c781e1e to 255b4bf Compare March 31, 2026 12:54
@blktests-ci
Copy link
Copy Markdown
Author

blktests-ci bot commented Mar 31, 2026

Upstream branch: d0c3bcd
series: https://patchwork.kernel.org/project/linux-block/list/?series=1075093
version: 2

@blktests-ci blktests-ci bot force-pushed the series/1075054=>linus-master branch from 8d51a57 to 6afb49e Compare March 31, 2026 12:57
@blktests-ci blktests-ci bot force-pushed the linus-master_base branch from 255b4bf to 3236861 Compare April 1, 2026 02:20
@blktests-ci
Copy link
Copy Markdown
Author

blktests-ci bot commented Apr 1, 2026

Upstream branch: 9147566
series: https://patchwork.kernel.org/project/linux-block/list/?series=1075093
version: 2

@blktests-ci blktests-ci bot force-pushed the series/1075054=>linus-master branch from 6afb49e to d944c69 Compare April 1, 2026 02:23
@blktests-ci blktests-ci bot force-pushed the linus-master_base branch 2 times, most recently from ecbdbb4 to 480b162 Compare April 2, 2026 07:52
@blktests-ci
Copy link
Copy Markdown
Author

blktests-ci bot commented Apr 2, 2026

Upstream branch: 9147566
series: https://patchwork.kernel.org/project/linux-block/list/?series=1075093
version: 2

@blktests-ci blktests-ci bot force-pushed the series/1075054=>linus-master branch from d944c69 to a3224d2 Compare April 2, 2026 07:53
@blktests-ci blktests-ci bot force-pushed the linus-master_base branch 2 times, most recently from a96fba7 to 0cd6ac2 Compare April 3, 2026 07:51
@blktests-ci
Copy link
Copy Markdown
Author

blktests-ci bot commented Apr 3, 2026

Upstream branch: 9147566
series: https://patchwork.kernel.org/project/linux-block/list/?series=1075093
version: 2

@blktests-ci blktests-ci bot force-pushed the series/1075054=>linus-master branch from a3224d2 to 49c4562 Compare April 3, 2026 07:53
@blktests-ci blktests-ci bot force-pushed the linus-master_base branch from 0cd6ac2 to 910d344 Compare April 3, 2026 11:53
@blktests-ci
Copy link
Copy Markdown
Author

blktests-ci bot commented Apr 3, 2026

Upstream branch: d8a9a4b
series: https://patchwork.kernel.org/project/linux-block/list/?series=1075093
version: 2

@blktests-ci blktests-ci bot force-pushed the series/1075054=>linus-master branch from 49c4562 to 8ca1c1e Compare April 3, 2026 11:56
@blktests-ci blktests-ci bot force-pushed the linus-master_base branch from 910d344 to ed862bc Compare April 4, 2026 05:34
@blktests-ci
Copy link
Copy Markdown
Author

blktests-ci bot commented Apr 4, 2026

Upstream branch: 7ca6d1c
series: https://patchwork.kernel.org/project/linux-block/list/?series=1075093
version: 2

@blktests-ci blktests-ci bot force-pushed the series/1075054=>linus-master branch from 8ca1c1e to a9604d1 Compare April 4, 2026 05:37
@blktests-ci blktests-ci bot force-pushed the linus-master_base branch from ed862bc to 2d0c3d5 Compare April 4, 2026 16:55
@blktests-ci
Copy link
Copy Markdown
Author

blktests-ci bot commented Apr 4, 2026

Upstream branch: 3aae938
series: https://patchwork.kernel.org/project/linux-block/list/?series=1075093
version: 2

@blktests-ci blktests-ci bot force-pushed the series/1075054=>linus-master branch from a9604d1 to e859be5 Compare April 4, 2026 16:58
@blktests-ci blktests-ci bot force-pushed the linus-master_base branch from 2d0c3d5 to 931d9b0 Compare April 8, 2026 10:29
@blktests-ci
Copy link
Copy Markdown
Author

blktests-ci bot commented Apr 8, 2026

Upstream branch: 3036cd0
series: https://patchwork.kernel.org/project/linux-block/list/?series=1075093
version: 2

@blktests-ci blktests-ci bot force-pushed the series/1075054=>linus-master branch from e859be5 to fd80008 Compare April 8, 2026 10:40
@blktests-ci blktests-ci bot force-pushed the linus-master_base branch from 931d9b0 to 78a4682 Compare April 10, 2026 00:51
@blktests-ci
Copy link
Copy Markdown
Author

blktests-ci bot commented Apr 10, 2026

Upstream branch: 9a9c8ce
series: https://patchwork.kernel.org/project/linux-block/list/?series=1075093
version: 2

Fix memory leaks of args.zones_cond allocated in
disk_revalidate_zone_resources() on multiple error paths:

1) When disk_revalidate_zone_resources() itself fails (e.g.
   disk_alloc_zone_resources() returns an error), blk_revalidate_disk_zones()
   returns directly without freeing args.zones_cond.

2) When report_zones() fails or the capacity check fails,
   disk_free_zone_resources() only frees the old disk->zones_cond, not
   the newly allocated args.zones_cond.

3) When the nr_conv_zones validation fails in disk_update_zone_resources(),
   the code jumps to unfreeze before disk_set_zones_cond_array() transfers
   ownership of args->zones_cond to disk->zones_cond.

Fix this by freeing args->zones_cond at each error site: in
blk_revalidate_disk_zones() when disk_revalidate_zone_resources() or zone
reporting fails, and in disk_update_zone_resources() before jumping to
the unfreeze label.

Fixes: 6e945ff ("block: use zone condition to determine conventional zones")
Signed-off-by: Jackie Liu <liuyun01@kylinos.cn>
@blktests-ci blktests-ci bot force-pushed the series/1075054=>linus-master branch from fd80008 to bb385be Compare April 10, 2026 00:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants