projects
/
linux-block.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f3a65bb
)
bcachefs: ec: Ensure new stripe is closed in error path
author
Kent Overstreet
<kent.overstreet@linux.dev>
Tue, 28 Feb 2023 03:30:54 +0000
(22:30 -0500)
committer
Kent Overstreet
<kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:09:55 +0000
(17:09 -0400)
This fixes a use-after-free bug.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/ec.c
patch
|
blob
|
blame
|
history
diff --git
a/fs/bcachefs/ec.c
b/fs/bcachefs/ec.c
index 88f319992c371929795e173ad4c1d579767a2766..cb291b2a4dd8f124d6975c6dc71a9088b9482572 100644
(file)
--- a/
fs/bcachefs/ec.c
+++ b/
fs/bcachefs/ec.c
@@
-1107,8
+1107,6
@@
static void ec_stripe_create(struct ec_stripe_new *s)
bch2_err_str(ret));
goto err;
}
-
- bch2_stripe_close(c, s);
err:
bch2_disk_reservation_put(c, &s->res);
@@
-1124,6
+1122,8
@@
err:
}
}
+ bch2_stripe_close(c, s);
+
ec_stripe_buf_exit(&s->existing_stripe);
ec_stripe_buf_exit(&s->new_stripe);
closure_debug_destroy(&s->iodone);