linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [syzbot] [bcachefs?] KMSAN: uninit-value in __bch2_alloc_v4_to_text
@ 2025-06-17  8:11 syzbot
  2025-06-19  4:31 ` [syzbot] #syz test syzbot
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: syzbot @ 2025-06-17  8:11 UTC (permalink / raw)
  To: kent.overstreet, linux-bcachefs, linux-kernel, syzkaller-bugs

Hello,

syzbot found the following issue on:

HEAD commit:    e04c78d86a96 Linux 6.16-rc2
git tree:       upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=16fdc90c580000
kernel config:  https://syzkaller.appspot.com/x/.config?x=db26f33438d76de9
dashboard link: https://syzkaller.appspot.com/bug?extid=8eb51728519f6659ef7b
compiler:       Debian clang version 20.1.6 (++20250514063057+1e4d39e07757-1~exp1~20250514183223.118), Debian LLD 20.1.6
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=11fdc90c580000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=132995d4580000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/c0f064a5f302/disk-e04c78d8.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/b71205c143e3/vmlinux-e04c78d8.xz
kernel image: https://storage.googleapis.com/syzbot-assets/2abdee22b79e/bzImage-e04c78d8.xz
mounted in repro: https://storage.googleapis.com/syzbot-assets/3838d178b843/mount_2.gz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+8eb51728519f6659ef7b@syzkaller.appspotmail.com

    cached_sectors       0
    stripe               0
    stripe_redundancy    0
    io_time[READ]        1
    io_time[WRITE]       1024
    fragmentation     0
    bp_start          7
  
  incorrectly set at freespace:0:37:0 (free 0, genbits 0 should be 0), fixing
=====================================================
BUG: KMSAN: uninit-value in __bch2_alloc_v4_to_text+0x7a4/0xdf0 fs/bcachefs/alloc_background.c:355
 __bch2_alloc_v4_to_text+0x7a4/0xdf0 fs/bcachefs/alloc_background.c:355
 bch2_alloc_v4_to_text+0x181/0x1f0 fs/bcachefs/alloc_background.c:380
 bch2_val_to_text fs/bcachefs/bkey_methods.c:321 [inline]
 bch2_bkey_val_to_text+0x1e8/0x280 fs/bcachefs/bkey_methods.c:331
 bch2_check_discard_freespace_key+0xe35/0x1a30 fs/bcachefs/alloc_background.c:1436
 try_alloc_bucket fs/bcachefs/alloc_foreground.c:272 [inline]
 bch2_bucket_alloc_freelist fs/bcachefs/alloc_foreground.c:420 [inline]
 bch2_bucket_alloc_trans+0x225d/0x3a40 fs/bcachefs/alloc_foreground.c:544
 bch2_bucket_alloc_set_trans+0xebb/0x1c10 fs/bcachefs/alloc_foreground.c:728
 __open_bucket_add_buckets+0x21f8/0x37b0 fs/bcachefs/alloc_foreground.c:925
 open_bucket_add_buckets+0x347/0x580 fs/bcachefs/alloc_foreground.c:957
 bch2_alloc_sectors_start_trans+0x1de1/0x3560 fs/bcachefs/alloc_foreground.c:-1
 __bch2_btree_node_alloc fs/bcachefs/btree_update_interior.c:320 [inline]
 bch2_btree_reserve_get+0x9fd/0x2120 fs/bcachefs/btree_update_interior.c:534
 bch2_btree_update_start+0x2cf3/0x3620 fs/bcachefs/btree_update_interior.c:1289
 bch2_btree_node_rewrite+0x1cd/0x1b50 fs/bcachefs/btree_update_interior.c:2245
 bch2_btree_node_rewrite_key fs/bcachefs/btree_update_interior.c:2311 [inline]
 async_btree_node_rewrite_work+0x6e8/0x10d0 fs/bcachefs/btree_update_interior.c:2368
 process_one_work kernel/workqueue.c:3238 [inline]
 process_scheduled_works+0xb91/0x1d80 kernel/workqueue.c:3321
 worker_thread+0xedf/0x1590 kernel/workqueue.c:3402
 kthread+0xd5c/0xf00 kernel/kthread.c:464
 ret_from_fork+0x1e0/0x310 arch/x86/kernel/process.c:148
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245

Uninit was created at:
 slab_post_alloc_hook mm/slub.c:4154 [inline]
 slab_alloc_node mm/slub.c:4197 [inline]
 __do_kmalloc_node mm/slub.c:4327 [inline]
 __kmalloc_noprof+0x95f/0x1310 mm/slub.c:4340
 kmalloc_noprof include/linux/slab.h:909 [inline]
 __bkey_cached_alloc fs/bcachefs/btree_key_cache.c:139 [inline]
 bkey_cached_alloc fs/bcachefs/btree_key_cache.c:162 [inline]
 btree_key_cache_create fs/bcachefs/btree_key_cache.c:231 [inline]
 btree_key_cache_fill+0x784/0x4780 fs/bcachefs/btree_key_cache.c:344
 bch2_btree_path_traverse_cached+0x10d7/0x1870 fs/bcachefs/btree_key_cache.c:399
 bch2_btree_path_traverse_one+0x6db/0x4060 fs/bcachefs/btree_iter.c:1179
 bch2_btree_path_traverse fs/bcachefs/btree_iter.h:250 [inline]
 bch2_btree_iter_peek_slot+0xd74/0x3910 fs/bcachefs/btree_iter.c:2781
 __bch2_bkey_get_iter fs/bcachefs/btree_iter.h:632 [inline]
 bch2_bkey_get_iter fs/bcachefs/btree_iter.h:646 [inline]
 bch2_check_discard_freespace_key+0x321/0x1a30 fs/bcachefs/alloc_background.c:1414
 try_alloc_bucket fs/bcachefs/alloc_foreground.c:272 [inline]
 bch2_bucket_alloc_freelist fs/bcachefs/alloc_foreground.c:420 [inline]
 bch2_bucket_alloc_trans+0x225d/0x3a40 fs/bcachefs/alloc_foreground.c:544
 bch2_bucket_alloc_set_trans+0xebb/0x1c10 fs/bcachefs/alloc_foreground.c:728
 __open_bucket_add_buckets+0x21f8/0x37b0 fs/bcachefs/alloc_foreground.c:925
 open_bucket_add_buckets+0x347/0x580 fs/bcachefs/alloc_foreground.c:957
 bch2_alloc_sectors_start_trans+0x1de1/0x3560 fs/bcachefs/alloc_foreground.c:-1
 __bch2_btree_node_alloc fs/bcachefs/btree_update_interior.c:320 [inline]
 bch2_btree_reserve_get+0x9fd/0x2120 fs/bcachefs/btree_update_interior.c:534
 bch2_btree_update_start+0x2cf3/0x3620 fs/bcachefs/btree_update_interior.c:1289
 bch2_btree_node_rewrite+0x1cd/0x1b50 fs/bcachefs/btree_update_interior.c:2245
 bch2_btree_node_rewrite_key fs/bcachefs/btree_update_interior.c:2311 [inline]
 async_btree_node_rewrite_work+0x6e8/0x10d0 fs/bcachefs/btree_update_interior.c:2368
 process_one_work kernel/workqueue.c:3238 [inline]
 process_scheduled_works+0xb91/0x1d80 kernel/workqueue.c:3321
 worker_thread+0xedf/0x1590 kernel/workqueue.c:3402
 kthread+0xd5c/0xf00 kernel/kthread.c:464
 ret_from_fork+0x1e0/0x310 arch/x86/kernel/process.c:148
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245

CPU: 1 UID: 0 PID: 4181 Comm: kworker/u8:21 Not tainted 6.16.0-rc2-syzkaller #0 PREEMPT(undef) 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025
Workqueue: btree_node_rewrite async_btree_node_rewrite_work
=====================================================


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzkaller@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [syzbot] #syz test
  2025-06-17  8:11 [syzbot] [bcachefs?] KMSAN: uninit-value in __bch2_alloc_v4_to_text syzbot
@ 2025-06-19  4:31 ` syzbot
  2025-06-19  7:23 ` syzbot
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 8+ messages in thread
From: syzbot @ 2025-06-19  4:31 UTC (permalink / raw)
  To: linux-kernel, syzkaller-bugs

For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com.

***

Subject: #syz test
Author: abhinav.ogl@gmail.com



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [syzbot] [bcachefs?] KMSAN: uninit-value in __bch2_alloc_v4_to_text
       [not found] <CAGR7w80uuhA7ur91DoV32Ymr-eYpPWNvx9BCMCa_2HuvMTLurg@mail.gmail.com>
@ 2025-06-19  6:02 ` syzbot
  0 siblings, 0 replies; 8+ messages in thread
