lkml.org 
[lkml]   [2022]   [Jul]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] char: misc: make misc_open() and misc_register() killable
On Mon, Jul 04, 2022 at 07:25:44PM +0900, Tetsuo Handa wrote:
> On 2022/07/04 16:29, Greg KH wrote:
> > On Mon, Jul 04, 2022 at 03:44:07PM +0900, Tetsuo Handa wrote:
> >> syzbot is reporting hung task at misc_open() [1], for snapshot_open() from
> >> misc_open() might sleep for long with misc_mtx held whereas userspace can
> >> flood with concurrent misc_open() requests. Mitigate this problem by making
> >> misc_open() and misc_register() killable.
> >
> > I do not understand, why not just fix snapshot_open()? Why add this
> > complexity to the misc core for a foolish individual misc device? Why
> > not add the fix there where it is spinning instead?
>
> Quoting an example from [1]. Multiple processes are calling misc_open() and
> all but one processes are blocked at mutex_lock(&misc_mtx). The one which is
> not blocked at mutex_lock(&misc_mtx) is also holding system_transition_mutex.

And that is because of that one misc device, right? Why not fix that
instead of papering over the issue in the misc core?

thanks,

greg k-h

\
 
 \ /
  Last update: 2022-07-04 13:01    [W:0.078 / U:1.580 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site