mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Chuck Lever III <chuck.lever@oracle.com>
To: Amir Goldstein <amir73il@gmail.com>
Cc: syzbot <syzbot+09b349b3066c2e0b1e96@syzkaller.appspotmail.com>,
	Christian Brauner <brauner@kernel.org>,
	Jeff Layton <jlayton@kernel.org>,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linux NFS Mailing List <linux-nfs@vger.kernel.org>,
	"syzkaller-bugs@googlegroups.com"
	<syzkaller-bugs@googlegroups.com>,
	Al Viro <viro@zeniv.linux.org.uk>
Subject: Re: [syzbot] [nfs?] KMSAN: kernel-infoleak in sys_name_to_handle_at (4)
Date: Tue, 16 Jan 2024 15:07:56 +0000	[thread overview]
Message-ID: <B4A8D625-6997-49C8-B105-B2DCFE8C6DDA@oracle.com> (raw)
In-Reply-To: <000000000000e3d83a060ee5285a@google.com>



> On Jan 14, 2024, at 5:14 AM, syzbot <syzbot+09b349b3066c2e0b1e96@syzkaller.appspotmail.com> wrote:
> 
> Hello,
> 
> syzbot found the following issue on:
> 
> HEAD commit:    861deac3b092 Linux 6.7-rc7
> git tree:       upstream
> console+strace: https://syzkaller.appspot.com/x/log.txt?x=155d9131e80000
> kernel config:  https://syzkaller.appspot.com/x/.config?x=e0c7078a6b901aa3
> dashboard link: https://syzkaller.appspot.com/bug?extid=09b349b3066c2e0b1e96
> compiler:       Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
> syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=16cefdc9e80000
> C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=164fe7e9e80000
> 
> Downloadable assets:
> disk image: https://storage.googleapis.com/syzbot-assets/0ea60ee8ed32/disk-861deac3.raw.xz
> vmlinux: https://storage.googleapis.com/syzbot-assets/6d69fdc33021/vmlinux-861deac3.xz
> kernel image: https://storage.googleapis.com/syzbot-assets/f0158750d452/bzImage-861deac3.xz
> mounted in repro: https://storage.googleapis.com/syzbot-assets/bb450f076a10/mount_0.gz
> 
> IMPORTANT: if you fix the issue, please add the following tag to the commit:
> Reported-by: syzbot+09b349b3066c2e0b1e96@syzkaller.appspotmail.com
> 
>         option from the mount to silence this warning.
> =======================================================
> =====================================================
> BUG: KMSAN: kernel-infoleak in instrument_copy_to_user include/linux/instrumented.h:114 [inline]
> BUG: KMSAN: kernel-infoleak in _copy_to_user+0xbc/0x100 lib/usercopy.c:40
> instrument_copy_to_user include/linux/instrumented.h:114 [inline]
> _copy_to_user+0xbc/0x100 lib/usercopy.c:40
> copy_to_user include/linux/uaccess.h:191 [inline]
> do_sys_name_to_handle fs/fhandle.c:73 [inline]
> __do_sys_name_to_handle_at fs/fhandle.c:112 [inline]
> __se_sys_name_to_handle_at+0x949/0xb10 fs/fhandle.c:94
> __x64_sys_name_to_handle_at+0xe4/0x140 fs/fhandle.c:94
> do_syscall_x64 arch/x86/entry/common.c:52 [inline]
> do_syscall_64+0x44/0x110 arch/x86/entry/common.c:83
> entry_SYSCALL_64_after_hwframe+0x63/0x6b
> 
> Uninit was created at:
> slab_post_alloc_hook+0x129/0xa70 mm/slab.h:768
> slab_alloc_node mm/slub.c:3478 [inline]
> __kmem_cache_alloc_node+0x5c9/0x970 mm/slub.c:3517
> __do_kmalloc_node mm/slab_common.c:1006 [inline]
> __kmalloc+0x121/0x3c0 mm/slab_common.c:1020
> kmalloc include/linux/slab.h:604 [inline]
> do_sys_name_to_handle fs/fhandle.c:39 [inline]
> __do_sys_name_to_handle_at fs/fhandle.c:112 [inline]
> __se_sys_name_to_handle_at+0x441/0xb10 fs/fhandle.c:94
> __x64_sys_name_to_handle_at+0xe4/0x140 fs/fhandle.c:94
> do_syscall_x64 arch/x86/entry/common.c:52 [inline]
> do_syscall_64+0x44/0x110 arch/x86/entry/common.c:83
> entry_SYSCALL_64_after_hwframe+0x63/0x6b
> 
> Bytes 18-19 of 20 are uninitialized
> Memory access of size 20 starts at ffff888128a46380
> Data copied to user address 0000000020000240
> 
> CPU: 0 PID: 5006 Comm: syz-executor975 Not tainted 6.7.0-rc7-syzkaller #0
> Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/17/2023
> =====================================================

Hi Amir-

The kmalloc() at fs/fhandle.c:39 could be made a kzalloc().

But I wonder if those uninitialized bytes in the file_handle
buffer are actually a logic bug in do_sys_name_to_handle().


--
Chuck Lever



  reply	other threads:[~2024-01-16 15:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-14 10:14 syzbot
2024-01-16 15:07 ` Chuck Lever III [this message]
2024-01-16 17:21   ` Amir Goldstein
2024-01-18 16:45 ` [syzbot] " syzbot
     [not found] <20240118164534.14880-1-n.zhandarovich@fintech.ru>
2024-01-18 17:12 ` syzbot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=B4A8D625-6997-49C8-B105-B2DCFE8C6DDA@oracle.com \
    --to=chuck.lever@oracle.com \
    --cc=amir73il@gmail.com \
    --cc=brauner@kernel.org \
    --cc=jlayton@kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=syzbot+09b349b3066c2e0b1e96@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.com \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®