From: syzbot @ 2025-06-19  6:02 UTC (permalink / raw)
  To: abhinav.ogl, linux-kernel, syzkaller-bugs

Hello,

syzbot tried to test the proposed patch but the build/boot failed:

fs/bcachefs/btree_key_cache.c:141:13: error: incompatible integer to pointer conversion returning 'int' from a function with result type 'struct bkey_cached *' [-Wint-conversion]


Tested on:

commit:         fb4d33ab Merge tag '6.16-rc2-ksmbd-server-fixes' of gi..
git tree:       upstream
kernel config:  https://syzkaller.appspot.com/x/.config?x=db26f33438d76de9
dashboard link: https://syzkaller.appspot.com/bug?extid=8eb51728519f6659ef7b
compiler:       Debian clang version 20.1.6 (++20250514063057+1e4d39e07757-1~exp1~20250514183223.118), Debian LLD 20.1.6
patch:          https://syzkaller.appspot.com/x/patch.diff?x=12866370580000


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [syzbot] #syz test
  2025-06-17  8:11 [syzbot] [bcachefs?] KMSAN: uninit-value in __bch2_alloc_v4_to_text syzbot
  2025-06-19  4:31 ` [syzbot] #syz test syzbot
@ 2025-06-19  7:23 ` syzbot
  2025-06-19 11:46 ` syzbot
  2025-07-19 18:35 ` [syzbot] [bcachefs?] KMSAN: uninit-value in __bch2_alloc_v4_to_text Kent Overstreet
  3 siblings, 0 replies; 8+ messages in thread
