From: Christoph Hellwig <hch@infradead.org>
To: Alexey Dobriyan <adobriyan@sw.ru>
Cc: akpm@osdl.org, linux-kernel@vger.kernel.org,
viro@zeniv.linux.org.uk, devel@openvz.org
Subject: Re: [PATCH 1/4] proc: fix NULL ->i_fop oops
Date: Mon, 19 Nov 2007 12:51:39 +0000 [thread overview]
Message-ID: <20071119125139.GB15942@infradead.org> (raw)
In-Reply-To: <20071116150651.GC19517@localhost.sw.ru>
On Fri, Nov 16, 2007 at 06:06:51PM +0300, Alexey Dobriyan wrote:
> proc_kill_inodes() can clear ->i_fop in the middle of vfs_readdir resulting in
> NULL dereference during "file->f_op->readdir(file, buf, filler)".
>
> The solution is to remove proc_kill_inodes() completely:
> a) we don't have tricky modules implementing their tricky readdir hooks which
> could keeping this revoke from hell.
> b) In a situation when module is gone but PDE still alive, standard readdir
> will return only "." and "..", because pde->next was cleared by
> remove_proc_entry().
> c) the race proc_kill_inode() destined to prevent is not completely fixed, just
> race window made smaller, because vfs_readdir() is run without sb_lock held and
> without file_list_lock held. Effectively, ->i_fop is cleared at random moment,
> which can't fix properly anything.
Nice, getting rid of this is a very good step formwards. Unfortunately
we have another copy of this junk in
security/selinux/selinuxfs.c:sel_remove_entries() which would need the
same treatment.
next prev parent reply other threads:[~2007-11-19 12:51 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-16 15:06 Alexey Dobriyan
2007-11-19 12:51 ` Christoph Hellwig [this message]
2007-11-20 15:05 ` Stephen Smalley
2007-11-20 15:17 ` Christoph Hellwig
2007-11-20 15:22 ` Stephen Smalley
2007-11-21 14:01 ` [patch 1/1] selinux: do not clear f_op when removing entries Stephen Smalley
2007-11-21 14:13 ` Christoph Hellwig
2007-11-21 21:35 ` James Morris
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=20071119125139.GB15942@infradead.org \
--to=hch@infradead.org \
--cc=adobriyan@sw.ru \
--cc=akpm@osdl.org \
--cc=devel@openvz.org \
--cc=linux-kernel@vger.kernel.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
all inboxes | Powered by JetHome®