[syzbot] [io-uring?] memory leak in iovec_from_user (3)

2 views
Skip to first unread message

syzbot

unread,
1:23 PM (8 hours ago) 1:23 PM
to ax...@kernel.dk, io-u...@vger.kernel.org, linux-...@vger.kernel.org, syzkall...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 7143203341dc Merge tag 'libcrypto-for-linus' of git://git...
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=177fd9fc580000
kernel config: https://syzkaller.appspot.com/x/.config?x=87bc41cae23d2144
dashboard link: https://syzkaller.appspot.com/bug?extid=abecd272a5e56fcef099
compiler: gcc (Debian 12.2.0-14+deb12u1) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=12f4399a580000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=11ab3c3a580000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/1efe18c6d01c/disk-71432033.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/a5a0b8a88b2b/vmlinux-71432033.xz
kernel image: https://storage.googleapis.com/syzbot-assets/5bd4c64b0a42/bzImage-71432033.xz

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

BUG: memory leak
unreferenced object 0xffff88811213f000 (size 4096):
comm "syz.0.17", pid 6076, jiffies 4294944113
hex dump (first 32 bytes):
40 02 00 00 00 20 00 00 03 00 00 00 00 00 00 00 @.... ..........
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
backtrace (crc 5845df99):
kmemleak_alloc_recursive include/linux/kmemleak.h:44 [inline]
slab_post_alloc_hook mm/slub.c:4958 [inline]
slab_alloc_node mm/slub.c:5263 [inline]
__do_kmalloc_node mm/slub.c:5656 [inline]
__kmalloc_noprof+0x3e0/0x660 mm/slub.c:5669
kmalloc_noprof include/linux/slab.h:961 [inline]
kmalloc_array_noprof include/linux/slab.h:1003 [inline]
iovec_from_user lib/iov_iter.c:1321 [inline]
iovec_from_user+0x108/0x140 lib/iov_iter.c:1304
__import_iovec+0x71/0x350 lib/iov_iter.c:1375
io_import_vec io_uring/rw.c:99 [inline]
__io_import_rw_buffer+0x1e2/0x260 io_uring/rw.c:120
io_import_rw_buffer io_uring/rw.c:139 [inline]
io_rw_do_import io_uring/rw.c:313 [inline]
io_prep_rw+0xb5/0x120 io_uring/rw.c:325
io_prep_rwv io_uring/rw.c:343 [inline]
io_prep_writev+0x23/0x80 io_uring/rw.c:363
io_init_req io_uring/io_uring.c:2235 [inline]
io_submit_sqe io_uring/io_uring.c:2282 [inline]
io_submit_sqes+0x40d/0xf40 io_uring/io_uring.c:2435
__do_sys_io_uring_enter+0x841/0xcf0 io_uring/io_uring.c:3285
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xa4/0xf80 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f

BUG: memory leak
unreferenced object 0xffff888112158000 (size 4096):
comm "syz.0.17", pid 6076, jiffies 4294944113
hex dump (first 32 bytes):
40 02 00 00 00 20 00 00 03 00 00 00 00 00 00 00 @.... ..........
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
backtrace (crc 5845df99):
kmemleak_alloc_recursive include/linux/kmemleak.h:44 [inline]
slab_post_alloc_hook mm/slub.c:4958 [inline]
slab_alloc_node mm/slub.c:5263 [inline]
__do_kmalloc_node mm/slub.c:5656 [inline]
__kmalloc_noprof+0x3e0/0x660 mm/slub.c:5669
kmalloc_noprof include/linux/slab.h:961 [inline]
kmalloc_array_noprof include/linux/slab.h:1003 [inline]
iovec_from_user lib/iov_iter.c:1321 [inline]
iovec_from_user+0x108/0x140 lib/iov_iter.c:1304
__import_iovec+0x71/0x350 lib/iov_iter.c:1375
io_import_vec io_uring/rw.c:99 [inline]
__io_import_rw_buffer+0x1e2/0x260 io_uring/rw.c:120
io_import_rw_buffer io_uring/rw.c:139 [inline]
io_rw_do_import io_uring/rw.c:313 [inline]
io_prep_rw+0xb5/0x120 io_uring/rw.c:325
io_prep_rwv io_uring/rw.c:343 [inline]
io_prep_writev+0x23/0x80 io_uring/rw.c:363
io_init_req io_uring/io_uring.c:2235 [inline]
io_submit_sqe io_uring/io_uring.c:2282 [inline]
io_submit_sqes+0x40d/0xf40 io_uring/io_uring.c:2435
__do_sys_io_uring_enter+0x841/0xcf0 io_uring/io_uring.c:3285
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xa4/0xf80 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f

