lkml.org 
[lkml]   [2022]   [Oct]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] counter: 104-quad-8: Fix race getting function mode and direction
On Thu, Oct 20, 2022 at 10:11:21AM -0400, William Breathitt Gray wrote:
> The quad8_action_read() function checks the Count function mode and
> Count direction without first acquiring a lock. This is a race condition
> because the function mode could change by the time the direction is
> checked.
>
> Because the quad8_function_read() already acquires a lock internally,
> the quad8_function_read() is refactored to spin out the no-lock code to
> a new quad8_function_get() function.
>
> To resolve the race condition in quad8_action_read(), a lock is acquired
> before calling quad8_function_get() and quad8_direction_read() in order
> to get both function mode and direction atomically.
>
> Fixes: f1d8a071d45b ("counter: 104-quad-8: Add Generic Counter interface support")
> Cc: stable@vger.kernel.org
> Signed-off-by: William Breathitt Gray <william.gray@linaro.org>

Queued for counter-fixes.

William Breathitt Gray
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2022-10-22 17:13    [W:0.032 / U:0.544 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site