From mboxrd@z Thu Jan 1 00:00:00 1970 From: Toke =?utf-8?Q?H=C3=B8iland-J=C3=B8rgensen?= Subject: Re: [PATCH] net: wireless: ath: ath9k: Fix a possible data race in ath_chanctx_set_next Date: Tue, 08 May 2018 17:08:08 +0200 Message-ID: <87h8ni423r.fsf@toke.dk> References: <20180508080636.13827-1-baijiaju1990@gmail.com> <87o9hqxktc.fsf@kamboji.qca.qualcomm.com> Mime-Version: 1.0 Content-Type: text/plain Cc: ath9k-devel@qca.qualcomm.com, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org To: Kalle Valo , Jia-Ju Bai Return-path: In-Reply-To: <87o9hqxktc.fsf@kamboji.qca.qualcomm.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: netdev.vger.kernel.org Kalle Valo writes: > Jia-Ju Bai writes: > >> The write operation to "sc->next_chan" is protected by >> the lock on line 1287, but the read operation to >> this data on line 1262 is not protected by the lock. >> Thus, there may exist a data race for "sc->next_chan". >> >> To fix this data race, the read operation to "sc->next_chan" >> should be also protected by the lock. >> >> Signed-off-by: Jia-Ju Bai > > I need this reviewed by someone else before I'm willing to take it. Only possible issue I can see is that it puts a call to getrawmonotonic() under the spinlock. Not sure if that has any bad implications... -Toke