BUG: memory leak
unreferenced object 0xffff888112159000 (size 4096):
comm "syz.0.17", pid 6076, jiffies 4294944113
hex dump (first 32 bytes):
40 02 00 00 00 20 00 00 03 00 00 00 00 00 00 00 @.... ..........
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
backtrace (crc 5845df99):
kmemleak_alloc_recursive include/linux/kmemleak.h:44 [inline]
slab_post_alloc_hook mm/slub.c:4958 [inline]
slab_alloc_node mm/slub.c:5263 [inline]
__do_kmalloc_node mm/slub.c:5656 [inline]
__kmalloc_noprof+0x3e0/0x660 mm/slub.c:5669
kmalloc_noprof include/linux/slab.h:961 [inline]
kmalloc_array_noprof include/linux/slab.h:1003 [inline]
iovec_from_user lib/iov_iter.c:1321 [inline]
iovec_from_user+0x108/0x140 lib/iov_iter.c:1304
__import_iovec+0x71/0x350 lib/iov_iter.c:1375
io_import_vec io_uring/rw.c:99 [inline]
__io_import_rw_buffer+0x1e2/0x260 io_uring/rw.c:120
io_import_rw_buffer io_uring/rw.c:139 [inline]
io_rw_do_import io_uring/rw.c:313 [inline]
io_prep_rw+0xb5/0x120 io_uring/rw.c:325
io_prep_rwv io_uring/rw.c:343 [inline]
io_prep_writev+0x23/0x80 io_uring/rw.c:363
io_init_req io_uring/io_uring.c:2235 [inline]
io_submit_sqe io_uring/io_uring.c:2282 [inline]
io_submit_sqes+0x40d/0xf40 io_uring/io_uring.c:2435
__do_sys_io_uring_enter+0x841/0xcf0 io_uring/io_uring.c:3285
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xa4/0xf80 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f

BUG: memory leak
unreferenced object 0xffff88811215a000 (size 4096):
comm "syz.0.17", pid 6076, jiffies 4294944113
hex dump (first 32 bytes):
40 02 00 00 00 20 00 00 03 00 00 00 00 00 00 00 @.... ..........
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
backtrace (crc 5845df99):
kmemleak_alloc_recursive include/linux/kmemleak.h:44 [inline]
slab_post_alloc_hook mm/slub.c:4958 [inline]
slab_alloc_node mm/slub.c:5263 [inline]
__do_kmalloc_node mm/slub.c:5656 [inline]
__kmalloc_noprof+0x3e0/0x660 mm/slub.c:5669
kmalloc_noprof include/linux/slab.h:961 [inline]
kmalloc_array_noprof include/linux/slab.h:1003 [inline]
iovec_from_user lib/iov_iter.c:1321 [inline]
iovec_from_user+0x108/0x140 lib/iov_iter.c:1304
__import_iovec+0x71/0x350 lib/iov_iter.c:1375
io_import_vec io_uring/rw.c:99 [inline]
__io_import_rw_buffer+0x1e2/0x260 io_uring/rw.c:120
io_import_rw_buffer io_uring/rw.c:139 [inline]
io_rw_do_import io_uring/rw.c:313 [inline]
io_prep_rw+0xb5/0x120 io_uring/rw.c:325
io_prep_rwv io_uring/rw.c:343 [inline]
io_prep_writev+0x23/0x80 io_uring/rw.c:363
io_init_req io_uring/io_uring.c:2235 [inline]
io_submit_sqe io_uring/io_uring.c:2282 [inline]
io_submit_sqes+0x40d/0xf40 io_uring/io_uring.c:2435
__do_sys_io_uring_enter+0x841/0xcf0 io_uring/io_uring.c:3285
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xa4/0xf80 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f