From: syzbot @ 2025-06-19  7:23 UTC (permalink / raw)
  To: linux-kernel, syzkaller-bugs

For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com.

***

Subject: #syz test
Author: abhinav.ogl@gmail.com



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [syzbot] [bcachefs?] KMSAN: uninit-value in __bch2_alloc_v4_to_text
       [not found] <CAGR7w81YL6PYSYDtHWjbrxLTSEtvYNx9nc74AJ9nU0Nu24dOrg@mail.gmail.com>
@ 2025-06-19  7:39 ` syzbot
  0 siblings, 0 replies; 8+ messages in thread
From: syzbot @ 2025-06-19  7:39 UTC (permalink / raw)
  To: abhinav.ogl, linux-kernel, syzkaller-bugs

Hello,

syzbot tried to test the proposed patch but the build/boot failed:

fs/bcachefs/btree_key_cache.c:141:13: error: invalid argument type 'void *' to unary expression


Tested on:

commit:         fb4d33ab Merge tag '6.16-rc2-ksmbd-server-fixes' of gi..
git tree:       upstream
kernel config:  https://syzkaller.appspot.com/x/.config?x=db26f33438d76de9
dashboard link: https://syzkaller.appspot.com/bug?extid=8eb51728519f6659ef7b
compiler:       Debian clang version 20.1.6 (++20250514063057+1e4d39e07757-1~exp1~20250514183223.118), Debian LLD 20.1.6
patch:          https://syzkaller.appspot.com/x/patch.diff?x=17f7e370580000


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [syzbot] #syz test
  2025-06-17  8:11 [syzbot] [bcachefs?] KMSAN: uninit-value in __bch2_alloc_v4_to_text syzbot
  2025-06-19  4:31 ` [syzbot] #syz test syzbot
  2025-06-19  7:23 ` syzbot
@ 2025-06-19 11:46 ` syzbot
  2025-07-19 18:35 ` [syzbot] [bcachefs?] KMSAN: uninit-value in __bch2_alloc_v4_to_text Kent Overstreet
  3 siblings, 0 replies; 8+ messages in thread
From: syzbot @ 2025-06-19 11:46 UTC (permalink / raw)
  To: linux-kernel, syzkaller-bugs

For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com.

***

Subject: #syz test
Author: abhinav.ogl@gmail.com



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [syzbot] [bcachefs?] KMSAN: uninit-value in __bch2_alloc_v4_to_text
       [not found] <CAGR7w83zZMTvdNiL_iPVP-qF0epKDi3QAyKWgQqOgg1gHwEY5Q@mail.gmail.com>
@ 2025-06-19 12:21 ` syzbot
  0 siblings, 0 replies; 8+ messages in thread
