mirror of
https://github.com/freebsd/freebsd-src.git
synced 2026-10-28 11:25:21 +01:00
Fix use-afer-free regression in RAIDZ expansion
We should not dereference rra after the last zio_nowait() is called. It seems very unlikely, but ASAN in ztest managed to catch it. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Alexander Motin <[email protected]> Sponsored by: iXsystems, Inc. Closes #16868
This commit is contained in:
1 parent
586304ac44
commit
ff6266ee9b
1 file changed
+2
-2
@@ -3914,8 +3914,8 @@ raidz_reflow_read_done(zio_t *zio)
|
||||
|
||||
if (atomic_dec_32_nv(&rra->rra_tbd) > 0)
|
||||
return;
|
||||
rra->rra_tbd = rra->rra_writes;
|
||||
for (uint64_t i = 0; i < rra->rra_writes; i++)
|
||||
uint32_t writes = rra->rra_tbd = rra->rra_writes;
|
||||
for (uint64_t i = 0; i < writes; i++)
|
||||
zio_nowait(rra->rra_zio[i]);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user