All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cyrill Gorcunov <gorcunov@openvz.org>
To: Vasiliy Kulikov <segoon@openwall.com>
Cc: Sasha Levin <levinsasha928@gmail.com>,
	khlebnikov@openvz.org, xemul@parallels.com,
	Dave Jones <davej@redhat.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: c/r: broken locking when executing map_files
Date: Sat, 5 May 2012 22:53:06 +0400	[thread overview]
Message-ID: <20120505185306.GB28746@moon> (raw)
In-Reply-To: <20120505182051.GA16029@albatros>

On Sat, May 05, 2012 at 10:20:51PM +0400, Vasiliy Kulikov wrote:
...
> > ---
> >  fs/proc/base.c |    8 +++-----
> >  1 file changed, 3 insertions(+), 5 deletions(-)
> > 
> > Index: linux-2.6.git/fs/proc/base.c
> > ===================================================================
> > --- linux-2.6.git.orig/fs/proc/base.c
> > +++ linux-2.6.git/fs/proc/base.c
> > @@ -2226,16 +2226,16 @@ static struct dentry *proc_map_files_loo
> >  		goto out;
> >  
> >  	result = ERR_PTR(-EACCES);
> > -	if (lock_trace(task))
> > +	if (!ptrace_may_access(task, PTRACE_MODE_READ))
> 
> Probably it will be better to change mutex_lock_killable() to
> mutex_lock_killable_nested() inside of lock_trace() instead of this change?
> It would keep the race-free check.

Yup, if I'm not missing something SINGLE_DEPTH_NESTING should do the trick
for us. I'll test and report.

	Cyrill

  reply	other threads:[~2012-05-05 18:53 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-02 17:23 c/r: broken locking when executing map_files Sasha Levin
2012-05-02 17:27 ` Cyrill Gorcunov
2012-05-03 17:31   ` Cyrill Gorcunov
2012-05-05 18:20     ` Vasiliy Kulikov
2012-05-05 18:53       ` Cyrill Gorcunov [this message]
2012-05-05 19:32         ` Cyrill Gorcunov
2012-05-06 20:21           ` Vasiliy Kulikov
2012-05-06 20:49             ` Cyrill Gorcunov
2012-05-11 17:56               ` Vasiliy Kulikov
2012-05-11 18:18                 ` Cyrill Gorcunov
2012-05-02 17:34 ` Pavel Emelyanov

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=20120505185306.GB28746@moon \
    --to=gorcunov@openvz.org \
    --cc=akpm@linux-foundation.org \
    --cc=davej@redhat.com \
    --cc=khlebnikov@openvz.org \
    --cc=levinsasha928@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=segoon@openwall.com \
    --cc=xemul@parallels.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.