[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y+pWzult7UDgoilC@hirez.programming.kicks-ass.net>
Date: Mon, 13 Feb 2023 16:27:10 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Luis Chamberlain <mcgrof@...nel.org>
Cc: Tetsuo Handa <penguin-kernel@...ove.sakura.ne.jp>,
Schspa Shi <schspa@...il.com>, Ingo Molnar <mingo@...nel.org>,
"Rafael J. Wysocki" <rafael.j.wysocki@...el.com>,
linux-kernel@...r.kernel.org,
Linus Torvalds <torvalds@...ux-foundation.org>,
syzkaller-bugs@...glegroups.com,
syzbot <syzbot+6cd18e123583550cf469@...kaller.appspotmail.com>,
Hillf Danton <hdanton@...a.com>
Subject: Re: [syzbot] WARNING: locking bug in umh_complete
On Mon, Feb 06, 2023 at 07:51:16AM -0800, Luis Chamberlain wrote:
> I think this seems to be the same issue that Schspa Shi reported / provided a
> fix sugggestion for [0]. This lead me to ask if:
>
> a) incorrect usage of completion on stack could be generic and;
> b) if we should instead have an API helper for that?
>
> Although he already implemented a suggestion for b) to answer a) we need
> some SmPL constructs yet to be written by Schspa. The reason I asked for
> b) is that if this is a regular pattern it begs for a) as this sort of
> issue could be prevalent in other places. So the status of Schspa's work
> was that he was going to work on the SmPL grammar to check how frequent
> this incorrect patern could be found.
Do I read correctly, from you above alphabet-soup, that someone is
working on some static analysis for on-stack completions or something?
If so, perhaps the simplest rule would to be ensure there is an
unconditional uninterruptible wait-for-completion() before going out of
scope.
This latter can be spelled like wait_for_completion() or
wait_for_completion_state(TASK_UNINTERRUPTIBLE). More specifically,
TASK_INTERRUPTIBLE and TASK_WAKEKILL must not be set in the state mask
for the wait to be uninterruptible.
If it cannot be proven, raise a warning and audit or somesuch.
Powered by blists - more mailing lists