Re: Race 1 in net/xfrm/xfrm_algo.c

From: Herbert Xu
Date: Thu Jul 21 2022 - 23:17:36 EST


On Thu, Jul 21, 2022 at 12:03:04PM -0400, Abhishek Shah wrote:
> Dear Kernel Maintainers,
>
> We found a race in net/xfrm/xfrm_algo.c. The function *xfrm_probe_algs* updates
> the availability field of items in a authentication algorithms list (
> *aalg_list* variable), but this update can occur simultaneously with
> another invocation of *xfrm_probe_algs*, leading to double writes and
> read/write consistency issues in scenarios where the *status* variable may
> vary across the concurrent invocations of the function. This behavior also
> occurs with another list with encryption algorithms (*ealg_list* variable)
> as well as with the *xfrm_find_algo* function. We thought this is
> undesirable given cryptographic logic errors often have security
> implications.
>
> We provide more details below including the trace and reproducing
> test cases.

What inconsistency are you talking about? An algorithm can always
disappear even if it was available earlier. Please state clearly
why this is actually a problem rather than relying on some automated
test whose results are useless without human interpretation.

Thanks,
--
Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt