linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Boyd <sboyd@kernel.org>
To: Andrew Morton <akpm@linux-foundation.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	syzbot <syzbot+d6c75f383e01426a40b4@syzkaller.appspotmail.com>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	syzkaller-bugs@googlegroups.com, Waiman Long <llong@redhat.com>,
	Paul E. McKenney <paulmck@kernel.org>,
	Al Viro <viro@zeniv.linux.org.uk>, Jens Axboe <axboe@kernel.dk>,
	linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: Re: [syzbot] WARNING in __init_work
Date: Tue, 21 Sep 2021 11:38:16 -0700	[thread overview]
Message-ID: <163224949689.3714697.17466968510780664239@swboyd.mtv.corp.google.com> (raw)
In-Reply-To: <87sfy07n69.ffs@tglx>

Quoting Thomas Gleixner (2021-09-19 05:41:18)
> 
> Again, it cannot do that from a softirq because
> synchronize_rcu_expedited() might sleep.
> 
> > Is it possible that object_is_on_stack() doesn't work in IRQ context?
> > I'm not really following along on x86 but I could see where
> > task_stack_page() gets the wrong "stack" pointer because the task has one
> > stack and the irq stack is some per-cpu dedicated allocation?
> 
> Even if debug objects would support objects on irq stacks, the above is
> still bogus. But it does not and will not because the operations here
> have to be fully synchronous:
> 
>     init() -> queue() or arm() -> wait() -> destroy()
> 
> because you obviously cannot queue work or arm a timer which are on stack
> and then leave the function without waiting for the operation to complete.

Is there some way to make it more obvious that initializing a timer or
work on the stack in an irq context is a NONO because we can't wait for
it? Maybe some sort of debugobjects call to might_sleep() when it's
being told the object is on the stack, or throwing a might_sleep() into
the initialization of any stack based timer or workqueue, or both?

> 
> So these operations have to be synchronous which is a NONO when running
> in hard or soft interrupt context because waiting for the operation to
> complete is not possible there.
>


  parent reply	other threads:[~2021-09-21 18:38 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-15 17:00 [syzbot] WARNING in __init_work syzbot
2021-09-15 23:14 ` Andrew Morton
2021-09-16  2:29   ` Stephen Boyd
2021-09-19 12:41     ` Thomas Gleixner
2021-09-20  4:03       ` Dave Chinner
2021-09-20 12:28         ` Christoph Hellwig
2021-09-20 12:38           ` Paul E. McKenney
2021-09-20 12:45             ` Christoph Hellwig
2021-09-20 12:54               ` Paul E. McKenney
2021-09-21 18:38       ` Stephen Boyd [this message]
2021-09-21 20:19         ` Thomas Gleixner

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=163224949689.3714697.17466968510780664239@swboyd.mtv.corp.google.com \
    --to=sboyd@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=axboe@kernel.dk \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=llong@redhat.com \
    --cc=paulmck@kernel.org \
    --cc=syzbot+d6c75f383e01426a40b4@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.com \
    --cc=tglx@linutronix.de \
    --cc=viro@zeniv.linux.org.uk \
    /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;
as well as URLs for NNTP newsgroup(s).