[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <jt3gy5v3jhqadakhxbdezvfo2n2f4n7sc52ljw4kztct6poihr@zork6muwdity>
Date: Fri, 29 Dec 2023 13:54:53 -0500
From: Kent Overstreet <kent.overstreet@...ux.dev>
To: Daniel J Blueman <daniel@...ra.org>
Cc: linux-bcachefs@...r.kernel.org,
Linux Kernel <linux-kernel@...r.kernel.org>
Subject: Re: Stack corruption in bch2_nocow_write
On Fri, Dec 29, 2023 at 07:43:13PM +0800, Daniel J Blueman wrote:
> Hi Kent et al,
>
> On Linux 6.7-rc7 from bcachefs master SHA f3608cbdfd built with UBSAN
> [1], with a crafted workload [2] I'm able to trigger stack corruption
> in bch2_nocow_write [3].
>
> Let me know if you can't reproduce it and I'll check reproducibility
> on another platform, and let me know for any patch testing.
this should be fixed in the testing branch:
commit ab35f724070ccdaa31f6376a1890473e7d031ed0
Author: Kent Overstreet <kent.overstreet@...ux.dev>
Date: Fri Dec 29 13:54:00 2023 -0500
bcachefs: fix nocow write path when writing to multiple extents
Signed-off-by: Kent Overstreet <kent.overstreet@...ux.dev>
diff --git a/fs/bcachefs/io_write.c b/fs/bcachefs/io_write.c
index c5961bac19f0..7c5963cd0b85 100644
--- a/fs/bcachefs/io_write.c
+++ b/fs/bcachefs/io_write.c
@@ -1316,6 +1316,7 @@ static void bch2_nocow_write(struct bch_write_op *op)
closure_get(&op->cl);
bch2_submit_wbio_replicas(to_wbio(bio), c, BCH_DATA_user,
op->insert_keys.top, true);
+ nr_buckets = 0;
bch2_keylist_push(&op->insert_keys);
if (op->flags & BCH_WRITE_DONE)
Powered by blists - more mailing lists