BUG: memory leak
unreferenced object 0xffff88811215b000 (size 4096):
comm "syz.0.17", pid 6076, jiffies 4294944113
hex dump (first 32 bytes):
40 02 00 00 00 20 00 00 03 00 00 00 00 00 00 00 @.... ..........
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
backtrace (crc 5845df99):
kmemleak_alloc_recursive include/linux/kmemleak.h:44 [inline]
slab_post_alloc_hook mm/slub.c:4958 [inline]
slab_alloc_node mm/slub.c:5263 [inline]
__do_kmalloc_node mm/slub.c:5656 [inline]
__kmalloc_noprof+0x3e0/0x660 mm/slub.c:5669
kmalloc_noprof include/linux/slab.h:961 [inline]
kmalloc_array_noprof include/linux/slab.h:1003 [inline]
iovec_from_user lib/iov_iter.c:1321 [inline]
iovec_from_user+0x108/0x140 lib/iov_iter.c:1304
__import_iovec+0x71/0x350 lib/iov_iter.c:1375
io_import_vec io_uring/rw.c:99 [inline]
__io_import_rw_buffer+0x1e2/0x260 io_uring/rw.c:120
io_import_rw_buffer io_uring/rw.c:139 [inline]
io_rw_do_import io_uring/rw.c:313 [inline]
io_prep_rw+0xb5/0x120 io_uring/rw.c:325
io_prep_rwv io_uring/rw.c:343 [inline]
io_prep_writev+0x23/0x80 io_uring/rw.c:363
io_init_req io_uring/io_uring.c:2235 [inline]
io_submit_sqe io_uring/io_uring.c:2282 [inline]
io_submit_sqes+0x40d/0xf40 io_uring/io_uring.c:2435
__do_sys_io_uring_enter+0x841/0xcf0 io_uring/io_uring.c:3285
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xa4/0xf80 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f

BUG: memory leak
unreferenced object 0xffff88811215c000 (size 4096):
comm "syz.0.17", pid 6076, jiffies 4294944113
hex dump (first 32 bytes):
40 02 00 00 00 20 00 00 03 00 00 00 00 00 00 00 @.... ..........
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
backtrace (crc 5845df99):
kmemleak_alloc_recursive include/linux/kmemleak.h:44 [inline]
slab_post_alloc_hook mm/slub.c:4958 [inline]
slab_alloc_node mm/slub.c:5263 [inline]
__do_kmalloc_node mm/slub.c:5656 [inline]
__kmalloc_noprof+0x3e0/0x660 mm/slub.c:5669
kmalloc_noprof include/linux/slab.h:961 [inline]
kmalloc_array_noprof include/linux/slab.h:1003 [inline]
iovec_from_user lib/iov_iter.c:1321 [inline]
iovec_from_user+0x108/0x140 lib/iov_iter.c:1304
__import_iovec+0x71/0x350 lib/iov_iter.c:1375
io_import_vec io_uring/rw.c:99 [inline]
__io_import_rw_buffer+0x1e2/0x260 io_uring/rw.c:120
io_import_rw_buffer io_uring/rw.c:139 [inline]
io_rw_do_import io_uring/rw.c:313 [inline]
io_prep_rw+0xb5/0x120 io_uring/rw.c:325
io_prep_rwv io_uring/rw.c:343 [inline]
io_prep_writev+0x23/0x80 io_uring/rw.c:363
io_init_req io_uring/io_uring.c:2235 [inline]
io_submit_sqe io_uring/io_uring.c:2282 [inline]
io_submit_sqes+0x40d/0xf40 io_uring/io_uring.c:2435
__do_sys_io_uring_enter+0x841/0xcf0 io_uring/io_uring.c:3285
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xa4/0xf80 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f

