From: Eric Biggers <ebiggers@kernel.org>
To: Christoph Hellwig <hch@lst.de>
Cc: David Laight <David.Laight@aculab.com>,
syzbot+51177e4144d764827c45@syzkaller.appspotmail.com,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
syzkaller-bugs@googlegroups.com, viro@zeniv.linux.org.uk
Subject: Re: WARNING in __kernel_read (2)
Date: Mon, 28 Sep 2020 23:46:48 -0700 [thread overview]
Message-ID: <20200929064648.GA238449@sol.localdomain> (raw)
In-Reply-To: <20200929063815.GB1839@lst.de>
On Tue, Sep 29, 2020 at 08:38:15AM +0200, Christoph Hellwig wrote:
> On Mon, Sep 28, 2020 at 03:14:41PM -0700, Eric Biggers wrote:
> > On Sat, Sep 26, 2020 at 01:17:04PM +0000, David Laight wrote:
> > > From: David Laight
> > > > Sent: 26 September 2020 12:16
> > > > To: 'syzbot' <syzbot+51177e4144d764827c45@syzkaller.appspotmail.com>; linux-fsdevel@vger.kernel.org;
> > > > linux-kernel@vger.kernel.org; syzkaller-bugs@googlegroups.com; viro@zeniv.linux.org.uk
> > > > Subject: RE: WARNING in __kernel_read (2)
> > > >
> > > > > From: syzbot <syzbot+51177e4144d764827c45@syzkaller.appspotmail.com>
> > > > > Sent: 26 September 2020 03:58
> > > > > To: linux-fsdevel@vger.kernel.org; linux-kernel@vger.kernel.org; syzkaller-bugs@googlegroups.com;
> > > > > viro@zeniv.linux.org.uk
> > > > > Subject: WARNING in __kernel_read (2)
> > > >
> > > > I suspect this is calling finit_module() on an fd
> > > > that doesn't have read permissions.
> > >
> > > Code inspection also seems to imply that the check means
> > > the exec() also requires read permissions on the file.
> > >
> > > This isn't traditionally true.
> > > suid #! scripts are particularly odd without 'owner read'
> > > (everyone except the owner can run them!).
> >
> > Christoph, any thoughts here? You added this WARN_ON_ONCE in:
> >
> > commit 61a707c543e2afe3aa7e88f87267c5dafa4b5afa
> > Author: Christoph Hellwig <hch@lst.de>
> > Date: Fri May 8 08:54:16 2020 +0200
> >
> > fs: add a __kernel_read helper
>
> 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
next prev parent reply other threads:[~2020-09-29 6:46 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-26 2:58 WARNING in __kernel_read (2) syzbot
2020-09-26 11:15 ` David Laight
2020-09-26 13:17 ` David Laight
2020-09-28 22:14 ` Eric Biggers
2020-09-29 6:38 ` Christoph Hellwig
2020-09-29 6:46 ` Eric Biggers [this message]
2020-09-29 6:56 ` Christoph Hellwig
2020-09-29 8:06 ` David Laight
2020-09-29 8:21 ` Dmitry Vyukov
2020-09-29 10:21 ` Christoph Hellwig
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=20200929064648.GA238449@sol.localdomain \
--to=ebiggers@kernel.org \
--cc=David.Laight@aculab.com \
--cc=hch@lst.de \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=syzbot+51177e4144d764827c45@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