public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Al Viro <viro@ZenIV.linux.org.uk>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Nick Piggin <npiggin@gmail.com>, Jana Saout <jana@saout.de>,
	Joel Becker <jlbec@evilplan.org>,
	linux-kernel@vger.kernel.org
Subject: Re: Oops with DCACHE_WORD_ACCESS and ocfs2, autofs4
Date: Thu, 3 May 2012 18:30:25 +0100	[thread overview]
Message-ID: <20120503173025.GQ6871@ZenIV.linux.org.uk> (raw)
In-Reply-To: <CA+55aFx0EUgXCE9CfUGz6zde-6iYgUKZRxB1=-VOEG0kSX2qEA@mail.gmail.com>

On Thu, May 03, 2012 at 09:15:41AM -0700, Linus Torvalds wrote:
> I don't know the Xen paravirtualization code, but it looks like it is
> punching holes in the kernel memory map, so you get the same issue you
> get with DEBUG_PAGEALLOC.
> 
> Actually, looking at things, I think there's another case that can do
> it: the AMD gart_64 code also does set_memory_np(), which can cause
> problems.
> 
> So I guess I need to do the exception handling that I was hoping I
> wouldn't have to. Give me a jiffy.

BTW, I've looked through the ->readlink()/->follow_link() instances and
there's an interesting picture:
	* "slow" ocfs2 symlinks could bloody well use generic_readlink();
page_readlink() doesn't buy us anything when we have page_follow_link_light()
as ->follow_link().
	* "fast" ocfs2 symlinks would probably be better off if they just
added ->readlink() of their own and used the same inode_operations as
the rest of them.  And to hell with those dances with kmalloc and special
->readlink().
	* ecryptfs is *definitely* better off by switching to generic_readlink()
and having ecryptfs_follow_link() call ecryptfs_readlink_lower() directly;
we get rid of one of the rounds of kmalloc/memcpy/kfree on that, not to mention
that memcpy being killed is actually copy_to_user() wrapped into set_fs().

I've done (completely untested) patches for those - see vfs.git#symlinks;
if ocfs2 folks can live with that, I'll drop those into #for-next.

BTW, after that we have generic_readlink() for _everything_ with normal symlink
semantics.  Places that are different:
	* /proc/<pid>/{*,fd/*} - magical symlinks, ->follow_link() actually
does a direct jump.
	* /proc/self - different target for every process; we _could_ have
switched it to generic_readlink(), but I'm actually tempted to make it
a "direct jump" kind of symlink instead - its ->follow_link() would be
nicer (and faster) if we did that.
	* hppfs symlinks - those are bounced to procfs, so they inherit
the weirdness
	* afs automount points.  Those are not symlinks at all; we are
probably tied by avoiding userland breakage here, but readlink(2) on those
is badly abusing the syscall.  It's basically "which syscall could we use
to tell what'll get mounted when we step on automount point? aha, readlink()
returns a string, let's use it".
	* bad_inode - actually, we could use generic_readlink() there as well,
it'll fail with the right error ;-)  Again, this one is not quite a garden
variety symlink.
And that's it...

  reply	other threads:[~2012-05-03 17:30 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-30 12:27 Oops with DCACHE_WORD_ACCESS and ocfs2, autofs4 Jana Saout
2012-05-01 11:00 ` Joel Becker
2012-05-01 12:28   ` Jana Saout
2012-05-03  5:02     ` Nick Piggin
2012-05-03  5:57       ` Linus Torvalds
2012-05-03  5:57         ` Linus Torvalds
2012-05-03  6:23         ` Nick Piggin
2012-05-03  6:26           ` Nick Piggin
2012-05-03  6:38         ` H. Peter Anvin
2012-05-03  6:40           ` H. Peter Anvin
2012-05-03  6:54           ` David Miller
2012-05-03  6:57             ` H. Peter Anvin
2012-05-03  7:02               ` David Miller
2012-05-03  6:47         ` Al Viro
2012-05-03 16:15           ` Linus Torvalds
2012-05-03 17:30             ` Al Viro [this message]
2012-05-03 17:30             ` Linus Torvalds
2012-05-03 18:13               ` H. Peter Anvin
2012-05-03 18:23                 ` Linus Torvalds
2012-05-03 18:27                   ` H. Peter Anvin
2012-05-03 18:28                   ` H. Peter Anvin
2012-05-03 18:48                     ` David Miller
2012-05-03 21:23                       ` H. Peter Anvin
2012-05-03 19:06                     ` Linus Torvalds
2012-05-03 20:30                   ` Jana Saout
2012-05-03 21:01                     ` Linus Torvalds
2012-05-03 21:03                     ` Jana Saout
2012-05-03 21:20                       ` Linus Torvalds
2012-05-03 21:47                         ` Jana Saout
2012-05-04 11:21                         ` Jana Saout
2012-05-03  8:01         ` Jana Saout

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=20120503173025.GQ6871@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=jana@saout.de \
    --cc=jlbec@evilplan.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=npiggin@gmail.com \
    --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