connection error: failed to recv *flatrpc.ExecutorMessageRawT: EOF


---
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 syzk...@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

Jens Axboe

unread,
2:36 PM (7 hours ago) 2:36 PM
to syzbot, io-u...@vger.kernel.org, linux-...@vger.kernel.org, syzkall...@googlegroups.com
On 1/12/26 11:23 AM, syzbot wrote:
> Hello,
>
> syzbot found the following issue on:
>
> HEAD commit: 7143203341dc Merge tag 'libcrypto-for-linus' of git://git...
> git tree: upstream
> console output: https://syzkaller.appspot.com/x/log.txt?x=177fd9fc580000
> kernel config: https://syzkaller.appspot.com/x/.config?x=87bc41cae23d2144
> dashboard link: https://syzkaller.appspot.com/bug?extid=abecd272a5e56fcef099
> compiler: gcc (Debian 12.2.0-14+deb12u1) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40
> syz repro: https://syzkaller.appspot.com/x/repro.syz?x=12f4399a580000
> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=11ab3c3a580000
>
> Downloadable assets:
> disk image: https://storage.googleapis.com/syzbot-assets/1efe18c6d01c/disk-71432033.raw.xz
> vmlinux: https://storage.googleapis.com/syzbot-assets/a5a0b8a88b2b/vmlinux-71432033.xz
> kernel image: https://storage.googleapis.com/syzbot-assets/5bd4c64b0a42/bzImage-71432033.xz
>
> IMPORTANT: if you fix the issue, please add the following tag to the commit:
> Reported-by: syzbot+abecd2...@syzkaller.appspotmail.com

I can't reproduce this, and I have a sneaking suspicion that this is mostly
just timing on kmemleak scanning. I've seen that a few times. Just running
your reproducer and I see:

root@debian:~# cat /sys/kernel/debug/kmemleak
unreferenced object 0xff110000964a6200 (size 200):
comm "kworker/u32:7", pid 1149, jiffies 4294971353
hex dump (first 32 bytes):
00 00 00 00 00 00 00 00 c0 92 73 00 01 00 11 ff ..........s.....
01 30 90 00 00 05 04 40 00 00 00 00 01 00 00 00 .0.....@........
backtrace (crc 38936ccb):
kmem_cache_alloc_noprof+0x3fe/0x580
mempool_alloc_noprof+0xb9/0x190
bio_alloc_bioset+0x561/0x760
submit_bh_wbc+0x130/0x250
__block_write_full_folio+0x3ad/0x720
block_write_full_folio+0x14c/0x180
blkdev_writepages+0x6c/0xd0
do_writepages+0xe9/0x1f0
__writeback_single_inode+0x5e/0x600
writeback_sb_inodes+0x2ea/0x850
__writeback_inodes_wb+0x5c/0x150
wb_writeback+0x382/0x4d0
wb_workfn+0x4d2/0x640
process_one_work+0x260/0x580
worker_thread+0x2b3/0x4e0
kthread+0x161/0x310

which are obviously temporal, and a whole bunch of the same reports, in
fact there is:

root@debian:~# cat /sys/kernel/debug/kmemleak | wc -l
264

lines in there. Then let's trigger a new scan:

root@debian:~# echo scan > /sys/kernel/debug/kmemleak
root@debian:~# cat /sys/kernel/debug/kmemleak | wc -l
0

and they are all gone.

#syz invalid

--
Jens Axboe
Reply all
Reply to author
Forward
0 new messages