linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Al Viro <viro@ZenIV.linux.org.uk>
To: Andy Lutomirski <luto@kernel.org>
Cc: Linux FS Devel <linux-fsdevel@vger.kernel.org>,
	Stephen Rothwell <sfr@canb.auug.org.au>,
	Andrew Morton <akpm@linux-foundation.org>,
	stable@vger.kernel.org,
	Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [PATCH v2 1/2] fs: Improve and simplify copy_mount_options
Date: Thu, 16 Jun 2016 00:50:47 +0100	[thread overview]
Message-ID: <20160615235047.GA14480@ZenIV.linux.org.uk> (raw)
In-Reply-To: <f2ad616567c7666cbba22f51c97fac1d09cfd200.1465871650.git.luto@kernel.org>

On Mon, Jun 13, 2016 at 07:36:04PM -0700, Andy Lutomirski wrote:
> copy_mount_options always tries to copy a full page even if the
> string is shorter than a page.  If the string starts part-way into a
> page and ends on the same page it started on, this means that
> copy_mount_options can overrun the supplied buffer and read into the
> next page.

Have you considered the possibility that there might be a reason for
having separate copy_mount_option() and copy_mount_string()?  Such as
options not being a string, perhaps?

In some filesystems (including older NFS variants) it is not a string
at all - a binary data structure, with quite a few zero bytes in it.
And no, we fucking *can't* break mount.nfs(8), no matter how we'd like
to get rid of that wart of an ABI.

IOW, NAK with prejudice - don't bring that thing back, it's hard no-go.

  reply	other threads:[~2016-06-15 23:50 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-14  2:36 [PATCH v2 0/2] copy_mount_options improvements Andy Lutomirski
2016-06-14  2:36 ` [PATCH v2 1/2] fs: Improve and simplify copy_mount_options Andy Lutomirski
2016-06-15 23:50   ` Al Viro [this message]
2016-06-16  0:01     ` Andy Lutomirski
2016-06-16  0:42       ` Linus Torvalds
2016-06-16  5:45         ` Willy Tarreau
2016-06-16  5:59           ` Linus Torvalds
2016-06-16  6:57             ` Willy Tarreau
2016-06-16  7:02               ` Willy Tarreau
2016-06-16  7:08               ` Al Viro
2016-06-16  7:25                 ` Willy Tarreau
2016-06-16  8:02                   ` Al Viro
2016-06-16  8:20                     ` Willy Tarreau
2016-06-16  8:38                       ` Willy Tarreau
2016-06-17  3:12                         ` Andy Lutomirski
2016-06-14  2:36 ` [PATCH v2 2/2] fs: Disallow mount options strings longer than PAGE_SIZE - 1 Andy Lutomirski

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=20160615235047.GA14480@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=akpm@linux-foundation.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=sfr@canb.auug.org.au \
    --cc=stable@vger.kernel.org \
    --cc=torvalds@linux-foundation.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 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).