Re: [PATCH] atm/fore200e: Consolidate available cell rate update to prevent race condition
From: Markus Elfring
Date: Tue Jun 11 2024 - 03:40:22 EST
> In fore200e_change_qos, there is a race condition due to two consecutive
> updates to the 'available_cell_rate' variable. If a read operation
> occurs between these updates, an intermediate value might be read,
> leading to potential bugs.
* Would you like to explain a bit more why you find the applied mutex
insufficient for data synchronisation aspects?
* Is any special analysis tool (like “BassCheck”) involved in such a contribution?
> To fix this issue, 'available_cell_rate' should be adjusted in a single
> operation, ensuring consistency and preventing any intermediate states
> from being read.
* Please improve the change description with an imperative wording.
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.10-rc2#n94
* How do you think about to specify the name of the affected function
in the summary phrase?
* I would like to point out that similar source code adjustments can be achieved
also by the means of the semantic patch language (Coccinelle software).
Regards,
Markus