mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: Greg Kroah-Hartman <gregkh@suse.de>
Cc: <linux-kernel@vger.kernel.org>, Tejun Heo <tj@kernel.org>,
	Hugh Dickins <hughd@google.com>
Subject: [PATCH 0/2] Fix mmap bugs with sysfs_remove_bin_file
Date: Mon, 20 Sep 2010 00:55:33 -0700	[thread overview]
Message-ID: <m1aanc3l3e.fsf@fess.ebiederm.org> (raw)


While reviewing the sysfs mmap code in fs/sysfs/bin.c I found two
rather nasty potential issues.

The first is if one of our wrapped mmap implementations implements
vma->close() we do not call it at sysfs_remove_bin_file time leading
to who knows what carnage.

The second is that we are potentially accessing the wrapped vm_ops
after sysfs_remove_bin_file has completed.   Which could be a problem
if it is a modular user.

I don't know of any real world instances of problems.  None of the
bin attribute mmaps functions that I know of today implement a close
method.  However it seems prudent to fix these now before we have
track down some mysterious weird failure with hotunplug.

Eric W. Biederman (2):
      sysfs: Fail bin file mmap if vma close is implemented.
      sysfs: only access bin file vm_ops with the active lock
---
 fs/sysfs/bin.c |   68 ++++++++++++++++++++++++++++----------------------------
 1 files changed, 34 insertions(+), 34 deletions(-)

             reply	other threads:[~2010-09-20  7:55 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-20  7:55 Eric W. Biederman [this message]
2010-09-20  7:56 ` [PATCH 1/2] sysfs: Fail bin file mmap if vma close is implemented Eric W. Biederman
2010-09-22 19:31   ` Hugh Dickins
2010-09-22 21:01     ` Eric W. Biederman
2010-09-20  7:57 ` [PATCH 2/2] sysfs: only access bin file vm_ops with the active lock Eric W. Biederman
2010-09-22 19:49   ` Hugh Dickins
2010-09-22 21:59     ` Eric W. Biederman

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=m1aanc3l3e.fsf@fess.ebiederm.org \
    --to=ebiederm@xmission.com \
    --cc=gregkh@suse.de \
    --cc=hughd@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tj@kernel.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

Powered by JetHome