All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@redhat.com>
To: Roland McGrath <roland@redhat.com>
Cc: David Howells <dhowells@redhat.com>, linux-kernel@vger.kernel.org
Subject: Re: Q: PTRACE_ATTACH && -EINTR
Date: Mon, 8 Jun 2009 20:36:27 +0200	[thread overview]
Message-ID: <20090608183627.GA14734@redhat.com> (raw)
In-Reply-To: <20090608173944.B57EBFC3C6@magilla.sf.frob.com>

On 06/08, Roland McGrath wrote:
>
> > Or even -ERESTARTNOINTR ? Or just mutex_lock() ?
>
> -ERESTARTNOINTR is right.
>
> There is nothing wrong with making it interruptible, and that might help
> something or other overall, or even be important to avoid a deadlock or
> something in some strange situation.

Agreed.

> But since the call could never return
> -EINTR before, we can't make it start now.

Yes. -EINTR just wrong.

> > Or ignore this problem since nobody complained?
>
> There has barely been time for anyone to do something strange enough to hit
> it, and they would probably not have realized what was going on even if it
> did hit.  We know we broke the ABI contract, we have to fix it.
>
> Note that every use of mutex_lock_interruptible and also down_interruptible
> can return -EINTR.  This means these really should never be used in the way
> where their return value is returned directly from some system call.  Every
> user-visible call that gets interrupted needs to return some -ERESTART*
> code and never -EINTR directly.

Sure. And we have other users of mutex_lock_interruptible() which deserve
a fix.

As for ->cred_exec_mutex, I think do_execve() needs a fix as well.

It was renamed in -next. Should I send these fixes now for 2.6.20, or we can
wait for 2.6.31 ?

Oleg.


  reply	other threads:[~2009-06-08 18:40 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-08 16:12 Q: PTRACE_ATTACH && -EINTR Oleg Nesterov
2009-06-08 17:39 ` Roland McGrath
2009-06-08 18:36   ` Oleg Nesterov [this message]
2009-06-09  1:44     ` Roland McGrath
2009-06-10 13:11       ` Oleg Nesterov
2009-06-10 17:40         ` Roland McGrath
2009-06-19  0:38           ` [PATCH] cred_guard_mutex: do not return -EINTR to user-space Oleg Nesterov
2009-06-19  2:24             ` Roland McGrath

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=20090608183627.GA14734@redhat.com \
    --to=oleg@redhat.com \
    --cc=dhowells@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=roland@redhat.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.