All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Matthew Wilcox <willy@infradead.org>
Cc: Christoph Hellwig <hch@lst.de>,
	linux-fsdevel@vger.kernel.org, linux-xfs@vger.kernel.org,
	Goldwyn Rodrigues <rgoldwyn@suse.de>,
	Matthew Bobrowski <mbobrowski@mbobrowski.org>
Subject: Re: [PATCH 2/2] iomap: move the iomap_dio_rw ->end_io callback into a structure
Date: Wed, 4 Sep 2019 14:51:10 +0200	[thread overview]
Message-ID: <20190904125110.GB17285@lst.de> (raw)
In-Reply-To: <20190903161446.GH29434@bombadil.infradead.org>

On Tue, Sep 03, 2019 at 09:14:46AM -0700, Matthew Wilcox wrote:
> On Tue, Sep 03, 2019 at 03:03:27PM +0200, Christoph Hellwig wrote:
> > Add a new iomap_dio_ops structure that for now just contains the end_io
> > handler.  This avoid storing the function pointer in a mutable structure,
> > which is a possible exploit vector for kernel code execution, and prepares
> > for adding a submit_io handler that btrfs needs.
> 
> Is it really a security win?  If I can overwrite dio->end_io, I can as
> well overwrite dio->dops.

Which you'd then need to point to another place where you can stuff
function pointer.  Not impossible, but just another hoop to jump
through.  At least until we add run-time checks that ops structures
are in read-only memory, which sounds more sensible than some of the
other security hardening patches floating around.

  reply	other threads:[~2019-09-04 12:51 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-03 13:03 iomap_dio_rw ->end_io improvements Christoph Hellwig
2019-09-03 13:03 ` [PATCH 1/2] iomap: split size and error for iomap_dio_rw ->end_io Christoph Hellwig
2019-09-03 14:44   ` Darrick J. Wong
2019-09-03 15:24   ` Matthew Wilcox
2019-09-03 13:03 ` [PATCH 2/2] iomap: move the iomap_dio_rw ->end_io callback into a structure Christoph Hellwig
2019-09-03 14:46   ` Darrick J. Wong
2019-09-03 16:14   ` Matthew Wilcox
2019-09-04 12:51     ` Christoph Hellwig [this message]
2019-09-03 21:32 ` iomap_dio_rw ->end_io improvements Matthew Bobrowski
2019-09-03 22:16 ` Darrick J. Wong
2019-09-04  2:19   ` Damien Le Moal
2019-09-04  5:12   ` Christoph Hellwig
2019-09-04 11:46     ` Andreas Gruenbacher
2019-09-04 17:45       ` Darrick J. Wong

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=20190904125110.GB17285@lst.de \
    --to=hch@lst.de \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=mbobrowski@mbobrowski.org \
    --cc=rgoldwyn@suse.de \
    --cc=willy@infradead.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.