* [syzbot] [crypto?] KMSAN: uninit-value in adiantum_crypt
@ 2025-12-03 1:57 syzbot
2025-12-13 22:47 ` Forwarded: [PATCH] crypto: adiantum: initialize rbuf.bignum to avoid KMSAN warning syzbot
` (3 more replies)
0 siblings, 4 replies; 8+ messages in thread
From: syzbot @ 2025-12-03 1:57 UTC (permalink / raw)
To: davem, herbert, linux-crypto, linux-kernel, syzkaller-bugs
Hello,
syzbot found the following issue on:
HEAD commit: 6cf62f0174de Merge tag 'char-misc-6.18-rc8' of git://git.k..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=1727df42580000
kernel config: https://syzkaller.appspot.com/x/.config?x=61a9bf3cc5d17a01
dashboard link: https://syzkaller.appspot.com/bug?extid=703d8a2cd20971854b06
compiler: Debian clang version 20.1.8 (++20250708063551+0c9f909b7976-1~exp1~20250708183702.136), Debian LLD 20.1.8
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=13bfa112580000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=169e422c580000
Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/fb216361ff9c/disk-6cf62f01.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/eb55e25eb970/vmlinux-6cf62f01.xz
kernel image: https://storage.googleapis.com/syzbot-assets/5110f00a1a4e/bzImage-6cf62f01.xz
mounted in repro: https://storage.googleapis.com/syzbot-assets/7a62729c5268/mount_0.gz
fsck result: OK (log: https://syzkaller.appspot.com/x/fsck.log?x=16dd8112580000)
IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+703d8a2cd20971854b06@syzkaller.appspotmail.com
=====================================================
BUG: KMSAN: uninit-value in subshift lib/crypto/aes.c:150 [inline]
BUG: KMSAN: uninit-value in aes_encrypt+0x1239/0x1960 lib/crypto/aes.c:283
subshift lib/crypto/aes.c:150 [inline]
aes_encrypt+0x1239/0x1960 lib/crypto/aes.c:283
aesti_encrypt+0x7d/0xf0 crypto/aes_ti.c:31
cipher_crypt_one+0x120/0x2e0 crypto/cipher.c:75
crypto_cipher_encrypt_one+0x33/0x40 crypto/cipher.c:82
adiantum_crypt+0x939/0xe60 crypto/adiantum.c:383
adiantum_encrypt+0x33/0x40 crypto/adiantum.c:419
crypto_skcipher_encrypt+0x18a/0x1e0 crypto/skcipher.c:195
fscrypt_crypt_data_unit+0x38e/0x590 fs/crypto/crypto.c:139
fscrypt_encrypt_pagecache_blocks+0x430/0x900 fs/crypto/crypto.c:197
ext4_bio_write_folio+0x1383/0x30d0 fs/ext4/page-io.c:552
mpage_submit_folio fs/ext4/inode.c:2080 [inline]
mpage_map_and_submit_buffers fs/ext4/inode.c:2324 [inline]
mpage_map_and_submit_extent fs/ext4/inode.c:2514 [inline]
ext4_do_writepages+0x3c08/0x8020 fs/ext4/inode.c:2931
ext4_writepages+0x338/0x870 fs/ext4/inode.c:3025
do_writepages+0x3f2/0x860 mm/page-writeback.c:2604
__writeback_single_inode+0x101/0x1190 fs/fs-writeback.c:1719
writeback_sb_inodes+0xac1/0x1cb0 fs/fs-writeback.c:2015
wb_writeback+0x4ce/0xc00 fs/fs-writeback.c:2195
wb_do_writeback fs/fs-writeback.c:2342 [inline]
wb_workfn+0x397/0x1910 fs/fs-writeback.c:2382
process_one_work kernel/workqueue.c:3263 [inline]
process_scheduled_works+0xb91/0x1d80 kernel/workqueue.c:3346
worker_thread+0xedf/0x1590 kernel/workqueue.c:3427
kthread+0xd5c/0xf00 kernel/kthread.c:463
ret_from_fork+0x1f5/0x4c0 arch/x86/kernel/process.c:158
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245
Uninit was stored to memory at:
le128_add crypto/adiantum.c:191 [inline]
adiantum_crypt+0xcf7/0xe60 crypto/adiantum.c:379
adiantum_encrypt+0x33/0x40 crypto/adiantum.c:419
crypto_skcipher_encrypt+0x18a/0x1e0 crypto/skcipher.c:195
fscrypt_crypt_data_unit+0x38e/0x590 fs/crypto/crypto.c:139
fscrypt_encrypt_pagecache_blocks+0x430/0x900 fs/crypto/crypto.c:197
ext4_bio_write_folio+0x1383/0x30d0 fs/ext4/page-io.c:552
mpage_submit_folio fs/ext4/inode.c:2080 [inline]
mpage_map_and_submit_buffers fs/ext4/inode.c:2324 [inline]
mpage_map_and_submit_extent fs/ext4/inode.c:2514 [inline]
ext4_do_writepages+0x3c08/0x8020 fs/ext4/inode.c:2931
ext4_writepages+0x338/0x870 fs/ext4/inode.c:3025
do_writepages+0x3f2/0x860 mm/page-writeback.c:2604
__writeback_single_inode+0x101/0x1190 fs/fs-writeback.c:1719
writeback_sb_inodes+0xac1/0x1cb0 fs/fs-writeback.c:2015
wb_writeback+0x4ce/0xc00 fs/fs-writeback.c:2195
wb_do_writeback fs/fs-writeback.c:2342 [inline]
wb_workfn+0x397/0x1910 fs/fs-writeback.c:2382
process_one_work kernel/workqueue.c:3263 [inline]
process_scheduled_works+0xb91/0x1d80 kernel/workqueue.c:3346
worker_thread+0xedf/0x1590 kernel/workqueue.c:3427
kthread+0xd5c/0xf00 kernel/kthread.c:463
ret_from_fork+0x1f5/0x4c0 arch/x86/kernel/process.c:158
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245
Uninit was stored to memory at:
adiantum_crypt+0x531/0xe60 crypto/adiantum.c:368
adiantum_encrypt+0x33/0x40 crypto/adiantum.c:419
crypto_skcipher_encrypt+0x18a/0x1e0 crypto/skcipher.c:195
fscrypt_crypt_data_unit+0x38e/0x590 fs/crypto/crypto.c:139
fscrypt_encrypt_pagecache_blocks+0x430/0x900 fs/crypto/crypto.c:197
ext4_bio_write_folio+0x1383/0x30d0 fs/ext4/page-io.c:552
mpage_submit_folio fs/ext4/inode.c:2080 [inline]
mpage_map_and_submit_buffers fs/ext4/inode.c:2324 [inline]
mpage_map_and_submit_extent fs/ext4/inode.c:2514 [inline]
ext4_do_writepages+0x3c08/0x8020 fs/ext4/inode.c:2931
ext4_writepages+0x338/0x870 fs/ext4/inode.c:3025
do_writepages+0x3f2/0x860 mm/page-writeback.c:2604
__writeback_single_inode+0x101/0x1190 fs/fs-writeback.c:1719
writeback_sb_inodes+0xac1/0x1cb0 fs/fs-writeback.c:2015
wb_writeback+0x4ce/0xc00 fs/fs-writeback.c:2195
wb_do_writeback fs/fs-writeback.c:2342 [inline]
wb_workfn+0x397/0x1910 fs/fs-writeback.c:2382
process_one_work kernel/workqueue.c:3263 [inline]
process_scheduled_works+0xb91/0x1d80 kernel/workqueue.c:3346
worker_thread+0xedf/0x1590 kernel/workqueue.c:3427
kthread+0xd5c/0xf00 kernel/kthread.c:463
ret_from_fork+0x1f5/0x4c0 arch/x86/kernel/process.c:158
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245
Uninit was created at:
__alloc_frozen_pages_noprof+0x689/0xf00 mm/page_alloc.c:5201
alloc_pages_mpol+0x328/0x860 mm/mempolicy.c:2416
alloc_frozen_pages_noprof mm/mempolicy.c:2487 [inline]
alloc_pages_noprof mm/mempolicy.c:2507 [inline]
folio_alloc_noprof+0x109/0x360 mm/mempolicy.c:2517
filemap_alloc_folio_noprof+0x9d/0x420 mm/filemap.c:1020
__filemap_get_folio+0xb45/0x1930 mm/filemap.c:2012
write_begin_get_folio include/linux/pagemap.h:784 [inline]
ext4_write_begin+0x6d9/0x2d70 fs/ext4/inode.c:1318
ext4_da_write_begin+0x77c/0x1490 fs/ext4/inode.c:3129
generic_perform_write+0x365/0x1050 mm/filemap.c:4255
ext4_buffered_write_iter+0x61a/0xce0 fs/ext4/file.c:299
ext4_file_write_iter+0x2a2/0x3d90 fs/ext4/file.c:-1
new_sync_write fs/read_write.c:593 [inline]
vfs_write+0xbe2/0x15d0 fs/read_write.c:686
ksys_pwrite64 fs/read_write.c:793 [inline]
__do_sys_pwrite64 fs/read_write.c:801 [inline]
__se_sys_pwrite64 fs/read_write.c:798 [inline]
__x64_sys_pwrite64+0x2ab/0x3b0 fs/read_write.c:798
x64_sys_call+0xe77/0x3e30 arch/x86/include/generated/asm/syscalls_64.h:19
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xd9/0xfa0 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
CPU: 1 UID: 0 PID: 3651 Comm: kworker/u8:15 Not tainted syzkaller #0 PREEMPT(none)
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/25/2025
Workqueue: writeback wb_workfn (flush-7:0)
=====================================================
---
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
* Forwarded: [PATCH] crypto: adiantum: initialize rbuf.bignum to avoid KMSAN warning
2025-12-03 1:57 [syzbot] [crypto?] KMSAN: uninit-value in adiantum_crypt syzbot
@ 2025-12-13 22:47 ` syzbot
2025-12-16 22:52 ` Forwarded: [PATCH] crypto: adiantum: initialize rbuf.bignum to fix KMSAN uninit-value bug syzbot
` (2 subsequent siblings)
3 siblings, 0 replies; 8+ messages in thread
From: syzbot @ 2025-12-13 22:47 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: [PATCH] crypto: adiantum: initialize rbuf.bignum to avoid KMSAN warning
Author: katharasasikumar007@gmail.com
Signed-off-by: Kathara Sasikumar <katharasasikumar007@gmail.com>
#syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
---
crypto/adiantum.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/crypto/adiantum.c b/crypto/adiantum.c
index a6bca877c3c7..edd53c793fda 100644
--- a/crypto/adiantum.c
+++ b/crypto/adiantum.c
@@ -310,6 +310,7 @@ static int adiantum_finish(struct skcipher_request *req)
return err;
}
le128_sub(&rctx->rbuf.bignum, &rctx->rbuf.bignum, &digest);
+ memset(&rctx->rbuf.bignum, 0, sizeof(rctx->rbuf.bignum));
memcpy(virt + bulk_len, &rctx->rbuf.bignum, sizeof(le128));
flush_dcache_page(page);
kunmap_local(virt);
@@ -370,6 +371,7 @@ static int adiantum_crypt(struct skcipher_request *req, bool enc)
} else {
/* Slow path that works for any source scatterlist */
err = adiantum_hash_message(req, src, src_nents, &digest);
+ memset(&rctx->rbuf.bignum, 0, sizeof(rctx->rbuf.bignum));
scatterwalk_map_and_copy(&rctx->rbuf.bignum, src,
bulk_len, sizeof(le128), 0);
}
--
2.51.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [syzbot] [crypto?] KMSAN: uninit-value in adiantum_crypt
[not found] <20251213224229.1116077-2-katharasasikumar007@gmail.com>
@ 2025-12-13 23:35 ` syzbot
0 siblings, 0 replies; 8+ messages in thread
From: syzbot @ 2025-12-13 23:35 UTC (permalink / raw)
To: katharasasikumar007, linux-kernel, syzkaller-bugs
Hello,
syzbot has tested the proposed patch but the reproducer is still triggering an issue:
KMSAN: uninit-value in adiantum_crypt
=====================================================
BUG: KMSAN: uninit-value in subshift lib/crypto/aes.c:150 [inline]
BUG: KMSAN: uninit-value in aes_encrypt+0x1239/0x1960 lib/crypto/aes.c:283
subshift lib/crypto/aes.c:150 [inline]
aes_encrypt+0x1239/0x1960 lib/crypto/aes.c:283
aesti_encrypt+0x7d/0xf0 crypto/aes_ti.c:31
cipher_crypt_one+0x120/0x2e0 crypto/cipher.c:75
crypto_cipher_encrypt_one+0x33/0x40 crypto/cipher.c:82
adiantum_crypt+0x948/0xe70 crypto/adiantum.c:385
adiantum_encrypt+0x33/0x40 crypto/adiantum.c:421
crypto_skcipher_encrypt+0x18a/0x1e0 crypto/skcipher.c:444
fscrypt_crypt_data_unit+0x38e/0x590 fs/crypto/crypto.c:139
fscrypt_encrypt_pagecache_blocks+0x430/0x900 fs/crypto/crypto.c:197
ext4_bio_write_folio+0x1383/0x30d0 fs/ext4/page-io.c:552
mpage_submit_folio+0x399/0x3d0 fs/ext4/inode.c:2087
mpage_map_and_submit_buffers fs/ext4/inode.c:2330 [inline]
mpage_map_and_submit_extent fs/ext4/inode.c:2520 [inline]
ext4_do_writepages+0x3c93/0x77a0 fs/ext4/inode.c:2932
ext4_writepages+0x338/0x870 fs/ext4/inode.c:3026
do_writepages+0x3f2/0x860 mm/page-writeback.c:2598
__writeback_single_inode+0x101/0x1190 fs/fs-writeback.c:1737
writeback_sb_inodes+0xb2d/0x1f10 fs/fs-writeback.c:2030
wb_writeback+0x4ce/0xc00 fs/fs-writeback.c:2216
wb_do_writeback fs/fs-writeback.c:2363 [inline]
wb_workfn+0x397/0x1910 fs/fs-writeback.c:2403
process_one_work kernel/workqueue.c:3257 [inline]
process_scheduled_works+0xb91/0x1d80 kernel/workqueue.c:3340
worker_thread+0xedf/0x1590 kernel/workqueue.c:3421
kthread+0xd5c/0xf00 kernel/kthread.c:463
ret_from_fork+0x208/0x710 arch/x86/kernel/process.c:158
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:246
Uninit was stored to memory at:
le128_add crypto/adiantum.c:191 [inline]
adiantum_crypt+0xd06/0xe70 crypto/adiantum.c:381
adiantum_encrypt+0x33/0x40 crypto/adiantum.c:421
crypto_skcipher_encrypt+0x18a/0x1e0 crypto/skcipher.c:444
fscrypt_crypt_data_unit+0x38e/0x590 fs/crypto/crypto.c:139
fscrypt_encrypt_pagecache_blocks+0x430/0x900 fs/crypto/crypto.c:197
ext4_bio_write_folio+0x1383/0x30d0 fs/ext4/page-io.c:552
mpage_submit_folio+0x399/0x3d0 fs/ext4/inode.c:2087
mpage_map_and_submit_buffers fs/ext4/inode.c:2330 [inline]
mpage_map_and_submit_extent fs/ext4/inode.c:2520 [inline]
ext4_do_writepages+0x3c93/0x77a0 fs/ext4/inode.c:2932
ext4_writepages+0x338/0x870 fs/ext4/inode.c:3026
do_writepages+0x3f2/0x860 mm/page-writeback.c:2598
__writeback_single_inode+0x101/0x1190 fs/fs-writeback.c:1737
writeback_sb_inodes+0xb2d/0x1f10 fs/fs-writeback.c:2030
wb_writeback+0x4ce/0xc00 fs/fs-writeback.c:2216
wb_do_writeback fs/fs-writeback.c:2363 [inline]
wb_workfn+0x397/0x1910 fs/fs-writeback.c:2403
process_one_work kernel/workqueue.c:3257 [inline]
process_scheduled_works+0xb91/0x1d80 kernel/workqueue.c:3340
worker_thread+0xedf/0x1590 kernel/workqueue.c:3421
kthread+0xd5c/0xf00 kernel/kthread.c:463
ret_from_fork+0x208/0x710 arch/x86/kernel/process.c:158
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:246
Uninit was stored to memory at:
adiantum_crypt+0x531/0xe70 crypto/adiantum.c:369
adiantum_encrypt+0x33/0x40 crypto/adiantum.c:421
crypto_skcipher_encrypt+0x18a/0x1e0 crypto/skcipher.c:444
fscrypt_crypt_data_unit+0x38e/0x590 fs/crypto/crypto.c:139
fscrypt_encrypt_pagecache_blocks+0x430/0x900 fs/crypto/crypto.c:197
ext4_bio_write_folio+0x1383/0x30d0 fs/ext4/page-io.c:552
mpage_submit_folio+0x399/0x3d0 fs/ext4/inode.c:2087
mpage_map_and_submit_buffers fs/ext4/inode.c:2330 [inline]
mpage_map_and_submit_extent fs/ext4/inode.c:2520 [inline]
ext4_do_writepages+0x3c93/0x77a0 fs/ext4/inode.c:2932
ext4_writepages+0x338/0x870 fs/ext4/inode.c:3026
do_writepages+0x3f2/0x860 mm/page-writeback.c:2598
__writeback_single_inode+0x101/0x1190 fs/fs-writeback.c:1737
writeback_sb_inodes+0xb2d/0x1f10 fs/fs-writeback.c:2030
wb_writeback+0x4ce/0xc00 fs/fs-writeback.c:2216
wb_do_writeback fs/fs-writeback.c:2363 [inline]
wb_workfn+0x397/0x1910 fs/fs-writeback.c:2403
process_one_work kernel/workqueue.c:3257 [inline]
process_scheduled_works+0xb91/0x1d80 kernel/workqueue.c:3340
worker_thread+0xedf/0x1590 kernel/workqueue.c:3421
kthread+0xd5c/0xf00 kernel/kthread.c:463
ret_from_fork+0x208/0x710 arch/x86/kernel/process.c:158
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:246
Uninit was created at:
__alloc_frozen_pages_noprof+0x421/0xab0 mm/page_alloc.c:5233
alloc_pages_mpol+0x328/0x860 mm/mempolicy.c:2486
alloc_frozen_pages_noprof mm/mempolicy.c:2557 [inline]
alloc_pages_noprof mm/mempolicy.c:2577 [inline]
folio_alloc_noprof+0x109/0x360 mm/mempolicy.c:2587
filemap_alloc_folio_noprof+0xda/0x480 mm/filemap.c:1013
__filemap_get_folio_mpol+0xb4f/0x1960 mm/filemap.c:2006
__filemap_get_folio include/linux/pagemap.h:763 [inline]
write_begin_get_folio include/linux/pagemap.h:789 [inline]
ext4_write_begin+0x6d3/0x2d70 fs/ext4/inode.c:1323
ext4_da_write_begin+0x75e/0x1430 fs/ext4/inode.c:3130
generic_perform_write+0x365/0x1050 mm/filemap.c:4314
ext4_buffered_write_iter+0x61a/0xce0 fs/ext4/file.c:299
ext4_file_write_iter+0x2a2/0x3d90 fs/ext4/file.c:-1
new_sync_write fs/read_write.c:593 [inline]
vfs_write+0xbe2/0x15d0 fs/read_write.c:686
ksys_pwrite64 fs/read_write.c:793 [inline]
__do_sys_pwrite64 fs/read_write.c:801 [inline]
__se_sys_pwrite64 fs/read_write.c:798 [inline]
__x64_sys_pwrite64+0x2ab/0x3b0 fs/read_write.c:798
x64_sys_call+0xbaf/0x3e70 arch/x86/include/generated/asm/syscalls_64.h:19
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xd9/0xf80 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
CPU: 0 UID: 0 PID: 3691 Comm: kworker/u8:20 Not tainted syzkaller #0 PREEMPT(none)
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/25/2025
Workqueue: writeback wb_workfn (flush-7:0)
=====================================================
Tested on:
commit: 4a298a43 Merge tag 'smp-urgent-2025-12-12' of git://gi..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=177909c2580000
kernel config: https://syzkaller.appspot.com/x/.config?x=f7b71d5ee1eca763
dashboard link: https://syzkaller.appspot.com/bug?extid=703d8a2cd20971854b06
compiler: Debian clang version 20.1.8 (++20250708063551+0c9f909b7976-1~exp1~20250708183702.136), Debian LLD 20.1.8
patch: https://syzkaller.appspot.com/x/patch.diff?x=15cb9e1a580000
^ permalink raw reply [flat|nested] 8+ messages in thread
* Forwarded: [PATCH] crypto: adiantum: initialize rbuf.bignum to fix KMSAN uninit-value bug
2025-12-03 1:57 [syzbot] [crypto?] KMSAN: uninit-value in adiantum_crypt syzbot
2025-12-13 22:47 ` Forwarded: [PATCH] crypto: adiantum: initialize rbuf.bignum to avoid KMSAN warning syzbot
@ 2025-12-16 22:52 ` syzbot
2025-12-22 15:57 ` Forwarded: Re: KMSAN: uninit-value in adiantum_crypt syzbot
2026-01-12 19:39 ` [syzbot] [crypto?] " Eric Biggers
3 siblings, 0 replies; 8+ messages in thread
From: syzbot @ 2025-12-16 22:52 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: [PATCH] crypto: adiantum: initialize rbuf.bignum to fix KMSAN uninit-value bug
Author: katharasasikumar007@gmail.com
Signed-off-by: Kathara Sasikumar <katharasasikumar007@gmail.com>
#syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
---
crypto/adiantum.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/crypto/adiantum.c b/crypto/adiantum.c
index a6bca877c3c7..0803451fdbb7 100644
--- a/crypto/adiantum.c
+++ b/crypto/adiantum.c
@@ -350,6 +350,7 @@ static int adiantum_crypt(struct skcipher_request *req, bool enc)
if (req->cryptlen < BLOCKCIPHER_BLOCK_SIZE)
return -EINVAL;
+ memset(&rctx->rbuf.bignum, 0, sizeof(rctx->rbuf.bignum));
rctx->enc = enc;
/*
--
2.51.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [syzbot] [crypto?] KMSAN: uninit-value in adiantum_crypt
[not found] <20251216224902.104945-2-katharasasikumar007@gmail.com>
@ 2025-12-16 23:21 ` syzbot
0 siblings, 0 replies; 8+ messages in thread
From: syzbot @ 2025-12-16 23:21 UTC (permalink / raw)
To: katharasasikumar007, linux-kernel, syzaller-bugs, syzkaller-bugs
Hello,
syzbot has tested the proposed patch but the reproducer is still triggering an issue:
KMSAN: uninit-value in adiantum_crypt
=====================================================
BUG: KMSAN: uninit-value in subshift lib/crypto/aes.c:150 [inline]
BUG: KMSAN: uninit-value in aes_encrypt+0x1239/0x1960 lib/crypto/aes.c:283
subshift lib/crypto/aes.c:150 [inline]
aes_encrypt+0x1239/0x1960 lib/crypto/aes.c:283
aesti_encrypt+0x7d/0xf0 crypto/aes_ti.c:31
cipher_crypt_one+0x120/0x2e0 crypto/cipher.c:75
crypto_cipher_encrypt_one+0x33/0x40 crypto/cipher.c:82
adiantum_crypt+0x95c/0xe90 crypto/adiantum.c:384
adiantum_encrypt+0x33/0x40 crypto/adiantum.c:420
crypto_skcipher_encrypt+0x18a/0x1e0 crypto/skcipher.c:444
fscrypt_crypt_data_unit+0x38e/0x590 fs/crypto/crypto.c:139
fscrypt_encrypt_pagecache_blocks+0x430/0x900 fs/crypto/crypto.c:197
ext4_bio_write_folio+0x1383/0x30d0 fs/ext4/page-io.c:552
mpage_submit_folio+0x399/0x3d0 fs/ext4/inode.c:2087
mpage_map_and_submit_buffers fs/ext4/inode.c:2330 [inline]
mpage_map_and_submit_extent fs/ext4/inode.c:2520 [inline]
ext4_do_writepages+0x3c93/0x77a0 fs/ext4/inode.c:2932
ext4_writepages+0x338/0x870 fs/ext4/inode.c:3026
do_writepages+0x3f2/0x860 mm/page-writeback.c:2598
__writeback_single_inode+0x101/0x1190 fs/fs-writeback.c:1737
writeback_sb_inodes+0xb2d/0x1f10 fs/fs-writeback.c:2030
wb_writeback+0x4ce/0xc00 fs/fs-writeback.c:2216
wb_do_writeback fs/fs-writeback.c:2363 [inline]
wb_workfn+0x397/0x1910 fs/fs-writeback.c:2403
process_one_work kernel/workqueue.c:3257 [inline]
process_scheduled_works+0xb91/0x1d80 kernel/workqueue.c:3340
worker_thread+0xedf/0x1590 kernel/workqueue.c:3421
kthread+0xd5c/0xf00 kernel/kthread.c:463
ret_from_fork+0x208/0x710 arch/x86/kernel/process.c:158
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:246
Uninit was stored to memory at:
le128_add crypto/adiantum.c:191 [inline]
adiantum_crypt+0xd25/0xe90 crypto/adiantum.c:380
adiantum_encrypt+0x33/0x40 crypto/adiantum.c:420
crypto_skcipher_encrypt+0x18a/0x1e0 crypto/skcipher.c:444
fscrypt_crypt_data_unit+0x38e/0x590 fs/crypto/crypto.c:139
fscrypt_encrypt_pagecache_blocks+0x430/0x900 fs/crypto/crypto.c:197
ext4_bio_write_folio+0x1383/0x30d0 fs/ext4/page-io.c:552
mpage_submit_folio+0x399/0x3d0 fs/ext4/inode.c:2087
mpage_map_and_submit_buffers fs/ext4/inode.c:2330 [inline]
mpage_map_and_submit_extent fs/ext4/inode.c:2520 [inline]
ext4_do_writepages+0x3c93/0x77a0 fs/ext4/inode.c:2932
ext4_writepages+0x338/0x870 fs/ext4/inode.c:3026
do_writepages+0x3f2/0x860 mm/page-writeback.c:2598
__writeback_single_inode+0x101/0x1190 fs/fs-writeback.c:1737
writeback_sb_inodes+0xb2d/0x1f10 fs/fs-writeback.c:2030
wb_writeback+0x4ce/0xc00 fs/fs-writeback.c:2216
wb_do_writeback fs/fs-writeback.c:2363 [inline]
wb_workfn+0x397/0x1910 fs/fs-writeback.c:2403
process_one_work kernel/workqueue.c:3257 [inline]
process_scheduled_works+0xb91/0x1d80 kernel/workqueue.c:3340
worker_thread+0xedf/0x1590 kernel/workqueue.c:3421
kthread+0xd5c/0xf00 kernel/kthread.c:463
ret_from_fork+0x208/0x710 arch/x86/kernel/process.c:158
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:246
Uninit was stored to memory at:
adiantum_crypt+0x548/0xe90 crypto/adiantum.c:369
adiantum_encrypt+0x33/0x40 crypto/adiantum.c:420
crypto_skcipher_encrypt+0x18a/0x1e0 crypto/skcipher.c:444
fscrypt_crypt_data_unit+0x38e/0x590 fs/crypto/crypto.c:139
fscrypt_encrypt_pagecache_blocks+0x430/0x900 fs/crypto/crypto.c:197
ext4_bio_write_folio+0x1383/0x30d0 fs/ext4/page-io.c:552
mpage_submit_folio+0x399/0x3d0 fs/ext4/inode.c:2087
mpage_map_and_submit_buffers fs/ext4/inode.c:2330 [inline]
mpage_map_and_submit_extent fs/ext4/inode.c:2520 [inline]
ext4_do_writepages+0x3c93/0x77a0 fs/ext4/inode.c:2932
ext4_writepages+0x338/0x870 fs/ext4/inode.c:3026
do_writepages+0x3f2/0x860 mm/page-writeback.c:2598
__writeback_single_inode+0x101/0x1190 fs/fs-writeback.c:1737
writeback_sb_inodes+0xb2d/0x1f10 fs/fs-writeback.c:2030
wb_writeback+0x4ce/0xc00 fs/fs-writeback.c:2216
wb_do_writeback fs/fs-writeback.c:2363 [inline]
wb_workfn+0x397/0x1910 fs/fs-writeback.c:2403
process_one_work kernel/workqueue.c:3257 [inline]
process_scheduled_works+0xb91/0x1d80 kernel/workqueue.c:3340
worker_thread+0xedf/0x1590 kernel/workqueue.c:3421
kthread+0xd5c/0xf00 kernel/kthread.c:463
ret_from_fork+0x208/0x710 arch/x86/kernel/process.c:158
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:246
Uninit was created at:
__alloc_frozen_pages_noprof+0x421/0xab0 mm/page_alloc.c:5233
alloc_pages_mpol+0x328/0x860 mm/mempolicy.c:2486
alloc_frozen_pages_noprof mm/mempolicy.c:2557 [inline]
alloc_pages_noprof mm/mempolicy.c:2577 [inline]
folio_alloc_noprof+0x109/0x360 mm/mempolicy.c:2587
filemap_alloc_folio_noprof+0xda/0x480 mm/filemap.c:1013
__filemap_get_folio_mpol+0xb4f/0x1960 mm/filemap.c:2006
__filemap_get_folio include/linux/pagemap.h:763 [inline]
write_begin_get_folio include/linux/pagemap.h:789 [inline]
ext4_write_begin+0x6d3/0x2d70 fs/ext4/inode.c:1323
ext4_da_write_begin+0x75e/0x1430 fs/ext4/inode.c:3130
generic_perform_write+0x365/0x1050 mm/filemap.c:4314
ext4_buffered_write_iter+0x61a/0xce0 fs/ext4/file.c:299
ext4_file_write_iter+0x2a2/0x3d90 fs/ext4/file.c:-1
new_sync_write fs/read_write.c:593 [inline]
vfs_write+0xbe2/0x15d0 fs/read_write.c:686
ksys_pwrite64 fs/read_write.c:793 [inline]
__do_sys_pwrite64 fs/read_write.c:801 [inline]
__se_sys_pwrite64 fs/read_write.c:798 [inline]
__x64_sys_pwrite64+0x2ab/0x3b0 fs/read_write.c:798
x64_sys_call+0xbaf/0x3e70 arch/x86/include/generated/asm/syscalls_64.h:19
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xd9/0xf80 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
CPU: 0 UID: 0 PID: 55 Comm: kworker/u8:3 Not tainted syzkaller #0 PREEMPT(none)
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/25/2025
Workqueue: writeback wb_workfn (flush-7:0)
=====================================================
Tested on:
commit: 40fbbd64 Merge tag 'pull-fixes' of git://git.kernel.or..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=1604d9b4580000
kernel config: https://syzkaller.appspot.com/x/.config?x=f7b71d5ee1eca763
dashboard link: https://syzkaller.appspot.com/bug?extid=703d8a2cd20971854b06
compiler: Debian clang version 20.1.8 (++20250708063551+0c9f909b7976-1~exp1~20250708183702.136), Debian LLD 20.1.8
patch: https://syzkaller.appspot.com/x/patch.diff?x=146be77c580000
^ permalink raw reply [flat|nested] 8+ messages in thread
* Forwarded: Re: KMSAN: uninit-value in adiantum_crypt
2025-12-03 1:57 [syzbot] [crypto?] KMSAN: uninit-value in adiantum_crypt syzbot
2025-12-13 22:47 ` Forwarded: [PATCH] crypto: adiantum: initialize rbuf.bignum to avoid KMSAN warning syzbot
2025-12-16 22:52 ` Forwarded: [PATCH] crypto: adiantum: initialize rbuf.bignum to fix KMSAN uninit-value bug syzbot
@ 2025-12-22 15:57 ` syzbot
2026-01-12 19:39 ` [syzbot] [crypto?] " Eric Biggers
3 siblings, 0 replies; 8+ messages in thread
From: syzbot @ 2025-12-22 15:57 UTC (permalink / raw)
To: linux-kernel
For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org.
***
Subject: Re: KMSAN: uninit-value in adiantum_crypt
Author: kubik.bartlomiej@gmail.com
#syz test
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [syzbot] [crypto?] KMSAN: uninit-value in adiantum_crypt
[not found] <CAPqLRf0y3GkQbWnqdD3d9ncr3itTS_39evbHhtrD3E1p-Fyojg@mail.gmail.com>
@ 2025-12-22 17:06 ` syzbot
0 siblings, 0 replies; 8+ messages in thread
From: syzbot @ 2025-12-22 17:06 UTC (permalink / raw)
To: kubik.bartlomiej, linux-kernel, syzkaller-bugs
Hello,
syzbot has tested the proposed patch and the reproducer did not trigger any issue:
Reported-by: syzbot+703d8a2cd20971854b06@syzkaller.appspotmail.com
Tested-by: syzbot+703d8a2cd20971854b06@syzkaller.appspotmail.com
Tested on:
commit: 9448598b Linux 6.19-rc2
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=155dc3c2580000
kernel config: https://syzkaller.appspot.com/x/.config?x=b3903bdf68407a14
dashboard link: https://syzkaller.appspot.com/bug?extid=703d8a2cd20971854b06
compiler: Debian clang version 20.1.8 (++20250708063551+0c9f909b7976-1~exp1~20250708183702.136), Debian LLD 20.1.8
patch: https://syzkaller.appspot.com/x/patch.diff?x=15b5c3c2580000
Note: testing is done by a robot and is best-effort only.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [syzbot] [crypto?] KMSAN: uninit-value in adiantum_crypt
2025-12-03 1:57 [syzbot] [crypto?] KMSAN: uninit-value in adiantum_crypt syzbot
` (2 preceding siblings ...)
2025-12-22 15:57 ` Forwarded: Re: KMSAN: uninit-value in adiantum_crypt syzbot
@ 2026-01-12 19:39 ` Eric Biggers
3 siblings, 0 replies; 8+ messages in thread
From: Eric Biggers @ 2026-01-12 19:39 UTC (permalink / raw)
To: syzbot; +Cc: davem, herbert, linux-crypto, linux-kernel, syzkaller-bugs
On Tue, Dec 02, 2025 at 05:57:26PM -0800, syzbot wrote:
> Hello,
>
> syzbot found the following issue on:
>
> HEAD commit: 6cf62f0174de Merge tag 'char-misc-6.18-rc8' of git://git.k..
> git tree: upstream
> console output: https://syzkaller.appspot.com/x/log.txt?x=1727df42580000
> kernel config: https://syzkaller.appspot.com/x/.config?x=61a9bf3cc5d17a01
> dashboard link: https://syzkaller.appspot.com/bug?extid=703d8a2cd20971854b06
> compiler: Debian clang version 20.1.8 (++20250708063551+0c9f909b7976-1~exp1~20250708183702.136), Debian LLD 20.1.8
> syz repro: https://syzkaller.appspot.com/x/repro.syz?x=13bfa112580000
> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=169e422c580000
>
> Downloadable assets:
> disk image: https://storage.googleapis.com/syzbot-assets/fb216361ff9c/disk-6cf62f01.raw.xz
> vmlinux: https://storage.googleapis.com/syzbot-assets/eb55e25eb970/vmlinux-6cf62f01.xz
> kernel image: https://storage.googleapis.com/syzbot-assets/5110f00a1a4e/bzImage-6cf62f01.xz
> mounted in repro: https://storage.googleapis.com/syzbot-assets/7a62729c5268/mount_0.gz
> fsck result: OK (log: https://syzkaller.appspot.com/x/fsck.log?x=16dd8112580000)
>
> IMPORTANT: if you fix the issue, please add the following tag to the commit:
> Reported-by: syzbot+703d8a2cd20971854b06@syzkaller.appspotmail.com
>
> =====================================================
> BUG: KMSAN: uninit-value in subshift lib/crypto/aes.c:150 [inline]
> BUG: KMSAN: uninit-value in aes_encrypt+0x1239/0x1960 lib/crypto/aes.c:283
> subshift lib/crypto/aes.c:150 [inline]
> aes_encrypt+0x1239/0x1960 lib/crypto/aes.c:283
> aesti_encrypt+0x7d/0xf0 crypto/aes_ti.c:31
> cipher_crypt_one+0x120/0x2e0 crypto/cipher.c:75
> crypto_cipher_encrypt_one+0x33/0x40 crypto/cipher.c:82
> adiantum_crypt+0x939/0xe60 crypto/adiantum.c:383
> adiantum_encrypt+0x33/0x40 crypto/adiantum.c:419
> crypto_skcipher_encrypt+0x18a/0x1e0 crypto/skcipher.c:195
> fscrypt_crypt_data_unit+0x38e/0x590 fs/crypto/crypto.c:139
> fscrypt_encrypt_pagecache_blocks+0x430/0x900 fs/crypto/crypto.c:197
ext4 sometimes encrypts uninitialized memory. Duplicate of already-
reported bug, see https://lore.kernel.org/r/20251210022202.GB4128@sol/
#syz dup: KMSAN: uninit-value in fscrypt_crypt_data_unit
- Eric
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2026-01-12 19:39 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-03 1:57 [syzbot] [crypto?] KMSAN: uninit-value in adiantum_crypt syzbot
2025-12-13 22:47 ` Forwarded: [PATCH] crypto: adiantum: initialize rbuf.bignum to avoid KMSAN warning syzbot
2025-12-16 22:52 ` Forwarded: [PATCH] crypto: adiantum: initialize rbuf.bignum to fix KMSAN uninit-value bug syzbot
2025-12-22 15:57 ` Forwarded: Re: KMSAN: uninit-value in adiantum_crypt syzbot
2026-01-12 19:39 ` [syzbot] [crypto?] " Eric Biggers
[not found] <20251213224229.1116077-2-katharasasikumar007@gmail.com>
2025-12-13 23:35 ` syzbot
[not found] <20251216224902.104945-2-katharasasikumar007@gmail.com>
2025-12-16 23:21 ` syzbot
[not found] <CAPqLRf0y3GkQbWnqdD3d9ncr3itTS_39evbHhtrD3E1p-Fyojg@mail.gmail.com>
2025-12-22 17:06 ` syzbot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox