[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <45DDDCAB.1000703@zytor.com>
Date: Thu, 22 Feb 2007 10:10:51 -0800
From: "H. Peter Anvin" <hpa@...or.com>
To: Aristeu Sergio Rozanski Filho <aristeu.sergio@...il.com>
CC: linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [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@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists