[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250122094625.GA385045@kernel.org>
Date: Wed, 22 Jan 2025 09:46:25 +0000
From: Simon Horman <horms@...nel.org>
To: Gui-Dong Han <2045gemini@...il.com>
Cc: 3chas3@...il.com, linux-atm-general@...ts.sourceforge.net,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
baijiaju1990@...il.com, kuba@...nel.org, stable@...r.kernel.org
Subject: Re: [PATCH v2] atm/fore200e: Fix possible data race in
fore200e_open()
On Wed, Jan 22, 2025 at 02:37:45AM +0000, Gui-Dong Han wrote:
> Protect access to fore200e->available_cell_rate with rate_mtx lock to
> prevent potential data race.
>
> In this case, since the update depends on a prior read, a data race
> could lead to a wrong fore200e.available_cell_rate value.
>
> The field fore200e.available_cell_rate is generally protected by the lock
> fore200e.rate_mtx when accessed. In all other read and write cases, this
> field is consistently protected by the lock, except for this case and
> during initialization.
>
> This potential bug was detected by our experimental static analysis tool,
> which analyzes locking APIs and paired functions to identify data races
> and atomicity violations.
>
> Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
> Cc: stable@...r.kernel.org
> Signed-off-by: Gui-Dong Han <2045gemini@...il.com>
> ---
> v2:
> * Added a description of the data race hazard in fore200e_open(), as
> suggested by Jakub Kicinski and Simon Horman.
Reviewed-by: Simon Horman <horms@...nel.org>
Powered by blists - more mailing lists