[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAK8P3a23zUHGnVBsBX=GqBzbRxwkqmOA_7heMze4EsyQvVfg3g@mail.gmail.com>
Date: Wed, 22 Jul 2020 20:41:23 +0200
From: Arnd Bergmann <arnd@...db.de>
To: madhuparnabhowmik10@...il.com
Cc: Karsten Keil <isdn@...ux-pingi.de>,
David Miller <davem@...emloft.net>,
gregkh <gregkh@...uxfoundation.org>,
Eric Dumazet <edumazet@...gle.com>,
Networking <netdev@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
andrianov@...ras.ru, ldv-project@...uxtesting.org
Subject: Re: [PATCH] drivers: isdn: capi: Fix data-race bug
On Wed, Jul 22, 2020 at 7:23 PM <madhuparnabhowmik10@...il.com> wrote:
>
> From: Madhuparna Bhowmik <madhuparnabhowmik10@...il.com>
>
> In capi_init(), after register_chrdev() the file operation callbacks
> can be called. However capinc_tty_init() is called later.
> Since capiminors and capinc_tty_driver are initialized in
> capinc_tty_init(), their initialization can race with their usage
> in various callbacks like in capi_release().
>
> Therefore, call capinc_tty_init() before register_chrdev to avoid
> such race conditions.
>
> Found by Linux Driver Verification project (linuxtesting.org).
>
> Signed-off-by: Madhuparna Bhowmik <madhuparnabhowmik10@...il.com>
I don't think there are any users of this driver, but I had a look anyway.
The patch looks reasonable at first, but I'm not sure if you just
replace one race with another, since now the tty device can be
opened before the rest of the subsystem is initialized.
It's probably fine.
Arnd
Powered by blists - more mailing lists