[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAOPYjvbu5bZsKYN8XtTE1a0yXX+dyvy6p0FUVAzXiKnbpYtYzw@mail.gmail.com>
Date: Wed, 22 Jan 2025 10:48:39 +0800
From: Gui-Dong Han <2045gemini@...il.com>
To: Simon Horman <horms@...nel.org>
Cc: Jakub Kicinski <kuba@...nel.org>, 3chas3@...il.com,
linux-atm-general@...ts.sourceforge.net, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, baijiaju1990@...il.com, stable@...r.kernel.org
Subject: Re: [PATCH] atm/fore200e: Fix possible data race in fore200e_open()
> On Fri, Jan 17, 2025 at 10:28:59AM +0800, Gui-Dong Han wrote:
> > > On Wed, 15 Jan 2025 13:10:06 +0000 Gui-Dong Han wrote:
> > > > Protect access to fore200e->available_cell_rate with rate_mtx lock to
> > > > prevent potential data race.
> > > >
> > > > 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.
> > >
> > > That's not sufficient in terms of analysis.
> > >
> > > You need to be able to articulate what can go wrong.
> >
> > fore200e->available_cell_rate += vcc->qos.txtp.max_pcr;
> > In this case, since the update depends on a prior read, a data race
> > could lead to a wrong fore200e.available_cell_rate value.
>
> Hi Gui-Dong Han,
>
> I think it would be good to post a v2 of this patch with
> an explanation along the lines of the above included in
> the patch description.
Hi Simon Horman,
Thank you for your feedback. I have submitted a v2 version of the
patch with an added description of the data race hazard, as suggested.
Powered by blists - more mailing lists