linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Christoph Hellwig <hch@lst.de>, Al Viro <viro@zeniv.linux.org.uk>,
	Ian Kent <raven@themaw.net>, David Howells <dhowells@redhat.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>,
	LSM List <linux-security-module@vger.kernel.org>,
	NetFilter <netfilter-devel@vger.kernel.org>
Subject: Re: [PATCH 05/13] fs: check FMODE_WRITE in __kernel_write
Date: Mon, 15 Jun 2020 18:42:18 +0200	[thread overview]
Message-ID: <20200615164218.GB23493@lst.de> (raw)
In-Reply-To: <CAHk-=whfMo7gvco8N5qEjh+jSqezv+bd+N-7txpNokD39t=dhQ@mail.gmail.com>

On Mon, Jun 15, 2020 at 09:39:31AM -0700, Linus Torvalds wrote:
> On Mon, Jun 15, 2020 at 5:13 AM Christoph Hellwig <hch@lst.de> wrote:
> >
> > We still need to check if the fѕ is open write, even for the low-level
> > helper.
> 
> Is there actually a way to trigger something like this? I'm wondering
> if it's worth a WARN_ON_ONCE()?
> 
> It doesn't sound sensible to have some kernel functionality try to
> write to a file it didn't open for write, and sounds like a kernel bug
> if this case were to ever trigger..

Yes, this would be bug in the calling code.

  reply	other threads:[~2020-06-15 16:42 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-15 12:12 clean up kernel_{read,write} & friends v4 Christoph Hellwig
2020-06-15 12:12 ` [PATCH 01/13] cachefiles: switch to kernel_write Christoph Hellwig
2020-06-15 12:12 ` [PATCH 02/13] autofs: " Christoph Hellwig
2020-06-15 12:12 ` [PATCH 03/13] bpfilter: " Christoph Hellwig
2020-06-15 12:12 ` [PATCH 04/13] fs: unexport __kernel_write Christoph Hellwig
2020-06-15 12:12 ` [PATCH 05/13] fs: check FMODE_WRITE in __kernel_write Christoph Hellwig
2020-06-15 12:34   ` Matthew Wilcox
2020-06-15 13:48     ` Christoph Hellwig
2020-06-15 16:39   ` Linus Torvalds
2020-06-15 16:42     ` Christoph Hellwig [this message]
2020-06-17 14:59     ` David Laight
2020-06-15 12:12 ` [PATCH 06/13] fs: implement kernel_write using __kernel_write Christoph Hellwig
2020-06-15 12:12 ` [PATCH 07/13] fs: remove __vfs_write Christoph Hellwig
2020-06-15 12:12 ` [PATCH 08/13] fs: don't change the address limit for ->write_iter in __kernel_write Christoph Hellwig
2020-06-15 12:12 ` [PATCH 09/13] fs: add a __kernel_read helper Christoph Hellwig
2020-06-15 12:12 ` [PATCH 10/13] integrity/ima: switch to using __kernel_read Christoph Hellwig
2020-06-15 16:46   ` Linus Torvalds
2020-06-15 16:56     ` Linus Torvalds
2020-06-15 12:12 ` [PATCH 11/13] fs: implement kernel_read " Christoph Hellwig
2020-06-15 12:12 ` [PATCH 12/13] fs: remove __vfs_read Christoph Hellwig
2020-06-15 12:12 ` [PATCH 13/13] fs: don't change the address limit for ->read_iter in __kernel_read 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=20200615164218.GB23493@lst.de \
    --to=hch@lst.de \
    --cc=dhowells@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=raven@themaw.net \
    --cc=torvalds@linux-foundation.org \
    --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;
as well as URLs for NNTP newsgroup(s).