lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Sat, 30 Dec 2023 16:34:39 +0800
From: Daniel J Blueman <daniel@...ra.org>
To: Kent Overstreet <kent.overstreet@...ux.dev>
Cc: linux-bcachefs@...r.kernel.org, 
	Linux Kernel <linux-kernel@...r.kernel.org>
Subject: Re: Stack corruption in bch2_nocow_write

On Sat, 30 Dec 2023 at 02:54, Kent Overstreet <kent.overstreet@...ux.dev> wrote:
>
> 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)

Thanks for the quick update, Kent.

With this change and a few runs of the reproducer, I still hit this
stack corruption with the same backtrace.

Let me know for any further testing,
  Dan
-- 
Daniel J Blueman

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