lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Tue, 29 Sep 2020 12:21:52 +0200
From:   Christoph Hellwig <hch@....de>
To:     Dmitry Vyukov <dvyukov@...gle.com>
Cc:     David Laight <David.Laight@...lab.com>,
        Christoph Hellwig <hch@....de>,
        Eric Biggers <ebiggers@...nel.org>,
        "syzbot+51177e4144d764827c45@...kaller.appspotmail.com" 
        <syzbot+51177e4144d764827c45@...kaller.appspotmail.com>,
        "linux-fsdevel@...r.kernel.org" <linux-fsdevel@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "syzkaller-bugs@...glegroups.com" <syzkaller-bugs@...glegroups.com>,
        "viro@...iv.linux.org.uk" <viro@...iv.linux.org.uk>
Subject: Re: WARNING in __kernel_read (2)

On Tue, Sep 29, 2020 at 10:21:19AM +0200, Dmitry Vyukov wrote:
> On Tue, Sep 29, 2020 at 10:06 AM David Laight <David.Laight@...lab.com> wrote:
> >
> > From: Christoph Hellwig
> > > Sent: 29 September 2020 07:56
> > >
> > > On Mon, Sep 28, 2020 at 11:46:48PM -0700, Eric Biggers wrote:
> > > > > Linus asked for it.  What is the call chain that we hit it with?
> > > >
> > > > Call Trace:
> > > >  kernel_read+0x52/0x70 fs/read_write.c:471
> > > >  kernel_read_file fs/exec.c:989 [inline]
> > > >  kernel_read_file+0x2e5/0x620 fs/exec.c:952
> > > >  kernel_read_file_from_fd+0x56/0xa0 fs/exec.c:1076
> > > >  __do_sys_finit_module+0xe6/0x190 kernel/module.c:4066
> > > >  do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
> > > >  entry_SYSCALL_64_after_hwframe+0x44/0xa9
> > > >
> > > > See the email from syzbot for the full details:
> > > > https://lkml.kernel.org/linux-fsdevel/000000000000da992305b02e9a51@google.com
> > >
> > > Passing a fs without read permissions definitively looks bogus for
> > > the finit_module syscall.  So I think all we need is an extra check
> > > to validate the fd.
> >
> > The sysbot test looked like it didn't even have a regular file.
> > I thought I saw a test for that - but it might be in a different path.
> >
> > You do need to ensure that 'exec' doesn't need read access.
> 
> The test tried to load a module from /dev/input/mouse
> 
> r2 = syz_open_dev$mouse(&(0x7f0000000000)='/dev/input/mouse#\x00',
> 0x101, 0x109887)
> finit_module(r2, 0x0, 0x0)
> 
> because... why not? Everything is a file! :)

Yes, syzbot is fine here.  It is the modules code that needs to better
verify the fd.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