Re: fs: gpf in simple_setattr

From: Sasha Levin
Date: Wed Mar 26 2014 - 11:01:10 EST


On 03/26/2014 01:53 AM, Dave Jones wrote:
On Tue, Mar 25, 2014 at 10:12:29PM +0100, Jan Kara wrote:

> This fixes an oops triggered by trinity when it tried mounting
> anon_inodefs which overwrote anon_inode_inode pointer while other CPU
> has been in anon_inode_getfile() between ihold() and d_instantiate().
> Thus effectively creating dentry pointing to an inode without holding a
> reference to it.

<raises eyebrows>

Sasha, do you have changes to trinity's syscall/mount.c ?
It's kind of miraculous we managed to get the type arg right
there, because right now we're just passing a random address as an arg.
The only way that could work is if we randomly managed to do an allocation,
and then a seek & read from /proc/filesystems to that buffer. If you're
lucky enough to get all those conditions right from rand() calls, you should
probably give up on kernel hacking and buy some powerball tickets.

We should add some code to make that only return strings from /proc/filesystems,
which makes me wonder if you already did that..

Almost :)

I'm mounting every filesystem under /prov/filesystems into trinity's victims path
before trinity starts, so it gets to fuzz every filesystem known to the kernel.

For nodev filesystems it just mounts then and for nodev ones it will try to
mkfs.$fs a block device and mount that.

So basically I'm not surprised by the explanation for that bug or that trinity
has triggered it.


Thanks,
Sasha


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/