From: syzbot @ 2025-06-19 12:21 UTC (permalink / raw)
  To: abhinav.ogl, linux-kernel, syzkaller-bugs

Hello,

syzbot tried to test the proposed patch but the build/boot failed:

failed to checkout kernel repo git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/master: failed to run ["git" "fetch" "--force" "f569e972c8e9057ee9c286220c83a480ebf30cc5" "master"]: exit status 128
fatal: unable to connect to git.kernel.org:
git.kernel.org[0: 172.105.4.254]: errno=Connection refused
git.kernel.org[1: 2600:3c04:e001:324:0:1991:8:25]: errno=Network is unreachable




Tested on:

commit:         [unknown 
git tree:       upstream
kernel config:  https://syzkaller.appspot.com/x/.config?x=db26f33438d76de9
dashboard link: https://syzkaller.appspot.com/bug?extid=8eb51728519f6659ef7b
compiler:       
patch:          https://syzkaller.appspot.com/x/patch.diff?x=15a8ed0c580000


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [syzbot] [bcachefs?] KMSAN: uninit-value in __bch2_alloc_v4_to_text
  2025-06-17  8:11 [syzbot] [bcachefs?] KMSAN: uninit-value in __bch2_alloc_v4_to_text syzbot
                   ` (2 preceding siblings ...)
  2025-06-19 11:46 ` syzbot
@ 2025-07-19 18:35 ` Kent Overstreet
  3 siblings, 0 replies; 8+ messages in thread
From: Kent Overstreet @ 2025-07-19 18:35 UTC (permalink / raw)
  To: syzbot; +Cc: linux-bcachefs, linux-kernel, syzkaller-bugs

#syz fix: bcachefs: Fix refs to undefined fields in __bch2_alloc_v4_to_text()

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2025-07-19 18:35 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-17  8:11 [syzbot] [bcachefs?] KMSAN: uninit-value in __bch2_alloc_v4_to_text syzbot
2025-06-19  4:31 ` [syzbot] #syz test syzbot
2025-06-19  7:23 ` syzbot
2025-06-19 11:46 ` syzbot
2025-07-19 18:35 ` [syzbot] [bcachefs?] KMSAN: uninit-value in __bch2_alloc_v4_to_text Kent Overstreet
     [not found] <CAGR7w80uuhA7ur91DoV32Ymr-eYpPWNvx9BCMCa_2HuvMTLurg@mail.gmail.com>
2025-06-19  6:02 ` syzbot
     [not found] <CAGR7w81YL6PYSYDtHWjbrxLTSEtvYNx9nc74AJ9nU0Nu24dOrg@mail.gmail.com>
2025-06-19  7:39 ` syzbot
     [not found] <CAGR7w83zZMTvdNiL_iPVP-qF0epKDi3QAyKWgQqOgg1gHwEY5Q@mail.gmail.com>
2025-06-19 12:21 ` syzbot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).