Re: [PATCH] bcachefs: fix null-ptr-deref in have_stripes()

2024-10-23 Thread Kent Overstreet
On Thu, Oct 24, 2024 at 01:13:45AM +0900, Jeongjun Park wrote: > c->btree_roots_known[i].b can be NULL. In this case, a NULL pointer > dereference > occurs, so you need to add code to check the variable. > > Reported-by: syzbot+b468b9fef56949c3b...@syzkaller.appspotmail.com > Fixes: ("bcachefs: m

Re: bcachefs extent_entry_type setters

2024-10-23 Thread Kent Overstreet
On Thu, Oct 24, 2024 at 01:50:15AM +0300, ahmed Ehab wrote: > Hi sir, > I am currently working on a bug related to invalid extent_entry_type. Is > there a place where we set this type for a bch_extent_entry? I found a > method for crc type but I got no luck finding a generalized method for this. T

Re: [PATCH] bcachefs: Allocator now directly wakes up copygc when necessary

2024-10-23 Thread Ahmad Draidi
Greetings, On 10/20/24 01:56, Kent Overstreet wrote: copygc tries to wait in a way that balances waiting for work to accumulate with running before we run out of free space - but for a variety of reasons (multiple devices, io clock slop, the vagaries of fragmentation) this isn't completely reli

Re: [Syzkaller & bisect] There is INFO: task hung in __rq_qos_throttle

2024-10-23 Thread Kent Overstreet
On Mon, Oct 21, 2024 at 06:27:25PM +0800, Lai, Yi wrote: > Hi Kent Overstreet, > > Greetings! > > I used Syzkaller and found that there is INFO: task hung in __rq_qos_throttle > in v6.12-rc2 > > After bisection and the first bad commit is: > " > 63332394c7e1 bcachefs: Move snapshot table size t

[PATCH] bcachefs: Fix invalid shift in validate_sb_layout()

2024-10-23 Thread Gianfranco Trad
Add check on layout->sb_max_size_bits against BCH_SB_LAYOUT_SIZE_BITS_MAX to prevent UBSAN shift-out-of-bounds in validate_sb_layout(). Reported-by: syzbot+089fad5a3a5e77825...@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=089fad5a3a5e77825426 Fixes: 03ef80b469d5 ("bcac

Re: [syzbot] [bcachefs?] UBSAN: shift-out-of-bounds in validate_sb_layout

2024-10-23 Thread syzbot
syzbot has bisected this issue to: commit 03ef80b469d5d83530ce1ce15be78a40e5300f9b Author: Kent Overstreet Date: Sat Sep 23 22:41:51 2023 + bcachefs: Ignore unknown mount options bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=12accc3058 start commit: c2ee9f594da8 K

Re: [PATCH] bcachefs: Explicitly select CRYPTO from BCACHEFS_FS

2024-10-23 Thread Eric Biggers
On Wed, Oct 23, 2024 at 02:49:38PM -0400, Kent Overstreet wrote: > On Wed, Oct 23, 2024 at 06:35:21PM +, Eric Biggers wrote: > > From: Eric Biggers > > > > Explicitly select CRYPTO from BCACHEFS_FS, so that this dependency of > > CRYPTO_SHA256, CRYPTO_CHACHA20, and CRYPTO_POLY1305 (which are

[PATCH] bcachefs: Explicitly select CRYPTO from BCACHEFS_FS

2024-10-23 Thread Eric Biggers
From: Eric Biggers Explicitly select CRYPTO from BCACHEFS_FS, so that this dependency of CRYPTO_SHA256, CRYPTO_CHACHA20, and CRYPTO_POLY1305 (which are also selected) is satisfied. Currently this dependency is satisfied indirectly via LIBCRC32C, but this is fragile and is planned to change (http

Re: [PATCH] bcachefs: Explicitly select CRYPTO from BCACHEFS_FS

2024-10-23 Thread Kent Overstreet
On Wed, Oct 23, 2024 at 06:35:21PM +, Eric Biggers wrote: > From: Eric Biggers > > Explicitly select CRYPTO from BCACHEFS_FS, so that this dependency of > CRYPTO_SHA256, CRYPTO_CHACHA20, and CRYPTO_POLY1305 (which are also > selected) is satisfied. Currently this dependency is satisfied > in

[syzbot] [bcachefs?] possible deadlock in __bch2_trans_relock

2024-10-23 Thread syzbot
Hello, syzbot found the following issue on: HEAD commit:3d5ad2d4eca3 Merge tag 'bpf-fixes' of git://git.kernel.org.. git tree: upstream console output: https://syzkaller.appspot.com/x/log.txt?x=16b1324058 kernel config: https://syzkaller.appspot.com/x/.config?x=cfbd94c114a3d407 das

[PATCH] bcachefs: fix null-ptr-deref in have_stripes()

2024-10-23 Thread Jeongjun Park
c->btree_roots_known[i].b can be NULL. In this case, a NULL pointer dereference occurs, so you need to add code to check the variable. Reported-by: syzbot+b468b9fef56949c3b...@syzkaller.appspotmail.com Fixes: ("bcachefs: metadata version bucket_stripe_sectors") Signed-off-by: Jeongjun Park --- f

[syzbot] [bcachefs?] UBSAN: shift-out-of-bounds in validate_sb_layout

2024-10-23 Thread syzbot
Hello, syzbot found the following issue on: HEAD commit:c2ee9f594da8 KVM: selftests: Fix build on on non-x86 archi.. git tree: upstream console+strace: https://syzkaller.appspot.com/x/log.txt?x=16acc28798 kernel config: https://syzkaller.appspot.com/x/.config?x=41330fd2db03893d das

[syzbot] [bcachefs?] KASAN: slab-use-after-free Read in bch2_reconstruct_alloc

2024-10-23 Thread syzbot
Hello, syzbot found the following issue on: HEAD commit:15e7d45e786a Add linux-next specific files for 20241016 git tree: linux-next console+strace: https://syzkaller.appspot.com/x/log.txt?x=10cbc0a798 kernel config: https://syzkaller.appspot.com/x/.config?x=c36416f1c54640c0 dashbo

[syzbot] [bcachefs?] kernel BUG in wb_flush_one

2024-10-23 Thread syzbot
Hello, syzbot found the following issue on: HEAD commit:d2b1b3bccef6 KVM: arm64: Shave a few bytes from the EL2 id.. git tree: git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci console output: https://syzkaller.appspot.com/x/log.txt?x=1299d24058 kernel conf

Re: [GIT PULL] bcachefs fixes for 6.12-rc5

2024-10-23 Thread Sasha Levin
On Wed, Oct 23, 2024 at 09:42:59PM +1100, Michael Ellerman wrote: Hi Sasha, This is awesome. Sasha Levin writes: On Tue, Oct 22, 2024 at 01:49:31PM -0700, Darrick J. Wong wrote: On Tue, Oct 22, 2024 at 03:06:38PM -0400, Sasha Levin wrote: other information that would be useful? As a maint

Re: [GIT PULL] bcachefs fixes for 6.12-rc5

2024-10-23 Thread Sasha Levin
On Tue, Oct 22, 2024 at 12:30:38PM -0700, Kees Cook wrote: On Tue, Oct 22, 2024 at 03:06:38PM -0400, Sasha Levin wrote: On Tue, Oct 22, 2024 at 01:39:10PM -0400, Kent Overstreet wrote: > > The following changes since commit 5e3b72324d32629fa013f86657308f3dbc1115e1: > > bcachefs: Fix sysfs warni

[syzbot] [bcachefs?] kernel BUG in bch2_btree_path_level_init (2)

2024-10-23 Thread syzbot
Hello, syzbot found the following issue on: HEAD commit:b04ae0f45168 Merge tag 'v6.12-rc3-smb3-client-fixes' of gi.. git tree: upstream console output: https://syzkaller.appspot.com/x/log.txt?x=15ff7c5f98 kernel config: https://syzkaller.appspot.com/x/.config?x=cfbd94c114a3d407 das

Re: [GIT PULL] bcachefs fixes for 6.12-rc5

2024-10-23 Thread Michael Ellerman
Hi Sasha, This is awesome. Sasha Levin writes: > On Tue, Oct 22, 2024 at 01:49:31PM -0700, Darrick J. Wong wrote: >>On Tue, Oct 22, 2024 at 03:06:38PM -0400, Sasha Levin wrote: >>> other information that would be useful? >> >>As a maintainer I probably would've found this to be annoying, but wit

[PATCH v5] bcachefs: add support for true/false & yes/no in bool-type options

2024-10-23 Thread Integral
Here is the patch which uses existing constant table: Currently, when using bcachefs-tools to set options, bool-type options can only accept 1 or 0. Add support for accepting true/false and yes/no for these options. Signed-off-by: Integral --- fs/bcachefs/opts.c | 18 +++--- fs/fs_p

Re: [PATCH] bcachefs: Fix NULL ptr dereference in btree_node_iter_and_journal_peek

2024-10-23 Thread Piotr Zalewski
Hi Alan, On Wednesday, October 23rd, 2024 at 9:33 AM, Alan Huang wrote: > On Oct 23, 2024, at 15:21, Piotr Zalewski pz010001011...@proton.me wrote: > > > Add NULL check for key returned from bch2_btree_and_journal_iter_peek in > > btree_node_iter_and_journal_peek to avoid NULL ptr dereference

Re: [PATCH] bcachefs: Fix NULL ptr dereference in btree_node_iter_and_journal_peek

2024-10-23 Thread Alan Huang
On Oct 23, 2024, at 15:21, Piotr Zalewski wrote: > > Add NULL check for key returned from bch2_btree_and_journal_iter_peek in > btree_node_iter_and_journal_peek to avoid NULL ptr dereference in > bch2_bkey_buf_reassemble. It would be helpful if the commit message explained why k.k is null in thi

Re: [PATCH v4] libbcachefs: add support for true/false & yes/no in bool-type options

2024-10-23 Thread Alan Huang
On Oct 23, 2024, at 13:15, Integral wrote: > > Here is my latest patch: > > Currently, when using bcachefs-tools to set options, bool-type options > can only accept 1 or 0. Add support for accepting true/false and yes/no > for these options. > > Signed-off-by: Integral > --- > fs/bcachefs/opts

[syzbot] [bcachefs?] KASAN: null-ptr-deref Read in bch2_sb_set_upgrade_extra

2024-10-23 Thread syzbot
Hello, syzbot found the following issue on: HEAD commit:b04ae0f45168 Merge tag 'v6.12-rc3-smb3-client-fixes' of gi.. git tree: upstream console output: https://syzkaller.appspot.com/x/log.txt?x=1468748798 kernel config: https://syzkaller.appspot.com/x/.config?x=cfbd94c114a3d407 das