lkml.org 
[lkml]   [2007]   [Feb]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] tty_io: fix race in master pty close/slave pty close path
Aristeu Sergio Rozanski Filho wrote:
>
> This normally would only issue a warning on idr_remove() but in case of a
> customer's critical application, it's never too simple:
>
> thread1: opens master, gets index X
> thread1: begin closing master
> thread2: begin opening slave with index X
> thread1: finishes closing master, index X released
> thread3: opens master, gets index X, just released
> thread2: fails opening slave, releases index X <----
> thread4: opens master, gets index X, init_dev() then find an already in use
> and healthy tty and fails
>

OK, that's fiendishly subtle, as most races are, of course. I'll try to
walk through the codepaths to make sure the proposed patch doesn't
introduce a leak, but the concept sounds good.

-hpa
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-02-22 19:13    [W:0.029 / U:0.104 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site