public inbox for linux-rt-users@vger.kernel.org
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@redhat.com>
To: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Alexander Fyodorov <halcy@yandex.ru>,
	Juri Lelli <jlelli@redhat.com>,
	"Luis Claudio R. Goncalves" <lgoncalv@redhat.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	linux-rt-users@vger.kernel.org
Subject: Re: [PATCH] ptrace: fix ptrace_unfreeze_traced() race with rt-lock
Date: Mon, 2 Nov 2020 18:41:31 +0100	[thread overview]
Message-ID: <20201102174130.GA18984@redhat.com> (raw)
In-Reply-To: <20201102173059.ib4au7ia5vyynn6l@linutronix.de>

Sorry, I don't understand. If it was not clear, let me repeat that I know
nothing about kernel-rt.

On 11/02, Sebastian Andrzej Siewior wrote:
> On 2020-11-02 18:01:33 [+0100], Oleg Nesterov wrote:
>
> > So it seems I should send V2 which uses raw_spin_(un)lock_irq().
> >
> > Or even _irqsave() like ptrace_freeze_traced() does? Although this looks
> > confusing, exactly because ptrace_freeze_traced() calls task_is_traced()
> > which does raw_spin_lock_irq().
>
> Urgh. Judging from
>  release_task()
>  -> write_lock_irq(&tasklist_lock);
>  -> ptrace_release_task();
>     -> ptrace_unlink();
>        -> __ptrace_unlink();
>          -> task_is_traced().
>
> it will break on !RT so irqsave is indeed needed.

Why?

task_is_traced() does raw_spin_lock_irq() under ifdef(CONFIG_PREEMPT_RT).

Oleg.


  reply	other threads:[~2020-11-02 17:41 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-02 15:50 [PATCH] ptrace: fix ptrace_unfreeze_traced() race with rt-lock Oleg Nesterov
2020-11-02 16:25 ` Oleg Nesterov
2020-11-02 16:34   ` Sebastian Andrzej Siewior
2020-11-02 17:01     ` Oleg Nesterov
2020-11-02 17:30       ` Sebastian Andrzej Siewior
2020-11-02 17:41         ` Oleg Nesterov [this message]
2020-11-02 18:04           ` Sebastian Andrzej Siewior
2020-11-02 17:42 ` Sebastian Andrzej Siewior
2020-11-03 11:37   ` Oleg Nesterov
2020-11-03 16:45     ` Sebastian Andrzej Siewior
2020-11-03 11:39 ` [PATCH v2] " Oleg Nesterov
2020-11-03 17:01   ` Sebastian Andrzej Siewior

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=20201102174130.GA18984@redhat.com \
    --to=oleg@redhat.com \
    --cc=bigeasy@linutronix.de \
    --cc=halcy@yandex.ru \
    --cc=jlelli@redhat.com \
    --cc=lgoncalv@redhat.com \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    /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