public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@redhat.com>
To: Al Viro <viro@ZenIV.linux.org.uk>
Cc: Eric Sandeen <sandeen@sandeen.net>,
	Linux Kernel <linux-kernel@vger.kernel.org>,
	xfs@oss.sgi.com, Dave Jones <davej@redhat.com>,
	Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: 3.14-rc2 XFS backtrace because irqs_disabled.
Date: Sat, 15 Feb 2014 18:43:45 +0100	[thread overview]
Message-ID: <20140215174345.GA24799@redhat.com> (raw)
In-Reply-To: <20140215155838.GA18016@ZenIV.linux.org.uk>

On 02/15, Al Viro wrote:
>
> > Ouch...  I think I see what you mean.  Let me see if I got it right:
> > timer->sigq is *not* freed by collect_signal(); it's done by
> > release_posix_timer() instead, under siglock.  Frankly, this
> >         /*
> >          * If it is queued it will be freed when dequeued,
> >          * like the "regular" sigqueue.
> >          */
> >         if (!list_empty(&q->list))
> >                 q = NULL;
> > in sigqueue_free() smells like it's asking for races.  Sigh...

This is protected by ->siglock, should be safe...

> So basically we want a different condition for "can we just go ahead and
> free that sucker", right?  Instead of "it's on the list, shan't free it"
> it ought to be something like "it's on the list or it is referenced by
> ksiginfo".  Locking will be interesting, though... ;-/

I guess yes... send_sigqueue() checks list_empty() too, probably nobody else.


> BTW, I really wonder how does that stuff interact with PTRACE_SETSIGINFO.
> What happens if tracer does PTRACE_GETSIGINFO, changes ->si_signo to
> something blocked, shoves it back with PTRACE_SETSIGINFO and does
> PTRACE_CONT with that new signal number?  Would we get two sigqueue instances
> with the same ->si_tid, one of them matching the timer->sigq and another
> - not?

Or the task sends a SI_TIMER info to itself via sys_rt_sigqueueinfo().

Afaics, nothing really bad can happen, I mean the kernel should not
crash or something like this. do_schedule_next_timer() can be fooled,
but at least lock_timer() can only succeed if this process actually
has a timer with the same timer_id. This sigqueue != timer->sigq, but
I think this doesn't matter, posix_timer_event() will use timer->sigq
anyway.

Oleg.

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

  parent reply	other threads:[~2014-02-15 17:44 UTC|newest]

Thread overview: 65+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-11 17:27 3.14-rc2 XFS backtrace because irqs_disabled Dave Jones
2014-02-11 21:08 ` Dave Chinner
2014-02-11 21:49   ` Eric Sandeen
2014-02-12  0:44     ` Dave Jones
2014-02-12  1:09       ` Al Viro
2014-02-12  2:52         ` Linus Torvalds
2014-02-12  4:03           ` Dave Jones
2014-02-12  4:22             ` Al Viro
2014-02-12  5:40               ` Dave Chinner
2014-02-12  5:50                 ` Dave Jones
2014-02-12  6:10                   ` Dave Chinner
2014-02-12  6:31                     ` Dave Chinner
2014-02-12  6:59                       ` Linus Torvalds
2014-02-12  8:13                         ` Tejun Heo
2014-02-12 12:44                           ` Steven Rostedt
2014-02-12  8:35                         ` Dave Chinner
2014-02-12 12:50                           ` Steven Rostedt
2014-02-12 12:40                         ` Steven Rostedt
2014-02-12 13:29                           ` Peter Zijlstra
2014-02-12 14:25                     ` Dave Jones
2014-02-12 21:14                       ` Dave Chinner
2014-02-12 15:57                     ` Eric Sandeen
2014-02-12  6:28                 ` Linus Torvalds
2014-02-12  7:18                   ` Dave Chinner
2014-02-14  0:24                     ` Dave Chinner
2014-02-14 16:01                       ` Dave Jones
2014-02-15 22:23                         ` Dave Chinner
2014-02-15 22:28                           ` Dave Jones
2014-02-15 22:43                             ` Linus Torvalds
2014-02-15 23:50                       ` Linus Torvalds
2014-02-18  1:27                         ` Dave Chinner
2014-02-12 11:39                   ` Al Viro
2014-02-12 20:13                     ` Linus Torvalds
2014-02-12 21:14                       ` Al Viro
2014-02-12 21:32                         ` Linus Torvalds
2014-02-12 21:44                           ` Al Viro
2014-02-13 20:51                             ` Al Viro
2014-02-14  0:09                               ` Al Viro
2014-02-14 13:25                               ` Christoph Hellwig
2014-02-14 13:29                                 ` Richard Weinberger
2014-02-14 15:20                                   ` Al Viro
2014-02-14 16:08                                     ` Oleg Nesterov
2014-02-13 17:40                           ` Oleg Nesterov
2014-02-13 17:58                             ` Linus Torvalds
2014-02-13 18:10                               ` Oleg Nesterov
2014-02-13 18:37                                 ` Oleg Nesterov
2014-02-15  5:25                               ` Al Viro
2014-02-15 14:27                                 ` Oleg Nesterov
2014-02-15 15:22                                   ` Al Viro
2014-02-15 15:33                                     ` Oleg Nesterov
2014-02-15 15:36                                     ` Al Viro
2014-02-15 15:58                                       ` Al Viro
2014-02-15 16:59                                         ` Al Viro
2014-02-15 17:43                                         ` Oleg Nesterov [this message]
2014-02-15 18:05                                           ` Al Viro
2014-02-15 18:45                                             ` Oleg Nesterov
2014-02-17 16:57                                               ` Oleg Nesterov
2014-02-17 17:40                                                 ` Al Viro
2014-02-17 17:46                                                   ` Oleg Nesterov
2014-02-17 17:54                                                     ` Al Viro
2014-02-14 16:13                           ` Christoph Hellwig
2014-02-14 16:16                             ` Al Viro
2014-02-14 16:18                               ` Al Viro
2014-02-14 16:19                               ` Christoph Hellwig
2014-02-15 14:46                                 ` Oleg Nesterov

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=20140215174345.GA24799@redhat.com \
    --to=oleg@redhat.com \
    --cc=davej@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sandeen@sandeen.net \
    --cc=torvalds@linux-foundation.org \
    --cc=viro@ZenIV.linux.org.uk \
    --cc=xfs@oss.sgi.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox